Cat Repelling PIR motion sensor (covert) speaker box alarm using Arduino
This is a PIR motion sensor device that works with the arduino uno. In order to make it covert enough to be placed in multiple settings and portable enough to fit most places, I decided to make the case for it appear as a speaker.
My cat is a jerk. One of his favorite things to do is to alarm me that he is hungry every morning at 4am by sitting on my dresser and knocking random things over until I wake up. Unfortunately, my dresser is also parallel to my craft table, so he has turned my dresser into a work of art by walking across my oil paintings and jumping up there (and also throughout the rest of the house). I could lock him out of my room, but then he cries outside the door all night, so I’ve been trying to come up with a solution to this problem.
After looking through Instructables and finding out what is possible with the arduino, I decided to make a motion sensing device for my dresser that will play cat repelling noises until Mr. Moe is trained out of his annoying behavior.
Step 1: Materials you will need:
The Motion Sensor:
V battery clip
2.1mm power plug
Various lengths of wire
PIR motion sensor
Piezo buzzer alarm (9V or lower)
Heat Shrink Tubing
USB cable (to arduino)
Tools for Motion Sensor:
The Speaker Case:
Phillips Panhead screws – 1/4″ (2)
Phillips Panhead screws – 1/2″ (4)
Interior Construction Adhesive
Black paint (flat)
Tools for Speaker Case:
Drill (with various bits)
Step 2: Program the Arduino:
I found a good code here: http://make-documents.s3.amazonaws.com/fv1fYSLfy6QRgANM.pdf
Open the pdf and copy the code into a new sketch in the arudino program.
I found one small error in the code where a comment stating ” numbers 10, 11)” ran into the program. Just delete this or cut and paste it in it’s proper place right above the line.
Compile, and then plug in the arudino with the USB cable and upload it.
Next you can begin to construct your motion sensor circut.
Step 3: Attach the PIR Sensor:
First you will connect the arduino to the PIR motion sensor. Gather your wires and cut three to about 6 inches and strip the ends so that they can easily be plugged into the slots of the arduino. I recommend using wires of different color or shrink tubing to make things easier to remember.
Once your wires are cut, you will need to solder your wires to your PIR sensor.
The wires with the tubing in the picture (black, red, and yellow) are the wires I attached to my PIR.
Wire 1: Plug into the second GND slot in the arduino and twist the opposite end of the wire to the GND peg of the PIR. (black in the picture)
Wire 2: 5v slot of the arduino to VCC of the PIR. (red in the picture)
Wire 3: Slot 2 to of the arduino to OUT peg in PIR. (yellow in the picture)
WARNING: Do not connect VCC to VIN. I burned out my arduino this way.
Step 4: Attach your Piezo Buzzer:
Now you are ready to hook up your piezo buzzer.
Most piezo buzzers have wires attached to them: the black wire goes to GND and the red wire to pin 10. If yours doesn’t, don’t worry. The polarity in this case isn’t integral.
(In the picture the buzzer’s wires are solid black and solid red)
JLCPCB – Prototype 10 PCBs for $2 + 2 days Lead Time
China’s Largest PCB Prototype Enterprise, 300,000+ Customers & 10,000+ Online Orders Per Day
Inside a huge PCB factory: https://www.youtube.com/watch?v=_XCznQFV-Mw
This Post / Project can also be found using search terms:
- program sensor pir speaker