Introduction: 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);

} }

Comments

author
AndreiD24 (author)2017-02-19

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.

author
samee14326 (author)AndreiD242017-06-27

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...

author
AndreiD24 (author)samee143262017-07-04

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.

author
AndreiD24 (author)samee143262017-07-04

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 ?

author
samee14326 (author)2017-06-27

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... ....

author
AvtarG (author)2017-02-24

test

author
AvtarG (author)AvtarG2017-02-24

f

author
Being Engineers (author)2017-02-22

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

author
berlingozzo (author)2017-02-20

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/

author
rafununu (author)2017-02-20

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

author
BeachsideHank (author)2017-02-19

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. ☺

author
rephus (author)BeachsideHank2017-02-19

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).

author
iTECHKING (author)2017-02-18

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

About This Instructable

3,833views

84favorites

License:

Bio: Software engineer, fan of electronics and videogames.
More by rephus:Smart staircase LED lightingVideogame controller holder (compilation)Protoss pylon with light
Add instructable to: