Look at Phil Tucker’s motion-detect sprinkler home defense system, it activates upon any motion and starts a sprinkler in your garden. Phil defends his garden against dogs and cats, which permanently poop into. So he built this nice device which is based on an Arduino microcontroller. It can be completely controlled by a smartphone too.
Testing a motion activate sprinkler. A TRENDnet IP camera triggers a GPIO output read by an Arduino which then triggers a relay/solenoid valve to turn on a sprinkler. IP camera already records video and sends email alerts.