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

} }

Hey, we made the very same thing just one year back. :) Will be making a video on it but planning to give some upgrades.
<p>Hi,</p><p>Nice project, you may be interested in this one, for ideas on adding animations and controls:</p><p>https://www.instructables.com/id/Automatic-IoT-Staircase-Glowing-Lighting/</p>
<p>With 2 sensors you can build a flip-flop without time consideration.</p>
<p>Very nice!</p><p>I've also fiddled around with a lighting solution for my stairs to replace the traditional light bulb and came up with this:</p><p><a href="http://imgur.com/a/FWpA0" rel="nofollow">http://imgur.com/a/FWpA0</a></p><p><iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/Sls3iGtDKvY" width="500"></iframe><br>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.</p>
<p>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. ☺</p>
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).
Very nice.<br>I knew it already but never get idea to use it on stairs.<br>Thanks a lot...

About This Instructable




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