I found the highest and brightest part of my yard, cleared the vegetation, lightly tilled the earth, and laid bricks and 4x4s to walk on. I erected a fence from bamboo harvested in the yard, to protect it from an American bulldog that shares the yard.
Although the box I chose to house the circuitry in is waterproof, space constraints and my desire to control and monitor from within my house influenced the design heavily. I also wanted this project to be modular, so if I wanted to change the sensors and power other devices, I could easily do so.
The design I ended up with was comprised of three barrel plugs and a single 3-lead audio plug (float sensor, pump pressure switch sensor, temperature sensor, and rain sensor), two solid state relay-controlled electrical outlets (well pump and solenoid valve), and a blue LED next to each outlet as a power indicator.
The 1/2 HP well pump is rated output is 9 gallons per minute (GPM) @ 30 or 55 pounds per square inch (PSI), and has a current rating of 8.5 amps. At 120 volts, that’s 1020 watts of power consumption. If we assume these figures are accurate, we can take Atlanta’s January, 2012 electricity cost of $0.113/kWh (killoWatt-hour) and project how much it would cost to water every day of an 8-month growing season, for 30 seconds.
(30 seconds/day) x (30 days/month) x (8 months/year) x (1 minute/60 seconds) x (1 hour/60 minutes) = 2 hours.
(2 hours run time) x (1020 Watts) = 2040 Watt-hours = 2.04 kWh.
(2.04 kWh) x ($0.113/kWh) = $0.226
The electrical components include an ATMega328, two Crydom D1210 solid state relays, 7-segment display, reed switch float sensor, 24-volt solenoid valve (sprinkler valve), real time clock module, temperature sensor (10k thermistor), two blue LEDs, push-button rotary encoder, and a 5-volt USB power adapter.
The ATMega uses the relays to control the power to the well pump and solenoid valve connected to the house’s water supply. A schedule is set with the rotary encoder and the real time clock is referenced to turn the well pump on at the scheduled time. If the rain barrels begin to run low on water, the float sensor will signal for the solenoid valve to be opened at the house’s spigot to begin filling a barrel with water. This prevents the water level from falling below the pump’s intake pipe and allowing the pump to run dry, seizing or destroying the pump in the process. The temperature sensor signals if the temperature is too low and prevents the pump and valve from operating. The rain sensor prevents watering during or following a rainfall.
While powered, the stock well pump relies on a pressure switch to enable and disable the current to the motor. A situation where there may be a blockage in the outflow line would cause pressure to build up. If the pressure measured in the pump head exceeds ~50 PSI, the switch will interrupt the power to the pump to prevent damage. Because no pressure tank is installed, the line pressure quickly drops after the power loss, restoring power to the pump. This off/on cycling rapidly occurs, about 2 to 3 times per second, and if the line pressure doesn’t return to normal, the pump could eventually burn out. To prevent this, a 5.5v USB power adapter was utilized for a solution. This acts as a signal from the pressure switch that power is being given to the pump. When this 5.5v signal is lost when the pump relay is energized, the whole system is programmed to shut down, as it indicates the pressure switch has been activated.
The enclosure was opened and wires were soldered to the AC input and DC output leads. The enclosure was resealed with marine epoxy. While testing, it was discovered that the capacitor within the USB adapter prevented the voltage from dropping enough within the amount of time the pressure switch stayed off in it’s on/off cycling (250-500 ms). This was resolved by adding resistors to drain the excess energy in the capacitor. I was able to reliably detect a drop in voltage after adding resistors in parallel reached roughly 30 Ohms.
-*-*-*-*-* Operation and Navigation -*-*-*-*-* The current time & temperature will alternate on the display by default. If the colon is blinking when the time is displayed, the schedule is on. If the colon is not blinking and stays solid, the schedule is turned off. While the time & temperature is being displayed. The knob can be pressed to activate the control menu. Turn the knob to change a value, then press to confirm the value. -*-*-*-*-* Menu Options -*-*-*-*-* 1: Exit the control menu and return to displaying the current time. 2: Display schedule(s) in the format: start time, duration on, days between running, next run day (1=Mon…7=Sun). 3: Change schedule A: "# x" #: Which schedule, x: How many schedules to use (up to 3). B: "XXYY" X: Starting hour, Y: Starting minute. Selecting the time will confirm & display the next schedule time. C: "# x" #: Which schedule, x: watering duration in seconds (~5 gallons/minute). D: "#d x" #: Which schedule, x: how many days between running the schedule. E: "#n x" #: Which schedule, x: Which day of the week to start schedule (1=Mon…7=Sun). 4: Override the pump (to run the sprinkler) to either remain OFF or ON 5: Override the valve (to fill the barrels) to either remain OFF or ON 6: Turn the timer schedule OFF or ON 7: Reset the pump and valve overrides so they return to a scheduled operation (if schedule is turned on) 8: Display temperature history over the past 24 hours, 0 is the most current temperature stored -*-*-*-*-* Emergency Modes -*-*-*-*-* If an emergency is detected, the valve and pump will remain off until the button is pressed to resume normal operation. During emergency mode, one of the following will interupt anything currently being displayed: -E-1: The valve was open > 15 continuous seconds. This indicates the water is not activating the float switch in a timely manner. Ensure the hose going into the tank is connected & clear, the valve is operational, the spigot is open, the tanks are free of leaks, the float switch is free to move, and the switch is indeed activated when the water level reaches the sensor. -E-2: The pressure switch began rapidly turning on and off or the pump has run dry. This indicates there is too much pressure building in the pump outlet or no water at the pump inlet. Ensure the outflow hose from the pump is not kinked, the sprinkler screen/heads are clean, and there is an adequate amount of water reaching the pump inlet. -E-3: The float switch has been activated after more than 3 minutes from when the end of a scheduled watering. This indicates there may be a leak or water is being manually removed via the barrel's spigot. If the barrels were allowed to fill, which could take over a minute of the valve turning on and off [to equilibriate the water levels], the float switch should not activate this late. If water is being manually taken out, remember to exit emergency mode in order to resume the schedule.
Water Storage and Delivery System
Water enters one 55-gallon barrel by flex tubing from the gutter while hoses connecting all 5 barrels equilibrates the water throughout. The pump siphons from one barrel and pumps it through a garden hose that runs out to the garden.
The outflow pipe from the pump rises higher than the highest possible water line, to prevent water from siphoning out while the pump is not running. This is only possible when a separate pipe extends from the top of the bend to allow air to be introduced into this bend immediately following the pump being turned off. This vent serves two purposes- it allows air to flow into the top portion of the pipe when the pump shuts off, preventing the gravitational flow of water toward the sprinkler from drawing all water out from the barrels, and it also alters the water pressure that’s allowed to reach the sprinkler by either closing (increase pressure) or opening (decrease pressure) the Ball-valve 1 (see diagram below), diverting the flow back into the barrel so no water is lost. With Ball-valve 2 in-line after the bend, there is now the ability to completely alter the pressure from 0% to ~100% beyond Ball-valve 2.
The float sensor is inserted through a drilled hole in the barrel and tightened for a water-tight seal. The 10K thermistor and 10K resistor were encased in heat-shrink tubing and epoxy for water resistance.
The principle behind how this works is conduction. When there is no water in the cup, air separates the two screws. A wire connected to one screw carrying a 5-volt potential and the other screw is wired to an ADC pin of the ATMega. Since this large air gap is non-conductive, these 5 volts are not detectable by the ATMega. When rainwater fills the cap, it acts as a conductor, allowing electrons to pass from one wire to the other, completing the circuit and signaling to postpone irrigating the garden.
Water Collection Filter
To prevent large debris from entering the barrels, a self-cleaning filter was made from two symmetrical gutter spouts connected together and a metal screen mounted inside at a 45-degree angle from the entry port. Debris that enters is pushed by the water to exit the filter.
Finally, a photo of my current garden using this system, at the beginning of the growing season. I hope this has served as entertainment, inspiration, or a practical how-to for your own garden project.