Automatic Stair Lights

by hackplague in Circuits > Arduino

7361 Views, 121 Favorites, 0 Comments

Automatic Stair Lights

20210825_170825.jpg
DSCF4805.JPG
Automatic Stair Lights
DSCF4782.JPG

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

Amazon, Banggood

5x HC-SR04 Ultrasonic Sensor

Amazon, Banggood

1x LDR Module

Amazon

1x LM2596 Dc-Dc Buck Converter

Amazon, Banggood

1x LED Strip (Warm White) 5 Meter

Amazon

1x 12V 2A SMPS

Amazon

1x ULN2003 IC

Amazon, Banggood

5x Foot Lights

Amazon

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

DSCF4745.JPG
DSCF4737.JPG
DSCF4733.JPG
DSCF4734.JPG
1 (1).JPG
1 (2).JPG
1 (3).JPG
buck.jpg
20210725_194520.jpg
1 (6).JPG
cover.png
1 (4).JPG
1 (5).JPG
  • 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

1.JPG
1 (5).JPG
2.JPG
mod.png
3.png
DSCF4722.JPG
4.JPG
7.JPG
8.png
6.JPG
9.JPG
10.JPG
11.JPG

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

Stair Light Circuit color.png
Artboard 1.png
Stair Light Circuit 2.png
ckkktsignal.png
DSCF4752.png
20210825_165258.png
DSCF4748.JPG
DSCF4758.JPG
20210825_165246.jpg
20210725_194533.png
DSCF4764-min.png
DSCF4760.JPG

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

Multiple Ultrasonic Sensor using single board
test
logic diagram.png
Library.png
ino.png

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 library


Download Code: