Squirt – Arduino, motion activated water cannon

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.

Arduino water cannon

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:
Schematic Arduino water cannon
#include <ServoTimer1.h>

/*

  • “Squirt”. Jonathan Robson Feb 2009.

*

*/

int transistorPin = 8; // transistor base connected to pin 8
ServoTimer1 servo1; // defines the servo

Major Components in Project
Arduino
Windscreen washer pump
PIR motion detector
servo motor
TIP 120 npn transistor

 

For more detail: Squirt – Arduino, motion activated water cannon


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top