Summary of Squirt – Arduino, motion activated water cannon
Squirt is a DIY motion-activated water cannon built with an Arduino. A PIR sensor detects movement, then the system randomizes servo angle and firing delay to spray water using a 12V washer pump driven through a TIP120 transistor. The pump fires in short bursts (half-second) with randomized intervals and positions to create unpredictable squirts. Components are housed in a watertight box with the PIR field constrained by a tube; the reservoir and pump are mounted with tubing to the servo-mounted outlet. The project prioritizes simplicity and playful randomness over precise tracking.
Parts used in the Squirt:
- Arduino
- Windscreen washer pump
- PIR motion detector
- Servo motor
- TIP 120 npn transistor
- 10k resistor
- 1N4004 diode
- 12v rechargeable NiMH battery
- On/off switch
- Watertight box to house the workings
- Watertight reservoir (plastic tub)
- Various length 22 awg jumper leads
- Soft tubing (flexible pipe from aquarium supply)
- Short length of pipe
- Breadboard
- Blu-tac (used to attach pump to servo arm)
Squirt is a motion activated water cannon using Arduino.
This was designed for use in the garden but as it’s winter we tested it in the bathroom. It works!
True motion tracking is expensive and complicated so this system activates when the victim moves into range and randomises the position of the cannon and the firing time within a limited area. The sometimes fickle readings from the PIR sensor just adds to the cannon’s randomness, and therefore the fun.
This is my first Arduino project.
Step 1: Parts
Arduino
Windscreen washer pump
PIR motion detector
servo motor
TIP 120 npn transistor
10k resistor
1N4004 diode
12v rechargeable NiMH battery
on/off switch
watertight box to house the workings
Watertight reservoir
Various length 22 awg jumper leads
Soft tubing
Short length of pipe
Breadboard
Step 2: The circuit
Connect the parts according to the circuit diagram below.
The PIR command wire goes to Digital pin 5 on the arduino and its positive wire goes to 3v pin and ground to ground.
Servo control wire is on pin10.
Pump is on pin 8 via the transistor 9which is protected by the diode).
The battery is a NiMH 12v connected to Vin pin via an on/off switch.
The battery, breadboard and arduino are housed inside a watertight sandwich box.
Mounted on top is the PIR which is inside a length of plastic tube to restrict its field of vision to directly ahead.
The servo is mounted on top of the water reservoir- in this case a plastic tub from the kitchen supplies department of the local supermarket. The pump is fitted near the bottom of the tub with its outlet connected to a flexible pipe from an aquarium supply shop and (rather messily) attached to the sevo arm with a lump of blu-tac.
Step 3: The Code
The arduino code (or “sketch”) runs when turned on. Essentially the PIR looks for motion. If it’s detected it waits a random length of time between half and 3 seconds, moves the servo arm to a random position 30 degrees either side of center, fires the pump for a half second and returns the servo to center. It then waits for another random length of time and repeats. It fires 3 times then checks the PIR again to see if it detects further motion. See sketch below:
#include <ServoTimer1.h>
/*
- “Squirt”. Jonathan Robson Feb 2009.
*
- A PIR activates a servo & pump. Servo moves its arm to a random position between 60 and
- 120 degrees, fires a pump for half second and returns to center (90 degrees). Cycle repeats
- 3 times at random intervals between half and 3 seconds then waits to detect further movement.
- Circuit based on http://itp.nyu.edu/physcomp/Tutorials/HighCurrentLoads
- PIR code adapted from http://www.liquidware.org/view.php?id=63
- Random code adapted from www.arduino.cc/en/Tutorial/Blink & www.arduino.cc/en/Reference/Random
- Servo code adapted from http://www.ladyada.net/make/mshield/use.html
*/
int transistorPin = 8; // transistor base connected to pin 8
ServoTimer1 servo1; // defines the servo
Windscreen washer pump
PIR motion detector
servo motor
TIP 120 npn transistor
For more detail: Squirt – Arduino, motion activated water cannon
- What activates the Squirt water cannon?
The PIR motion detector activates the system when it detects movement. - How is the pump controlled?
The pump is driven from Arduino digital pin 8 through a TIP120 transistor and protected by a diode. - Which Arduino pins are used for sensors and actuators?
The PIR command wire goes to digital pin 5, the servo control wire is on pin 10, and the pump is on pin 8. - How does the system create randomness in firing?
The code waits a random delay (0.5 to 3 seconds) and moves the servo to a random position within 30 degrees of center before firing the pump. - How long does the pump fire each time?
The pump fires for half a second each activation. - How many squirts occur per detection cycle?
The device fires three times per cycle, then checks the PIR again for further motion. - How is the PIR field restricted?
The PIR is mounted inside a length of plastic tube to restrict its field of vision directly ahead. - Where are the electronics housed?
The battery, breadboard, and Arduino are housed inside a watertight sandwich box.