Introduction: Anti-cat Countermeasures (kind Of)
Welcome to the first Arduino related Instructable of my whole life, courtesy of Instructables and Mediatek Linkit One.
I have to be honest: I am not a very Arduino person but more a simple-bots maker. Even I still see persons who are skillful in Arduino as some kind of techno wizards. But after some weeks, when I finally completed and debugged my first sketch, I thought "Mmmm... interesting!", and when it finally worked in the Linkit One, I shouted "YEAH!" like I have created the atomic bomb.
But I have a big problem: our cat Cringer loves to turn my workshop into a mess. I stand up one single moment, and he jumps over the table, play with the electronic components and spread them all over the home. So I thought my first project had to be some kind of electronic guardian with non-lethal weaponry that keeps my cat out of the area.
Cringer hates four things: vacuum cleaner, sprays, hairdryers and a broken bubble gun I got from one nephew. My cat hates when I aim the bubble gun to him, not because the bubbles (that function doesn't work anymore), but because the sound of the blower and maybe the air coming from it.
So I got this awesome battle plan:
- Hack the gearbox of the bubble gun to have to actions: blower and small catapult (modifying the water pump).
- Create a "gun turret" to install the bubble gun.
- Install the Linkit One with an ultrasonic sensor, to detect proximity of the cat.
- When the sensor detects movement, the turret will deploy two countermeasures: defensive (the blower will work, annoying the cat) and offensive (the catapult will launch a plastic ball, so the cat gets a more interesting target to chase out of the workshop).
- Workshop protected.
- Mario is happy.
Did it work? Well, not in the way I was expecting...
Step 1: Materials
MECHANICAL
- 1 Broken bubble gun
- 1 Circle cap from a coffee machine
- 3 chairs from a big toy car (legs for the turret)
- 1 Ferrero Rocher chocolates' box.
- 1 big plastic angle (the red piece)
- 1 Plastic coat hanger
- 1 Iron angle
- 1 plastic cylinder from toilet odorizer applicator
- Assorted plastic pieces, nuts, screws and washers.
- 1 plastic ball
ELECTRONICAL
- 1 Linkit One with battery
- 1 Ultra Sonic HCSR-04 Range Finder
- 1 small breadboard
- 1 relay module
- Wires (except for the LinkitOne, I got the other components from a Chinesse bootleg Arduino kit from eBay)
BIOLOGICAL
- 1 cat
TOOLS
- Dremel rotary tool
- Screwdrivers
- Pliers
- Hobby knife
- Soldering iron
Step 2: Disassembling the Bubble Gun
I removed the screws and the broken case, leaving only the gearbox (blower and pump, both powered by the same the motor.)
Step 3: Transforming the Water Pump Into a Better Gearbox
I opened the gearbox carefully, checking where every piece have to be when I have to assemble it again. Then I removed the water hose.
I removed the shaft from the big gear, replacing it for a long screw. I opened holes in the plastic case, where the previous shaft was, to give space for the new longer shaft.
I introduced the new shaft and screw the gear on it, then I closed the case.
I installed a hard plastic cylinder in the free end of the shaft, so I could install the pieces for the catapult.
Step 4: Mounting for the Gearbox
I cut the plastic cylinder from the odorizer applicator and installed it to the gearbox. Then I attached the iron angle and installed a screw on it, where the catapult will stop for a moment to accumulate energy and give more impulse to the ball.
Step 5: Catapult
I cut a plastic strip from the coathanger, and then fixed a circular piece from the bubble gun, to keep the ball. Then I attached the catapult to the plastic cylinder of the gearbox, using screws. I cut the remaining parts of the coathanger strip.
Step 6: Turret Feet
I attached the toy car chairs to the coffee machine cap, using screws.
Step 7: LinkIt One Case and Gun Stand
I took the chocolates box (without chocolates) and opened two holes for the "eyes" of the ultrasonic sensor.
Then I opened a hole in the center of the box, the center of the turret base and one of the sides of the plastic angle, and I attached them using a screw.
Step 8: Electronics and Arduino Code
I connected the components to the LinkIt One ports in this way:
LinkIt 3V3: to one of the terminals of the gearbox motor.
LinkIt 5V: to the Vcc terminal of the ultrasonic sensor and the 5V terminal of the relay
LinkIt GND: to the GND terminal of the ultrasonic sensor, the GND terminal of the relay and one of the switch terminals to the relay. The other switch terminal will be connected to the other terminal of the gearbox motor in order to activate it.
LinkIt D13: to the Echo terminal of the ultrasonic sensor.
LinkIt D12: to the Trig terminal of the ultrasonic sensor.
LinkIt D8: to the SIG terminal of the relay.
For the sketch, I checked a lot of Arduino instructables to get some inspiration, but the one I analized the most was the Simple Walker Robot from Randofo. Then I try to find the common points to make an ultrasonic sensor works.
The sketch is the following:
/*Code written by M.C. Langer. Be gentle, it´s my first Arduino sketch
*/
#define trigPin 12 // define the pins of your sensor
#define echoPin 13 // define the pins of your sensor too
int rate = 1000; // I saw everybody uses this constant for ultrasonic sensor, so I will do the same for the moment. this constant won't change. It's the pin number
void setup() { Serial.begin(9600);// initialize serial communication at 9600 bits per second
pinMode(8,OUTPUT); pinMode(trigPin, OUTPUT);// set the trig pin to output to send sound waves
pinMode(echoPin, INPUT);// set the echo pin to input to receive sound waves
delay(5000);
}
void loop() {
long duration, distance; // start the scan
pinMode(trigPin, OUTPUT);
digitalWrite(trigPin, LOW);
delayMicroseconds(2); // delay
digitalWrite(trigPin, HIGH);
delayMicroseconds(5); // another delay (I don't get it. It's easier with Lego Mindstorms)
digitalWrite(trigPin, LOW);
duration = pulseIn(echoPin, HIGH);
distance = (duration/2) / 29.1;// convert the distance to centimeters.
if (distance < 50) /*if there's an obstacle in a distance less than 50 centimeters, then... Wait, this is more like Lego Mindstorms. I get it! */
{
digitalWrite(8,HIGH); delay(7000);
}
else
digitalWrite(8,LOW);
}
Step 9: Completing the Turret
I placed the electronic part inside the case, and then I attached the gun to the turret. I needed and extra iron strip. Then I placed a plastic ball in the catapult. The turret is ready for test!
Step 10: So... Did It Work?
The first problem was to bring the cat to my desk. Of course, that cat climbs everytime to my table. But just when you need he to do that on purpose, that cat decides it's funnier to pee my bed. Even I tried throwing some sausage pieces to the desk. Nothing.
Finally, after hours of surveillance, Cringer decided it was a good time to mess with my tools.
The results:
- The system was activated as it was intended.
- The bubble gun was designed to work with 4.5 volts. My system only gives it 3 volts or less, so that explains why the blower doesn't have its cat annoying effect, and why the ball doesn't fly that high.
- When the cat saw the ball falling to the ground, he couldn't be less interested.
- The blower didn't annoy and scare the cat. In change, the spinning catapult had a mesmerizing effect over the cat. This two minutes video is just a segment of like ten minutes of footage where the cat is frozen over my chair, just watching how the catapult spins and spins...
Conclusion:
It worked, but not the way it was intended. The cat loves it, but the repetitive noise is really annoying for the human...
So I decided to dismantle the project. This new knowledge in Arduino and ultrasonic sensors gave me a new idea, and the bubble gun gearbox will be great for another experiment.
And meanwhile, I will have to keep picking electronic components that my cat leaves around the flat.

Participated in the
Spectacular Failures Contest

Participated in the
Animal Innovations Contest
25 Comments
6 years ago
Fantastic. Lovely instructable project.
Reply 6 years ago
Thanks a lot, D6equj5!
7 years ago
Hahahaaa! Your video and writeup are hilarious! :)
Reply 6 years ago
Thanks!
7 years ago
Thanks! :-)
7 years ago
Very nice instructable, and your cat is very funny!
Reply 7 years ago
Thanks Poppy100!! :-)
7 years ago
great job.....
Reply 7 years ago
Thanks!
7 years ago
This is great! Pair up with our catastrophic fail Intel Cat Enrichment Device , which put the cat to sleep while we worked on it, and cats have nothing to fear from either of us! Cool project and great story! Congrats!
Reply 7 years ago
Thanks!!!! I just read your instructable. The best idea for our future is to keep away from cats... LOL! :-)
Reply 7 years ago
Definitely! :-)
7 years ago
I almost missed this one~ How amusing~ Might I suggest one that sprays water? I think that might work. I would add something safe into the water that cats don't like that smells bad. Maybe a little vinegar. Great job Mario, so good to see your sharing again. Have a great week.
sunshiine~
Reply 7 years ago
Thanks Sunshiine! My short time doesn't let me to share as often as I used to. But good to read from you, too!
About the spray: my cat hates sprays, too. Even I thought in that idea, but I didn't want to expose my electronical components to any kind of moisture. But the vacuum cleaner sound sounds good! :-)
Reply 7 years ago
Yeah, I should have thought about that. Hopefully you can make a barking dog or growling lion. So great to hear you are keeping busy.
Have a safe and happy holiday season.
sunshiine~
7 years ago
This is cheaper than buying a dog and much more durable !
Reply 7 years ago
Thanks!!!!
7 years ago
Oh yes, and maybe something that makes a spraying or hissing sound. Cats do not like that. Or you could make an audio tape of the sound of a vacuum cleaner, I think that would freak him out.
7 years ago
cat? no cyborg cat? :)
(also is that a part of a cyborg costume in the last pic?)
Reply 7 years ago
Cyborg cat? Why? He already causes a lot of trouble being an average cat!
(And yes, it's a motorized cyborg arm I made here in Azerbaijan. You can check my previous instructables, I made some like this)