Automatic Stair Lights
The main idea behind this project is that I want to control each light separately. each light act according to my foot position and remains active during the nighttime.
Features
- Day-Night Senser
- Single Arduino Board
- Separately control each light
- High Accuracy
Supplies
Hardware Components
Components | Source |
---|---|
1x Arduino Pro Mini | Amazon, Banggood |
1x FTDI Programmer | |
5x HC-SR04 Ultrasonic Sensor | |
1x LDR Module | |
1x LM2596 Dc-Dc Buck Converter | |
1x LED Strip (Warm White) 5 Meter | |
1x 12V 2A SMPS | |
1x ULN2003 IC | |
5x Foot Lights | |
1x Electronic Enclosure | |
Wire(Ethernet cable) |
Software
Arduino IDE
Hand tools and fabrication machines
1. 3D Printer
2. Soldering Iron
3. Glue gun
Collecting Supplies
- Here I only use havells footlight outer body, you can use any footlight or any light for this project.
- For easy soldering, I used the ULN2003 stepper Motor Driver you can only UN2003 IC.
- Two pieces of Warm White 12v LED strip, for each led light.
- I used my old LAN cable for wiring, you can use any wire.
- For Arduino programming, you will require an FTDI programmer.
- I use 12V 2A SMPS, you can use any 12V 1-2A Supply.
Light Assembly
HCSR04 sensor is used in a single-wire mode which means a single wire for both echo and trigger.
- First, extend 3 sensor wires (+5V, Signal, GND) as shown above. Here I use masking tape to protect the sensor during soldering
- Cut out two LED strips and place them over the 3d printed LED base.
- For sensor, placement cut out two circles on the top of the footlight. so that sensor is placed inside the LED light.
- Solder out +12V, GND wire of LED strip to footlight.
- Place sensor and 3d printed eye to the LED light.
The single LED light is ready, now 4 lights are remaining.
Circuit and Wiring
I am using an ultrasonic sensor in single-wire mode,using only one wire for trigger and echo
US1 =>Echo =>Trigger = Signal 1 (Short Both echo and trigger of 1 ultrasonic sensor)
US2 =>Echo =>Trigger = Signal 2
US3 =>Echo =>Trigger = Signal 3
US4 =>Echo =>Trigger = Signal 4
US5 =>Echo =>Trigger= Signal 5
Arduino Pro Mini | HCSR-04 Ultrasonic Sensors |
---|---|
Pin 8 => | US1 = Signal 1 = Echo1+Trigger1 |
Pin 9 => | US2 = Signal 2 = Echo2+Trigger2 |
Pin 10 => | US3 = Signal 3 = Echo3+Trigger3 |
Pin 11 => | US4 = Signal 4 = Echo4+Trigger4 |
Pin 12 => | US5 = Signal 5 = Echo5+Trigger5 |
GND => | US 1,2,3,4,5 (GND) |
Arduino Pro Mini | ULN2003 I.C |
---|---|
Pin 3 => | Pin No.1 |
Pin 4 => | Pin No.2 |
Pin 5 => | Pin No.3 |
Pin 6 => | Pin No.4 |
Pin 7 => | Pin No.7 |
GND => | Pin No.8 |
Arduino Pro Mini | LDR Module |
---|---|
Pin 2 => | LDR Output Pin |
GND => | GND |
ULN2003 I.C | LED(1,2,3,4,5) |
---|---|
Pin No.10 => | LED.5 (GND) |
Pin No.13 => | LED.4 (GND) |
Pin No.14 => | LED.3 (GND) |
Pin No.15 => | LED.2 (GND) |
Pin No.16 => | LED.1 (GND) |
LM2596 Dc-Dc Buck Converter Output | Arduino+LDR+US |
---|---|
+5 V => | (+5V LDR),(+5V U.S),(+5V Arduino) |
Power distribution is shown in photos.
Downloads
Programming and Testing
Programming is straightforward each sensor of LED collects distance data and acts according to it.
If the distance is within the range and LDR is in HIGH state(during Nighttime) then LED lights up.
LED will remain ON for 15 seconds using the millis() function. The Block diagram of this LEDs logic is shown above.
This Code doesn't use any delays and is event-driven.
You can think of it as multitasking.
Now comes the testing part I have tested this project for more than 1 month and it works fine in my case.
If you want to know more about code and its working you can view my previous instructable.
https://www.instructables.com/Multiple-Ultrasonic-...
Download Code: