PIR Motion Sensor Alarm

by drewwebster16 in Circuits > Sensors

1484 Views, 3 Favorites, 0 Comments

PIR Motion Sensor Alarm

pirsensor.jpg

Create a circuit that detects moving objects from a distance of up to one meter away. When an object is detected by the sensor, an LED light will turn on for seven seconds in response. Great for students and hobbyists of any experience level (does require a basic level of circuits and breadboards), and a fun gadget to show off to friends, family, or coworkers.

Supplies

  • 9V battery and battery clip
  • Breadboard
  • HC-SR501 motion sensor
  • NE555 timer
  • 2N3904 transistor
  • LED light
  • 100μF and 1000μF capacitors
  • 100k, 10k, and 470Ω resistors (one of each)
  • Breadboard jumper wires (anywhere from 10 to 20 wires should suffice)

Motion Sensors

PIR-Sensor-Working-Pyroelectric-Sensor-Two-Detection-Slots.png

The Pyroelectric InfraRed (PIR) Motion sensor works using the change in infrared light detected by two slots in the sensor. When nothing is passing the sensor, the two slots detect the ambient light in the room, both registering the same amount of IR light. When something which radiates heat, such as a human body, passes the sensor, one slot will detect a change in the amount of IR light while the second slot does not, and the change between the two will send a signal to the rest of the circuit.

The sensor I am using (HC-SR501) has two potentiometers on the circuit board, one which affects the time delay and one which adjusts the sensitivity of the sensor, which ranges from 1 meter to about 7 meters away. When creating my circuit, I did not adjust either potentiometer.

A helpful guide on PIR sensors can be found here.

Schematics

motionsensor.png

The above picture shows the schematic I created for this project in LTSpice. Since there's no actual way to test a motion sensor through a computer screen, you're not able to actually test the schematic through LTSpice, but rest assured, it does work.

Building the Circuit

Once you've gathered all your supplies, you can begin building your circuit right away! If you need a refresher on breadboard basics, a helpful video tutorial can be found here.

I recommend beginning with the NE555 component, connecting the two sides of the board with it. This way, you can work around the pins numerically so that you can easily keep track of where you are. Begin with the ground pin (pin 1) which is (obviously) connected to ground, or the negative side of the battery clip. You can have the battery clipped into the circuit the entire time, as there's no danger of shocking yourself, which can help test the circuit continuously, but you might end up draining your battery in the process.

From there on, continue using the NE555 component as a base for your circuit, connecting pin 2 to a junction with the 10k resistor and the collector pin of the transistor. Follow the rest of the pins until everything is connected. The motion sensor should not be directly pinned into the board, but rather set slightly apart using jumper wires so that you can angle the sensor in whatever direction you want it to be in.

Common Mistakes and Tips

309351.image0.jpg
2n3904-transistor-pinout-equivalent.gif

Here are some common mistakes in this circuit that I ran into, all of which are easy to fix!

  • NE555 Component
    • Make sure that this component is placed the right way. Remember that pin 1 (GND) is directly under and to the left of the notch at the top of the component, followed by pin 2 (TRIG) directly underneath, then pin 3 and 4, with pin 5 being the bottom and right-most pin, with pin 6 and 7 above that one, and pin 8 (VCC) directly under and to the right of the notch.
  • LED and Capacitors
    • While resistors can be placed in the circuit in any way, LEDs and capacitors require specific placement. The current needs to flow through these elements the correct way, from the voltage source to ground. The longer pin on these elements generally correlates to the positive pin, and the shorter to the negative pin. Corresponding to the circuit, you should place the LED or capacitor so that current flows from the negative pin to the positive pin. Therefore, if your LED doesn't turn on at all, just try flipping it around!
  • Transistor
    • Again, this is a matter of correct placement. When looking directly at the flat side of the transistor, the order of pins from left to right is emitter, base, and collector. The emitter pin should be connected to ground.
  • Motion Sensor
    • When looking at the motion sensor so that the pins are facing you, the order of pins from left to right is voltage, output, and ground. Again, make sure that all of these pins are placed correctly.