Every year I start seeds for my garden in my basement. Every year it is inevitable there is a time when I am out of town and cannot water my plants or otherwise take care of them. In the past I have hired a neighbor kid to come and water them for me.

This year, I decided to replace the neighbor kid with a computer. Better he learns that lesson now so he can plan for the future when whatever job he wanted will be replaced by robots anyway.

You will need:

  • A Raspberry Pi or Arduino or similar device
  • A four channel relay from Amazon
  • A 12 volt gravity fed solenoid from eBay
  • A 5 gallon bucket
  • A barb connector
  • Some 1/2" ID hose
  • Some hose clamps that will fit around your hose
  • Some drip emitters and some 1/4" drip tubing
  • A camera compatible with the Pi

Putting it all together

Hose from the bucket:

Into the solenoid:

Out to the plants:


The Rationale

The reason I went with a bucket instead of hooking into the plumbing was so that worst case, I end up with 4 gallons of water in my basement. Plus it was cheap and easy. The clear tube is a bad idea in the long run because of algae. I wanted to make sure everything was working. I wanted to see the water flow. Each drip emitter can be shut off individually should I want to add or remove plants.

The Operation

There are three tasks I wanted to accomplish:

  • A still shot every hour
  • A video of the watering so that I could make sure it happened when I was out of town
  • The actual watering

Knowing that software fails all the time for everyone everywhere, I did not want to make the actual watering (which is the most important) dependent on anything else. So I created three scripts and set them all on coordinated cronjobs. That way, none of them could interfere with any of the others.

Every night at 9:00 PM, the watering script would start and wait 3 seconds before the water turned on. At the same time, the camera started recording a video that ran for 30 seconds. The watering lasted for 20 seconds. After the watering and video finished, the video was uploaded to YouTube. Here is the whole thing in action. It has closed captioning in English and Norwegian.

And here is a video of the watering as seen from the Pi.

And lastly, a time-lapse of the tomatoes doing their thing.