Irrigating a small garden is a relatively relaxing and sometimes therapeutic activity (well if you are a botany/biology nerd [or really in need of a hobby]) but going away for any length of time can present a problem. The simple solution of course is to purchase a hose-bib/timer package from Home Depot for about $30 and set up a small drip system to efficiently water each plant or row of plants (rather than a wasteful sprinkler system). Going along with conserving water is using a rain barrel collection system to capture rain for later use thus eliminating or more likely reducing treated water consumption.
Adding a rain barrel complicates the system significantly as there isn’t much water pressure at its spigot compared to a standard city spigot which has somewhere around 40 psi. Also, if the barrel is empty, you don’t want your plants to die and thus you need to be able to detect that the barrel is empty and switch to city water.
After a little bit of planning, shopping and construction I came up with a simple system for automatically or manually watering a garden that in an automatic mode could select the appropriate water source and turn on based on an off the shelf timer. The system uses a small 12 Volt Battery, Pump (for getting the rain barrel water pressure closer to the hose-bib, a solenoid valve, bilge pump float switch, etc. (see the documentation for more detail on parts and wiring). Oh yeah, and in keeping with the eco-friendly approach I figured I should probably keep the battery charge with a small solar panel!