Smart Staircase LED Lighting

by rephus in Circuits > Sensors

8172 Views, 106 Favorites, 0 Comments

Smart Staircase LED Lighting

cover.png
Smart staircase LED lighting
arduino.jpg
downstairs.jpg
upstairs.jpg

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.

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.

Schema

schema.png

Downloads

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

} }