Project: Motion Detector Water Cannon


I'm brand new to this world of [Arduino] microcontrollers, but not new to software development and computer networking. The next sentence will seem quite random - my neighbors dogs have a habit of shitting in my yard. This, however, is true, and is the driver behind this project.

I currently have several devices on order that should temporarily but quickly assist in resolving my quandry. I'll be implementing a PIR motion detection system (INSTEON) that [for a short interval] enables a wall outlet where a 24v power transformer will open a water sprinkler valve (solenoid) to multiple high-pressure pop-up sprinkler heads located in the dogs' rest stop.

The long-term solution, which is mostly just an engineering challenge for me, is to develop a system where I can monitor this area via the Internet, be alerted of "the offenders", and control the valve at will via the Internet.

I've seen the Arduino starter kit, but I'd like to dodge that unless it's highly recommended I don't. I'd like to go straight into my project, initially implementing with the following items:

  • Arduino Uno
  • Arduino WiFi Shield
  • Parallax PIR sensor
  • TTL JPEG camera
  • Breadboard and wires

Future enhancements to this project will be the integration of an object-tracking system using triangulation (multiple PING))) or PIR sensors), servos and/or DC motors, and replacing the water sprinklers with a focused, high-pressure stream of water.

I'd like to hear thought/comments on my proposed solution. Are the preliminary items sufficient or are there some things I'm overlooking? Anyone know of any current object-tracking sketches?


The Arduino just does not have enough memory and processing power to do any kind of video processing, unless you are dealing with extremely low resolution black and white. The Arduino can do the simpler things like fire the gun, and use the PIR motion sensor. For the advanced tracking, etc. you really need more horsepower and lots more memory. Presumably you could use a web cam to feed the internet, and then have something send a signal to the Arduino.

Two projects that I've read about may help you with the more complex part of the system:

I currently have several devices on order that should temporarily but quickly assist

Is one of them a fence? 8)

This tutorial at Sparkfun is interesting, and while not what you want to do, it might give you some ideas.

Put the brains, video processing and web interface on a PC. Use the Arduino just as a way to send commands and controls to your servos and solenoids. Wire a web cam directly from the 'cannon' to the PC for the video processing side. There are various freeware motion detection applications you can use to monitor the web cam and notify you (or do something directly in response) if motion is detected. Or, you could write your own using openCV or similar. Getting your motion detection and object recognition good enough to trust it to tell the difference between a dog and a mailman will be hard, but if you only need it to notify you and let you decide what to do, that seems easy enough to arrange.

If you want to access this system remotely then you will need to provide access to your PC from the public internet, and enabling that obviously introduces some security considerations.

tell the difference between a dog and a mailman

Ah... is it ok if the mailman craps in the garden then? :P


Thank you all very much for your suggestions! I'd never seen the Sentry Project, but this will work perfectly for me. Parts have been ordered - Arduino Uno and wireless proto shield, 2 XBee PROs, a USB Explorer, 2 HiTec servos and a PIR sensor. These items wil work in conjunction with my webcam and solenoid water valve.

Jimbo, I had seriously given thought to fully enclosing my property in 8-foot-tall privacy fence, but where would the fun be in that?! ]:D

Thanks again guys! I'll try to remember to post a follow-up with photos.

Jimbo, I had seriously given thought to fully enclosing my property in 8-foot-tall privacy fence, but where would the fun be in that?!

Wrong kind of fence.

Ah... and I see a bit of fun in this too - let the beasts enter the area, fence disabled, then enable it and engage the water cannon!!

You are welcome, and have fun. But do pay attention to the various laws where you live about automatic firing of devices, particularly if you go to higher power water canons, paint ball, or even deadly force. I would be interested to see what you build.

If in the US be aware that if a child (or even a person) encounters anything that could be considered a form of a "trap", you might be sued for every thing you own. Best check with your insurance agent about your project.

I've some code that might do what you're looking for. It uses an Arduino to control the servos, while a Processing sketch on a laptop uses a webcam to track moving targets. It doesn't have any sort of internet control, but since it can run fully autonomous, you might not need to control it manually at all. Here's a link to the project page (click "Download Code" on the left for the Arduino & Processing code): Good luck!

I have nothing real to offer outside of encouragement... but I wanted to say that I really love the idea. The targeted water cannon might open you up to liability, though, as others have said. Personally I think the regular yard sprinklers should be enough to discourage a shitting dog.

Good luck and keep us updated!