Smart Staircase LED Lighting

4,821

93

13

About: Software engineer, fan of electronics and videogames.

Intro: Smart Staircase LED Lighting

For a long time, we've been turning on the lights at the beginning the staircase, just to turn them off when we reach another floor.

But instead, we built a simple system to turn them ON automatically when you are going upstairs or downstairs, just by using a couple of IR proximity sensors, a relay and an Arduino Pro Mini, to control the timing.

If you want to build your own, just follow our guide.

Step 1: Shopping List

You can optionally use a power converter (from 12v to 5v) if you want to take advantage of the 12v input to power your Arduino and sensors.

Step 2: Schema

Step 3: Arduino Code

#define IR_RECEIVER 8

#define RELAY 10

void setup() { // initialize digital pin LED_BUILTIN as an output. pinMode(RELAY, OUTPUT); digitalWrite(RELAY, LOW);

}

// the loop function runs over and over again forever void loop() {

int sensorValue = digitalRead(IR_RECEIVER); // print out the value you read: delay(10); // delay in between reads for stability

if (sensorValue == 0 ) { digitalWrite(RELAY, HIGH); // turn the LED on (HIGH is the voltage level) delay(5000); } else { digitalWrite(RELAY, LOW);

} }

Share

    Recommendations

    • Furniture Contest 2018

      Furniture Contest 2018
    • Tiny Home Contest

      Tiny Home Contest
    • Fix It! Contest

      Fix It! Contest

    13 Discussions

    0
    None
    AndreiD24

    1 year ago

    Very nice!

    I've also fiddled around with a lighting solution for my stairs to replace the traditional light bulb and came up with this:

    http://imgur.com/a/FWpA0


    Basically the same idea (PIR sensors and an atmega328) with a few tweaks. For me the goal was powering the thing with a 5V 1A phone charger (or a power bank), I wanted it to light up even if it was no power coming from the wall.

    3 replies
    0
    None
    samee14326AndreiD24

    Reply 1 year ago

    hi i like it ... i am trying to build by using arduino uno and two pir sensors and relays and 5050 rgb leds 4sets. problem is when down pir detects and process starts and when a person reach to up then the up pir sensor also detecting it and reserving the process and running it after first process completed automatically... that is it detects as up to down processs...

    0
    None
    AndreiD24samee14326

    Reply 1 year ago

    Sorry for the previous comment, i didn't understand the problem properly, the issue can be solved in code, you may want to add a time period in which the sensor input is ignored to avoid that false trigger. But it's up to you to play with the timing until you find a solution that works best for you. I've gone with a 2.5s delay after the leds started turning off.

    0
    None
    AndreiD24samee14326

    Reply 1 year ago

    You can put a glass shim near the sensor so it blocks the infrared radiation from the opposite side of the staircase. You can adjust it so it only triggers up to half of the way ?

    0
    None
    samee14326

    1 year ago

    if you travel down to up then the down ir detects and starts the process and when you reach to up then up ir also detects so what is the result ? i am working with pir sensors but my problem is after down pir sensor detects and process started person cross to up pir then up pir also detects and reserving the process and running process automatically after first process completed... how to put hold one pir sensor if another detected... ....

    0
    None
    Being Engineers

    1 year ago

    Hey, we made the very same thing just one year back. :) Will be making a video on it but planning to give some upgrades.

    0
    None
    berlingozzo

    1 year ago

    Hi,

    Nice project, you may be interested in this one, for ideas on adding animations and controls:

    https://www.instructables.com/id/Automatic-IoT-Staircase-Glowing-Lighting/

    0
    None
    rafununu

    1 year ago

    With 2 sensors you can build a flip-flop without time consideration.

    0
    None
    BeachsideHank

    1 year ago

    I just ordered an IR fired lamp for my hallway, this'd probably be better since it senses in both coming and going directions, good design here. ☺

    1 reply
    0
    None
    rephusBeachsideHank

    Reply 1 year ago

    Nice, before using these 2 IR sensors, I used a PIR sensor in the middle of the staircase, but it was very unstable. It was even turning itself on when the oven in the kitchen was working (because of the invisible heat wave, I guess).

    0
    None
    iTECHKING

    1 year ago

    Very nice.
    I knew it already but never get idea to use it on stairs.
    Thanks a lot...