Professional Documents
Culture Documents
Automatic Staircase Lightning
Automatic Staircase Lightning
COST- 250
This tutorial will teach you how to make the simplest motion detecting staircase light without any
need of any additional microcontroller and programming using PIR based Sensor.
PIR sensor
2.
3.
d. BC547 Transistors
e. LED
4.
Bulb with bulb holder (Wattage and type of bulb is of your choice)
5.
6.
Wires
7.
12V adapter
8.
Female DC jack
9.
Plastic box
About Relays
The switches at our home need to be operated manually by hand or mechanically triggered in order
to work. If we need to control the switch using a microcontroller or electronic circuit, we would require
extra mechanical arrangements like a servo with an arm, to press the switch. Instead of building such
complicated arrangements we can go with a relay. These can directly be controlled by electrical
means.
Working of Relay
The above shown diagram is of a SPDT (Single Pole Double Throw) Relay. It consists of 5 terminals.
Two of them are from the coil where the input to drive the relay is supposed to be given. The other
three are NO (Normally Open), NC (Normally Closed) and COM (Common).
When no input is given to the coil, there is no magnetic field produced. So the NC and COM
terminals are connected and the NO terminal is left free.
When the input is given, the current flowing through the coil produces magnetic field (Basic physics)
and thus attracting the lever, which breaks the connection between COM NC and makes a
connection between COM NO terminals.
Free-wheeling diode
There is a problem in connecting a relay directly to an electronic circuit. When the input power is
suddenly removed to switch OFF the relay, a voltage spike occurs due to the presence of the inductive
load (The coil inside the relay is an inductor right?). This voltage spike can permanently damage the
electronic circuit to which the relay is connected to. And thus we require a diode.
A diode connected in reverse bias with respect to the input supply, will prevent the voltage spike
(produced by the relay when the supply is suddenly switched OFF) from reaching the other part of the
control circuit.
Next, we need something to supply enough current to the relay input so that it doesnt trip
unexpectedly. So we use a transistor in between microcontroller and relay. And the circuit becomes like
this:
Note: You can buy relay modules which come with the above required circuit in-built. This is what it
looks like:
I couldnt get a single relay module so Im using a 2 Relay module which looks like this:
2.
3.
4.
Robust.
Hardware Setup
First, lets start with wiring the light. Choose a CFL or incandescent bulb of appropriate wattage. Gather
all the parts shown in the image.
Connect one long wire and one short wire to the two terminals of the male plug
Open the back cap of the bulb holder and connect other end of the long wire to one terminal of the
bulb holder
Connect another short wire to the other terminal of the bulb holder and close the bulb cap.
Plug in the bulb and this is what you would have now
Note: The actual length of the wires used depends on the distance between a) Plug point, b) Where
you want the light to be put and c) Where the sensor is being placed at your home. Choose
appropriately.
Now you are done with the AC part of the circuit. Arrange the remaining part as per the circuit
diagram.
Next, connect the wires coming from the bulb holder and the plug to COMMON and NORMALLY OPEN
terminals of the relay.
Once you are done with testing on breadboard, start soldering on PCB.
Take some male headers and solder them onto a small PCB, followed by the wires coming from PIR
sensor and the power supply wires.
Find an appropriate enclosure to accommodate the PIR sensor and relay module. Remember that the
PIR sensors lens should be out.
Mark the area to be cut for letting out the sensors lens out of the box.
Try fitting it normally and incase if it doesnt stay fit, use hot glue to stick the sensor
Place the relay module/ your own made relay circuit into the box and mark the place where it should
be placed.
Use nuts and bolts to fix the relay into the box. Then mark and cut the place where the screw terminals
are visible. This is to let in the AC wires for connecting to the relay terminals.
Also make a hole at the bottom (opposite to the relay board) to let out the DC power supply wire.
Place everything inside the box neatly, connect all the wires and pull out the power supply wires
through the hole.
Solder the female DC jack to the power supply wires. Be very careful with the polarity.
Now connect the AC wires to the relay terminals through the holes. Plug in the 12V adapter to the DC
jack.
Thats it! You are ready with your device. Now place the device at such a place that the motion sensor
gets triggered whenever someone ascend or descends the stairs.
For example, the staircase at my home is at right angle and so I placed the sensor and light near the
bend so that the sensor covers maximum distance. Have a look at it:
Video: