Hello everybody! Today I'm going to show you how to make a really simple motion detector with a PIR sensor.
Step 1: Parts
For the motion detector, you will need:
- Piezo buzzer (1)
- PIR sensor (1)
- Arduino Uno (1)
- LED (1)
- 10k Resistor
- Jumpers (several)
Step 2: The Circuit
Let's get right in to the build:
- 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.
- Now take out your LED. Connect its anode to digital pin 13and its cathode to ground.
- 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!
Step 3: The Code
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!