Cat Inappropriate Pooper Deterrent
I've been having a problem with one of the cats not using the litter box, even though I keep it clean. He likes a certain spot. (I put down a paper bag just to help protect the floor.) I have a cam focused on the spot so I am sure of the culprit, but he does it at different times so I can't catch him in the act. Now, I love my cats and wouldn't do anything to harm them. But I needed a way to deter DJ from doing his duty in the wrong spot. I've tried all other approaches that I looked into.
I made an Arduino setup to deter this activity, while being completely harmless. I could have used a pressure sensor or motion sensor, but I want the cats to be able to access the cat tower which is right there, without setting the thing off. So I needed to be able to set a timer -- if the cat is paused in position for a defined number of seconds, it will activate a remote control to start the device. The device I'm using is an electric (corded) leaf blower. Again, harmless, but fairly loud and the added wind vortex is a bonus. A vacuum cleaner is a decent alternative.
Supplies
Arduino Uno or equivalent (I used an Elegoo Nano)
electric leaf blower or other harmless noise maker or deterrent device (one you can plug in)
remote on/off control for electric device (Fosmon C-10683) https://www.amazon.com/Wireless-Fosmon-Electrical-Weatherproof-Included/dp/B072F9DGRL?th=1 If you get another kind, it should be a one-button module -- one press to turn the item on, another press to turn it off. This particular one needed a few seconds to "pair" once plugged in, so check the instructions.
relay SRD-05VDC-SL-C - make sure to get the module as pictured, not just the relay box (Sorry, it doesn't work as a link -- just copy and put the link below in your address bar to see an example)
https://www.amazon.com/Geekstory-Channel-Module-SRD-05VDC-SL-C-Arduino/dp/B08R8TMT73/ref=sr_1_4?dib=eyJ2IjoiMSJ9.BnNgxcbGKc6U-zYP6HBTEU4H2URjuL_sADORs6rKybXTen0uzlylfAwAvSpyPnrMLf3NfmT65uwp_Mej_0X9p70T1UbV-5EB462sP8N8gHnlxgx7rOMu8lpRBXJdCa57W7K6pyDetVasCRn059iBAB-Ytfbid8MxAzylN7W4_S6F9JS_qUYl5xOtfmM-MEHypMSmOpmrh_p7akQrhrVtGcyEaXU-R2HIKCN5cncl6UI.IiT6WGQ9qnsmRtH7NLWkIphyXTIVOX7Fhyq6x3hO_70&dib_tag=se&keywords=srd-05vdc-sl-c&qid=1718902270&sr=8-4
ultrasonic sensor HC-SR04 https://www.amazon.com/HC-SR04-Ultrasonic-Distance-Measuring-MEGA2560/dp/B088BT8CDW
breadboard, jumper wires, solder
Prepare the Connections
The remote control normally activates a device when the button is pressed. Then turns it off when pressed again. The change is to remove the manual button press and instead allow the relay to activate the remote for the signal. (I think you could connect the device's wires directly to the relay and eliminate the remote, but I'm not sure about working with 120v or if the relay would handle that current, so I went the safest route.)
Remove the battery if there's one in there and pop apart the remote module.
Pop the button out - this will expose the button connection below it.
The button has four connector flanges. Two of them are actually dummies so you don't need to do anything with those. Solder a positive and negative wire to the active poles. It doesn't matter which is which.
For neatness' sake, cut a little exit hole for the wires in the side of the remote.
Pop the remote back together and put the battery in it.
Run Tests
Wire up the Arduino, the relay, the remote, and the ultrasonic sensor as indicated in the .ino file.
Instead of hooking up the leaf blower or vacuum right away, connect the remote receiver/power switch to a light bulb or lamp instead.
Run some tests, changing the activationDistance, activationPeriod, and activationDuration in the code to get the right parameters for your setup. The code is set up so that the LED on the board (pin 13) will light when the pet is within the range (activationDistance) you set in the code. If the cat is "just passing through", the remote device will not activate if the time within range of the sensor is lower than the time set in the code (activationPeriod). The activationDuration is how long you want the device to run. A few seconds should suffice!
The code is set up to send two signals when activated -- one to turn the device on, a pause for the activationDuration to run, then another signal to turn it off.
Downloads
Place Setup and Wait!
Place the setup in the spot you want to deter your pet from spending any time in, aiming the ultrasonic sensor to the target spot. Connect the remote power module to the device, plug it in, and turn the device to ON. It should stay powered off until activated by the remote setup. Run a couple tests by holding a sheet of paper in the target area. The activation light will come on when it is in range. It will turn the device on if the activationPeriod time limit is met, then turn it off after the activationDuration time is passed.
Again, anyone just passing through the area should not set it off, depending on how you set the activationDistance and activationPeriod. If it works out well, it shouldn't take more than a time or two for your pet to get the message!