Introduction: Cat Repelling PIR Motion Sensor (covert) Speaker Box Alarm

 
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. 


The inspiration for this project:

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:
Arduino Uno
9V battery9
V battery clip
2.1mm power plug
Various lengths of wire
PIR motion sensor
Piezo buzzer alarm (9V or lower)
LED
Heat Shrink Tubing
Solder
USB cable (to arduino)


Tools for Motion Sensor:
Soldering Iron
Wire clippers

The Speaker Case:
Paneling
Plywood
Phillips Panhead screws - 1/4" (2)
Phillips Panhead screws - 1/2" (4)
Hot Glue
Interior Construction Adhesive
Black Pantyhose
Primer
Black paint (flat)

Tools for Speaker Case:
Power saw
Ruler
Dremel Tool
Drill (with various bits)

Step 2: Program the Arduino:

The first thing that you should do is to upload the motion sensor code to your 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)

Step 5: Attach the LED:

Next connect the LED's anode (longer leg) to peg 13 on the arduino and the cathode to GND (ground). You don't need this for function, but it is good to have in order to see that your alarm is working properly in case the buzzer is busted (it lights up when alarm is activated).

Step 6: Assemble the Battery:

I recommend using the arduino's USB power cable to test the circut in case the battery is old or too weak. If everything works as it should, then it's time to hook up the 9V battery.

Take the battery clip and the 2.1mm power plug. If you unscrew the top of the plug you should see that inside are two metal pieces, one short and one long.

Now pull out your shrink tubing, solder, and soldering iron. Take a piece of shrink tubing and fit it over the red wire of the battery clip.

Then, take the battery clip's red wire (+) and put the metal through the hole on the short leg of the power plug. Once it looks well connected, solder the connection and then pull the shrink tubing over it. Use the barrel of the soldering iron (not the tip!) to heat the shrink tubing so it fits nice and snug over your connection.

Next repeat all of this with the black wire and the long leg of the power plug. Don't forget to add the shrink tubing first before you solder.

Once everything is connected, plug it in and attack your 9V battery. If it is working correctly, it should look like this:



Step 7: Build the Case: Prepare the Wood

You need to begin by priming the wood you are using and set it aside to dry. Once that is done, CAREFULLY measure out the walls of your speaker (yea I made a few errors there).

I used the measurements 4x6" for the sides and 4x4" for the top and bottom. Also you will need an additional piece that will act as the front of the speaker that should be about  5 1/2" x 3 1/2 " and a piece for the insides later to hold down your arduino that is 5 3/4" x 3 1/2".

For extra support, also cut four 1x1 x 6 inch rectangles of wood for the inside of the box.

To make things simpler to follow, lets call:
side pieces (4x6) - A
top and bottom pieces (4x4) - B
speaker front piece (5 1/2 x 3 1/2) - C
arduino support piece (5 3/4 x 3 1/2) - D
rectanglar support pieces (1x1 x 6) - E

Cut all the pieces out with a power saw. Then, after making sure that they fit together, sand them.


Step 8: Further Box Preparation: PIR Sensor Slot and Front Piece

Next take piece C and draw a rectangle inside it that is 1/2" away from each side. Then use your drill to cut holes in the corners so it is easier to use your power saw (mine was hand-held). After that, cut out the rectangle so pice C is hollow in the middle. Sand it so everything looks smooth and set it aside.

Then you will need to measure out and draw where the PIR sensor will be. I placed mine at 3.5" high and centered. Don't forget to add a space for the node on it's side.

