Alright so in this project we wil be making a thief alarm using a PIR sensor, Arduino, Relay and a car horn!
Step 1: Parts You Will Need
so for this project you will need:
1x --- PIR Sensor HC-SR501
1x --- 5v Relay board
1x --- Arduino nano
1x --- 12v 60 decibel car snail horn
1x --- 12v 3s 200mah battery
1x --- 12v 3s 2000mah battery
And also some jumper wires and a soldering iron
Step 2: The Circuit
the potentiometers on the PIR HC-SR501 are used to adjust sensitivity and output timing.
Here is the circuit which you need to solder.
Step 3: Putting All the Components in a Box
once you have finished all of the circuit i printed a small box with my 3d printer to fit everything inside.
I will include the stl files right here!
If you do not have a 3d printer you could still create a box yourself so don't worry!
Step 4: Connecting the Horn Up to the Relay
So heat up your soldering iron again and follow this schematic!
Step 5: The Arduino Code
Please note that ALL CREDIT for the code goes to the arduino website :
What I did is just modify the code so that the relay works with the PIR Sensor, so for this project please download the arduino code not from the arduino website but from here.
Also note that when you upload/restart the arduino the sensor dedicates 30 seconds to calibrate.
Step 6: Finishing Off
Now get some super glue or hot glue and if you want you can follow these images on how i put everything together!
Step 7: Preview
for the preview i connected the horn to a 7.4v source since i didn't want to annoy the neighbors. But the horn should be able to go up to 12v safely. I also trimmed the potentiometer to only click the relay for around 3 seconds also to not annoy the neighbors.