Night Security Light with Hacked PIR sensor

pir sensor

Security lighting is widely used as a preventive measure against intrusions on a physical piece of property. Since adequate lighting around a physical structure reduces the risk of an intrusion, security lighting can be used in residential settings to increase the feeling of safety. Presented here is a trusty security light activated by a passive infrared sensor, turning on only when a person (or other mammal) approaches. This battery operated security light provides rich illumination without harsh brightness great for kids rooms, the elderly, and for comforting your pets. An important feature of this security light is that it wakes up only at nighttime!

Described security light circuit design is centered around an inexpensive passive infrared (PIR) motion detector module, type HC-SR501. The PIR motion detector module is used here with an added ambient light detection (day/night) feature, supported by a generic photodiode. Following part is prepared to help you get started with your new HC-SR501 passive infrared motion detector module, so let’s start.

Note that imparting the ambient light detection feature involves skillfully combining one photosensitive component and the motion detector electronics with a great deal of dexterity. First of all remove the fresnel lens, and search for the “LDR” pads located near the PIR sensor element. Next, attach a 5mm/3mm (generic) silicon photodiode with its anode (A) connected to pad-A, and cathode (K) connected to pad-K. Finally, add a 120K resistor in parallel with the 1M resistor (105) mounted near the “LDR” pads at the reverse side of the circuit board. When all of the solder process is completed, take back the fresnel lens to reseat it, and make sure that everything is found in order (refer the indicators shown below).

night light pir sensor

When the modification is finished, connect HC-SR501 to the rest of the circuit built around discrete components as shown in the circuit diagram. The HC-SR501 requires an initialization time of about 60 seconds, and might become active for 0-3 times during this initialization period. Thereafter HC-SR501 enters in standby mode, and ready for motion detection. You can adjust the “delay” potmeter clockwise to increase the time delay (3s-300s). Similarly, turning the “sensitivity” pot clockwise increases the detection sensitivity (3-6 metres). Default position of the “mode selection” jumper is “L”. The author opted for common AAx4 battery unit (1.5Vx4) to generate 6V dc supply for the entire system, and the “switched” dc supply available from the battery unit is used to energize a single-white light source (generic 8mm White LED). Note that, an interesting “vibrating alert” trickery is also incorporated in the design with the help of an ordinary electromagnetic relay altered to work like a mechanical vibrator (see its strange wiring). For better results, you can replace this sugar cube relay with a standard vibrator motor (available as replacement part for mobile phones/pagers).

Night Security Light with PIR sensor circuit

A medium-size perfboard is enough for construction of the night light system. After construction it is better to enclose the finished system in an appropriate cabinet. The preferred set up suggests drilling suitable holes in the cabinet wall and attaching the system so that its sensor, light, and switch windows are aligned with the holes. The circuit described so far is intended for use as a night security light. It is, however, readily adapted for many other automatic/security lighting applications.


Parts Used

  • HC-SR501 PIR Motion Detector Module – 1
  • BS170 Mosfet – 1
  • 1N4007 Diode – 4
  • 3mm Red LED – 1
  • 8mm White LED (generic) – 1
  • 3mm/5mm Photodiode (generic) – 1 (see text)
  • 47uF/16V Electrolytic Capacitor – 2
  • Resistor 2K2 ¼ w – 1
  • Resistor 100R ¼ w – 1
  • Resistor 120K ¼ w – 1 (see text)
  • 5V/100R SPDT Relay – 2
  • On/Off Switch SPST/SPDT – 1

Hacked PIR?

It was observed that most hobbyists don’t know about the “LDR” option in HC-SR501 PIR motion sensor module. That’s why I started my (failed) experiment with a standard 5mm LDR in place of the photodiode used in the given circuit. Just after the failure, I leaped into the circuit diagram of HC-SR 501 PIR module and found that one end of the LDR pad is connected to ground (0v),where other end is connected to vcc (+3.3v) through a high-value resistor (here in my HC-SR501 PIR module, through a 1M resistor).

HC-SR501 PIR motion sensor

Technically, LDR/CDS is a “trigger disable input” (VC) of the BISS0001 IC. It is reserved for a “photosensitive” input to distinguish between day time and night time. When the input voltage at VC is high the PIR input is enabled. On the other hand, when VC is low the PIR input is disabled (VC >0.2Vdd=enable; Vc <0.2Vdd =disable). No doubt, this calls for a high-resistance LDR, normally a difficult to get component (atleast for me). So, I decided to alter the resistor value from M to K range to use a standard photodiode as the ambient light sensor. Feel free to message with any suggestions or feedback. If you found any design flaws or better design solutions then I am obliged, thank you very much for letting me know!