I used the drill and the dremel tool (and it's multiple heads) to cut out the slot for the sensor.
WARNING: Dremel tool heads can break very easily.

Make sure the PIR sensor fits. I had to repeat this step twice to get it right.

Next, drill tool to put holes in the bottom of the panel for the PIR sensor so that the sound of the buzzer can travel out easier. I also put some holes in the lid of the box later when I noticed my buzzer wasn't loud enough, but that it optional.

Step 9: Put It Together:

Now it's time to glue! Put a thin strip of Interior Construction Adhesive (glue) on one of the rectangle supports and then on one of the sides and hold for about 10 seconds.

The nice thing about this glue is that it takes about 15 minutes to set, so if you make a mistake you can fit it.

Put together your box as shown (making sure to leave the top piece off ) and then leave the glue to dry for at least an hour.

Step 10: Paint:

Now that the box is dry, it's time to sand it again. Making sure that there are no rough edges or glue sticking out, then dust it off and paint it. I used Royal Exterior's flat black (acrylic latex) . It took about 3 coats to have a solid finish.

Step 11: Secure the Arduino and Attach the PIR:

Next put the arduino into the center of peice D and use at least two small screws (1/4") to secure it. 

Then slide it into the box and put a  big screw (1/2") into the top of it going into one of the rectanglar supports (piece E) opposite of the PIR sensor side.

Now put your PIR sensor in place and hot glue it down.

Step 12: Finishing It Up:

Now get out the panty hose and cut out a rectangle. This is going to pull over piece C to make it look like the front of the speaker. Super glue or hot glue the hose in place and then center it attach it to your box over the PIR sensor via hot glue (or Interior Construction Adhesive).

Now you need to put on the top. If you drilled holes in it to let that extra noise through like I did, I would recommend also covering this with panty hose. Then take your large screws (1/2") and screw it into the box.

And viola!! You now have a discrete motion sensor device to deter, alarm, or annoy the subject of your choosing.

Step 13: Project Revisions:

Some things that I did as revisions to make it extra spiffy:
In order to make the screws blend into the box paint them black. It definately makes it look more like a speaker that way.

Also, since this project is held together with glue it would be wise to secure it into place. I used stick on velcro and it held together VERY STRONGLY. The nice thing about this is that you can add it to multiple locations and as an adhesive it is very cost-efficient and effective.

I also added a larger buzzer to the project, but I included this in my steps to make it. This was my original buzzer:

Comments

author
RegineT1 (author)2014-10-13

Is there anyone out there who has an idea of making code for aduino uno? I'm having a hard time doing my project. I have no idea of what code to use. My project is about a gh-718c mini PIR motion sensor detecting my arm or hand. If the motion sensor detects that my hand is low, the light or LED will dim, and if it detects my hand on a high position, the LED will bright up. Please please. Help please. Thanks for the reply!

author
ConductorX made it! (author)2014-04-23

Nice project I built one using a cat litter bucket as the container. Mine uses a relay to activate an LED light and a windshield washer motor to squirt some water. The water is stored in a separate bucket and discharged through a 180 sprayer used for sprinkler systems.

cat_defense_001sml.jpg
author
klee27x (author)2013-06-22

I have a jerk cat, too. I have made a similar device to yours, except with a vacuum cleaner instead of a speaker. This keeps him in the downstairs.

http://i18.photobucket.com/albums/b103/klee27x/SAM_0394_zps32ab6137.jpg

http://i18.photobucket.com/albums/b103/klee27x/SAM_0396_zps80c76523.jpg

http://s18.photobucket.com/user/klee27x/media/SAM_0393_zpseb193eec.mp4.html

author
dario.massaro (author)2012-12-20

Is it possible to have it emit a frequency that only cats can hear, so as not to disturb sleeping humans? Not a frequency that harms, but one that annoys/repels. I wager the buzzer going off at 4 AM gets annoying fast.

author
Treasure Tabby (author)2012-12-14

Poor kitty. Also you could have used a cheaper way for telling kitty that territory is out of bounds. Just use a balloon and two sided tape and stick it on the offending wall or table. The pop and stickiness alone should let him or her know. Worked with my kitty and to this day he as in my kitty, is a little fluff ball of a gentleman. Just have to know how to speak his language. ;) Also you should and every one else should play more with their kitties. It also makes them loving and content kitties. Keeps them from being trouble makers in the first place. Busy paws need something to do after all.

author
ray74 (author)2012-12-14

Very nice. I have also used a piece of packing tape set down sticky side up. Very entertaining :)

author
kidNeutrino (author)2012-12-14

high five!

iI9Hs21228.jpg
author
stringstretcher (author)2012-12-14

Nice! Your cat is not only a jerk, he is a wimp if that buzzer scares him off! You might need a vibrating motor or a motor with a stick on it, just like I put in the cherry tree one fall to keep the birds away. Kept the neighbor's cat away, too! The design on my books will use an air cannon to give the cat one good puff of compressed air. Kitty no likey pfffft!
I like the PIR... need try this.