
I am a huge fan of the Arduino platform. Basically it is a Pi without a brain. It is dirt cheap and absurdly capable. Anytime I need to do something with only logic level compute response I reach for an Arduino.
The problem was my girlfriends cats kept peeing on her new rug. She wanted a way to automatically squirt them if they got too close.Â
It is 3 IR sensors which when triggered activate a stepper motor to rotate the orange squirt gun to generally face in that zone. Then the ultrasonic sensors sweep the area for fine tuning with help from the stepper base to dial in the actual location of an object. If the object is within 18" of the sensors, they activate the electronic squirt gun for 0.5 seconds. It works surprisingly well considering the sketchy build quality. Adding my most recent working code below.
Disclaimer: This project was stolen, modified, and remixed from some people online who had built something similar. You can find a number of these projects on YouTube.

The original design was a hopper fed plastic bb gun auto sentry gun. It was downvoted for humane reasons. Still was pretty cool.Â

Inspiration from a 1950's sci-fi movie. I printed out radar dishes then attached them with an Arduino Uno to a stepper, a servo, and a dc motor (not shown) to teach the kids the difference between the drive types. Kinda related to the sentry gun.