Simple Motion Detector

by OnTheBrink in Circuits > Sensors

3257 Views, 29 Favorites, 0 Comments

Simple Motion Detector

IMG_0264.JPG

Hello everybody! Today I'm going to show you how to make a really simple motion detector with a PIR sensor.

Parts

IMG_0259.JPG
IMG_0257.JPG

For the motion detector, you will need:

  1. Piezo buzzer (1)
  2. PIR sensor (1)
  3. Arduino Uno (1)
  4. LED (1)
  5. 10k Resistor
  6. Jumpers (several)
  7. Breadboard

The Circuit

IMG_0258.JPG
IMG_0256.JPG
IMG_0260.JPG
IMG_0261.JPG

Let's get right in to the build:

  1. Connect the left-most lead of the PIR sensor to 5v and the right-most pin to ground. Connect the middle pin of said sensor to digital pin 2 of the Arduino.
  2. Now take out your LED. Connect its anode to digital pin 13and its cathode to ground.
  3. Now for the buzzer. Identify the anode and cathode of your buzzer (the anode should be the longer lead and the cathode is the shorter lead). Connect the anode of the buzzer to digital pin 10 and its cathode to ground.

Now for the code!

The Code

IMG_0262.JPG

All you got to of now is upload the code. Now you have working motion detector! You could replace the one LED with Neopixels to create motion-initiated mood lighting patterns. You could also change the tones of the piezo buzzer so that it played a song instead of just screeching. Thanks for reading and, as always, Happy Making!

Downloads