If you want to keep the cats off the counter, a squirt bottle is an easy discipline method. However, you can’t always be in the room. If you want to keep them off the counter even when you’re not around, you can build your own motion-activated squirt bottle using a few off-the-shelf parts.
Squirt bottles use a simple lever to pump water from a base into a nozzle that sprays water outward. That simple mechanism makes it relatively easy to control with a small motor or servo. It’s so easy, in fact, that Raid even made an auto trigger squirt bottle with a small battery.
For this project, we’ll be disassembling this specific model of Raid bottle, but the same equipment and principles can be applied to any squirt bottle. Some may find it easier to use a servo with a string wrapped around the trigger, others can connect a motor directly to the nozzle’s mechanics.
Inside the Raid bottle, you’ll find a red and white wire connected to a battery compartment. You can start by clipping these wires, stripping the ends and, for convenience, extending them with some extra wiring and some solder. Be sure to use heat shrink to cover the connections you’ve just made. If you’d rather not use this method (or if you can’t get your hands on this Raid squirt bottle), keep reading and by the end you’ll at least know enough to start rigging up your own squirt bottles.
Since this project can be done a variety of ways, we’ll break the parts list into two sections. The first list includes everything you’ll need, regardless of what bottle you end up using:
Arduino Uno | ![]() |
A diode | ![]() |
NPN transistor | ![]() |
A breadboard | ![]() |
A PIR motion sensor
(I’m using an XC-4444) |
![]() |
Arduino IDE | ![]() |
Next, the following list includes materials you’ll need for the Raid-specific variation. This setup can be a bit cleaner in the final product, but since the bottle is uncommon, you may need to adapt this guide to your needs.
Raid Max Auto Trigger Bottle
(Our guide is designed for the Raid variety, but you can adapt an auto-trigger bottle as long as it’s similar!) |
![]() |
Heat shrink | ![]() |
As mentioned above, disassemble the top of the Raid bottle, remove the battery compartment, and solder some extra wire to the ends of the red and white wires connected to the motor. This will make it easier to complete the rest of the wiring.
You’ll also need a few more generic pieces, such as extra wiring, a USB cable, and a soldering iron.
If you followed our guide on how to use the PIR proximity sensor, the code here should look pretty familiar, but with a couple small tweaks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
const int motionPower = 13; const int motionIn = 12; int motor = 3; void setup(){ pinMode(motionPower, OUTPUT); pinMode(motionIn, INPUT); pinMode(motor, OUTPUT); digitalWrite(motor, LOW); digitalWrite(motionPower, HIGH); Serial.begin(9600); } void loop(){ int value= digitalRead(motionIn); if (value == HIGH){ digitalWrite(motor, HIGH); Serial.println("Squirt activated."); delay(500); digitalWrite(motor, LOW); delay(5000); } } |
We won’t repeat the explanation here too much (and there’s more to explain with the wiring later on), but there are a few pieces that are important to understand.
1 2 3 |
const int motionPower = 13; const int motionIn = 12; int motor = 3; |
In the previous PIR tutorial, we wired the sensor a bit differently. For convenience, this time we’ll plug it directly into the Arduino itself. Some versions of the sensor have the pins reversed but for the one we’re using, the left-most pin is ground, the middle is power, and the right is signal. So, we’ll plug it directly into pins 12, 13, and GND.
With this code block, we’ll assign the latter two pins to variables. Pin 12 will go to the input from the sensor, and pin 13 will be assigned to power. Be sure to check to make sure this is the correct arrangement for your sensor as well.
1 2 3 4 5 6 7 8 |
void setup(){ pinMode(motionPower, OUTPUT); pinMode(motionIn, INPUT); pinMode(motor, OUTPUT); digitalWrite(motor, LOW); digitalWrite(motionPower, HIGH); Serial.begin(9600); } |
In the setup() section, we’ll assign the variables motionPower and motor to outputs, which will allow the Arduino to send power to these pins. The variable motionIn will be assigned an input so it can send a signal to the Arduino when it detects motion. Finally, we’ll write motionPower to LOW which will turn the motor off to start with and set the motionPower pin to HIGH, then send power to it.
1 2 3 4 5 6 7 8 |
int value= digitalRead(motionIn); if (value == HIGH){ digitalWrite(motor, HIGH); Serial.println("Squirt activated."); delay(500); digitalWrite(motor, LOW); delay(5000); } |
Finally, inside the loop() section, this code will read the status of the motion sensor. If it detects motion, the if statement will start. This block will turn on the motor for 500 milliseconds before turning it off again. You can adjust this if you need it to spray more or less water when it’s triggered. It will also print “Squirt activated.” to the serial monitor to help with troubleshooting.
The final delay() statement will pause the script for 5 seconds before continuing. This will prevent the sensor from getting triggered too many times in a row. You can also adjust this delay to your liking.
The wiring on this project is a little more complex than the previous motion sensor guide. The motor in the Raid bottle requires more energy than the Arduino is capable of outputting on a single pin. To solve this problem, we’re going to add a transistor and a diode. This will make the wiring a bit more complex, so we’ll take it in stages. First:
Next, we’ll add the diode. Diodes only allow electrons to flow in one direction. This will help prevent any excess power running to the motor when it shuts off from flowing back through the circuit.
Once the code is uploaded and this wiring is set up, your automatic water bottle will be nearly set up. Depending on the power requirements of your motor, you may need to connect an external power source to the power input of your Arduino as well. For our version of this project, we used a AA battery pack.