Introduction: Simple Burglar Alarm Using PIR Sensor
Greetings! As one of the hobbyists out there and a big fan of DIY projects especially from instructables, I decided to create a free account for myself and publish my very own simple DIY projects for certain applications just for the sake of learning by doing and for fun. For the past years, i've been creating projects using the arduino and its derivatives however, using a programmable board simplifies the circuit implementation alot that sometimes makes the work less challenging. As a student, after learning about the basics on transistors and other commonly used discrete components, i decided to apply what i've learned so far by trying to limit the use of programmable boards in doing some projects. This series of instructables would serve as the manifestion of my goal.
For questions, concerns, clarifications, corrections etc.
email me at: firstname.lastname@example.org
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: Materials
- switch (optional)
- PIR sensor (GH-718C)
- 5.1V zener diode
- 0.47uF and 100nF capacitor (you can use other values for the cap. the ones written are just those available in my toolbox)
- 2N3906 PNP transistor
- 2N3904 NPN transistor
- 2k ohm resistor
- 2pcs 1k ohm resistor
- 120 ohm resistor
- jumper wires
- variable dc supply
Step 2: Circuit Config
Configure the circuit based from the schematic as shown. Minimize the use of jumper wires and make the actual circuit as small as possible so that it won't be noticeable if you want to implement the actual functionality of the circuit. In this project(and in most of my future instructables later on), a small breadboard is more than enough to test and implement the prototype version of the project.
Step 3: Discussion
The PIR sensor available at hand is widely used together with the arduino derivative boards in motion sensing projects by detecting temperature changes in an area within its range. When turned on, it captures an 'image' of the surroundings within range. Not all moving objects would trigger the sensor. However, a moving body that causes a relatively large temperature deviation within its range would turn on its output pin creating a voltage signal.
The GH-718C PIR sensor has 3 pins namely: Vin(+), Output and Ground(-). Since this breakout board is compatible with the arduino, I used a 5.1V zener diode with a series resistor of 2k ohm sourced from the output of a 12V linear regulator. The resistor would reduce the voltage across the reverse biased diode to 5.02V as measured from my multimeter. Putting a smaller value resistor would increase the voltage across it. For example, when i replaced the 2k ohm with a 120 ohm resistor, the voltage across the diode would go as high as 5.3V. I used the voltage across the diode as input to the PIR sensor (Vin+) and grounded the third pin(-). When the sensor is triggered, the open circuit voltage at the ouput pin would go high from 0 to 3.3V (measured value). Once the motion stops, the pin would go back to 0V. The voltage signal of 3.3V would be enough to turn on the transistor Q2 (2N3904). Here we are using the transistors as switch therefore the range of voltage values needed to turn on both 2N3904 and 2N3906 would be around 0.7V up to its max rating which is 6V based on the datasheet.
Connecting the transistor configuration (base of Q2) into the output pin of the PIR sensor would introduce what we call the loading effect greatly reducing the voltage output of the PIR output pin. Putting a 120 ohm resistor between the emitter of Q2 and ground would increase the input resistance of the transistor configuration. Using a multimeter, the voltage across the output pin is 3.18V when the emitter degenerated Q2 is connected.
The 1k ohm resistor at the collector of Q2 was chosen so that the voltage across it would be somewhere between 0.8V and 1V. This would ensure that the Vbe of Q1 is enough to cause the transistor(Q1 - 2N3906) to operate at saturation. This would in turn 'squeeze' the voltage across its emitter and collector to 0V (usually minimum of 0.2V) causing the voltage across the 1k ohm resistor at the collector of Q1 to be a little bit close to 12V. The actual voltage across the resistor as measured was 11.5V - 11.78V. The buzzer was then connected in parallel with the 1k ohm resistor of Q1 which converts the voltage signal from the output pin of the PIR to an audio signal with a frequency and volume dependent on the applied DC level. The higher the voltage level, the higher the volume.
Step 4: Implementation
The fully configured circuit is shown. I used an unregulated supply to power the circuit. The actual supplied voltage is around 13.88V although it says 12V on the label of the supply. Once connected and the switch is turned on, the buzzer would sound at every motion of a relatively hot body within its range.
Step 5: References
PIR sensor specs:
Participated in the
Sensors Contest 2016