This tutorial will teach you how to make the simplest motion detecting staircase light without any additional microcontroller and programming using PIR based Sensor.
About PIR Sensor
To know more about how it works, go to this link: How PIR Sensor works
PIR sensor detects the motion of human body and not the human body itself so the triggering happens only when the body is moving and not at rest.
Sensitivity and High Time
Some PIR sensors come with two potentiometers used to adjust the sensitivity and duration of the high pulse once a motion is detected. Make sure that both of them are set to high since we would require the PIR to be quick and also keep the light in ON state for a longer duration (Imagine the light going OFF midway before the person ascends/descends the stairs completely. You wouldn’t want that to happen, would you?)
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.
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.
Advantages of Relay
First, let’s start with wiring the light. Choose a CFL or incandescent bulb of appropriate wattage. Gather all the parts shown in the image.
Fig. 1: Image showing different components used in staircase lighting
Note: 2 pin male plugs will also do the job.
Connect one long wire and one short wire to the two terminals of the male plug.
Fig. 2: Image showing wiring of a 3-pin plug
Fig. 3: Image showing a 3-pin plug with neutral and live wire connections
Open the back cap of the bulb holder and connect other end of the long wire to one terminal of the bulb holder.
Fig. 4: Image of a Bulb Holder
Fig. 5: Image showing wiring of bulb holder with 3-pin plug
Connect another short wire to the other terminal of the bulb holder and close the bulb cap.
Fig. 6: Image showing wiring of bulb holder
Plug in the bulb and this is what you would have now.
Fig. 7: Image showing complete wiring of staircase light
Note: The actual length of the wires 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.
Fig. 8: Image showing Relay Module used for automatic switching of staircase light
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.
Fig. 9: Image showing male header soldered on a PCB to connect PIR Sensor
Fig. 10: Image showing PIR Sensor connected to PCB Layout
Fig. 11: Image showing wiring for power supply to the PIR sensor
Find an appropriate enclosure to accommodate the PIR sensor and relay module. Remember that the PIR sensor’s lens should be out.
Fig. 12: Image of box used to package PIR sensor and Relay Module
Mark the area to be cut for letting out the sensor’s lens out of the box.
Fig. 13: Image showing marking by a pen on the box to make a cut-out for assembling PIR sensor
Fig. 14: Image showing PIR Sensor assembled on the box
Place the relay module/ your own made relay circuit into the box and mark the place where it should be placed.
Fig. 15: Image showing placement of Relay module inside the box
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.
Fig. 16: Image showing Relay Module securely assembled inside the box
Fig. 17: Image showing marking by a pen on the box to make a cut-out for connections with Relay Module
Fig. 18: Image showing cut-out made on the box for wire connections with the Relay Module
Also make a hole at the bottom (opposite to the relay board) to let out the DC power supply wire.
Fig. 19: Image showing hole drilled for power supply in the box
Place everything inside the box neatly, connect all the wires and pull out the power supply wires through the hole.
Fig. 20: Image showing complete wiring of PIR Sensor and Relay Module inside the box
Solder the female DC jack to the power supply wires. Be very careful with the polarity.
Fig. 21: Image showing female DC jack connected to PIR Sensor Module
Now connect the AC wires to the relay terminals through the holes. Plug in the 12V adapter to the DC jack.
Fig. 22: Image showing complete wiring of Staircase Light with PIR Sensor based Relay Driver Module
That’s it! You are ready with your device. Now place the device at a place such 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:
Fig. 23: Image showing installment of Staircase Light and PIR Sensor based Module on staircases of a house
Project Source Code