Dick Cappels' project pages http://www.projects.cappels.org
Return to HOME (more projects)
Garden Sprinkler and Drip Timer Project
A simple replacement timer circuit for the Rain Bird E3 Irrigation System Controller
that turns on my drip irrigation system for 34 minutes every day. Other daily watering periods can be selected
by changing a tap on the counter chain.



The timer circuit uses CD4000 series CMOS logic -no firmware at all. The circuit board was cut to
fit where the original circuit board in the Rain Bird Timer had been. The barrier terminal strip was
 salvaged from the original circuit board.

Find updates at www.projects.cappels.org


Introduction and Overview
When the car pulled in to the driveway of my Mesa, Arizona home, after a 15 week absence, I immediately realized that there was something wrong with the plants in the front of the house. The bushes were wilted and my rose bush looked as though it had been in an oven. The front yard is a small expanse of crushed rock, which hosts 16 plants, including bushes, shrubs, clumps of pampa grass, and one lemon tree. The are all watered by a drip irrigation system, which was controlled by a Rain Bird E3 Irrigation System Controller. At least until its sixth year of operation;  After about 2050 daily cycles of blazing desert sun and cool desert nights finally took its toll. It had literally died. Having designed consumer electronics, I realize that a failure after 49,000 hours of continuous operation in a hostile environment is understandable. The timer was broken. The question is: What do to next?

My choice was obvious:

Plan A: Drive over to the garden supply center and buy a new watering timer,  then remove the old one, and install the new one. Quite likely, I would have to find some paint to match the outside of the house where the original controller is mounted. The 120 VAC input to the controller was hard wired into the circuit breaker box on the side of the house - something else I didn't want to mess with right now. If I ended up buying an indoor timer, I would have to drill a hole so as to get the AC power and the wire to the valve solenoid into the garage, or

Plan B: Build a replacement timer board that fits in place of the worn out timer board.

For somebody who is handy with a soldering iron and wire cutters, and not so handy drilling holes in concrete and painting walls, and who was only going to be there for about two weeks and didn't want to go away with the job half done, or done poorly, Plan B sounded like the  more comfortable of the two.

Since I was going to design the timer, I could make it do just as I wanted. The Rain Bird E3 was a beautiful little controller. It could be programmed to operate up to four valves, it had twelve operating modes, and plenty of features like 1 through 6 day watering cycles, odd day watering cycles and even day watering cycles. All that flexibility came with some operational complexity. Whenever I had a problem with the drip system, I would spend the first five minutes walking between the controller, adjusting something, and then walking back out to the garden to try and tell if the water was on or off. As long as I have lived in this house, the timer has always been set to water for half an hour a day. Every day in every season. Sometimes the plants got more water than they needed, and sometimes they were a little thirty. But this is a place that has seasons, and the plants "understand" seasons and the did well. I decided to build a timer that would turn on the valve  to water the plants for half an hour ever day. All that programmable flexibility is wasted on my garden, and indeed, its an encumberance.

I was immediately reminded of another project with similar requirements, my Door Chime Privacy Sentry, which is a 24 hour time that keeps the doorbell off for 10 hours each night. The circuit was very simple, using only one CMOS micro controller for the logic. I could literally build another  Door Chime Privacy Sentry and just modify the daily time that the sprinkler went on, and invert the drive signal to turn the valve  on for the timed duration instead of off. It would be a snap.

But there was a hitch.  I would only be in Mesa for a couple of week, and didn't figure that I would even touch my soldering iron, let alone build anything, so even while knowing in the back of my mind that somehow I would regret it, I decided to travel light and not bring my box of micro controller programming tools. Thus, I had no programmer, no serial port adapter to plug it into, and none of my improvised cables and gadgets that would have made programming and debugging easier.

I didn't want to loose a week of precious time waiting for tools or material to come from a distributor, so the main question turned from "What's the most efficient way to do this?" to "What can I do with the tools and materials I have on hand?" Fortunately, I am a pack rat, and I still have some old CD4000 series CMOS logic, including some four input CMOS gates that I bought in 1973 to use as address decoders in my as-yet unfinished Intel 8008 computer project (That's 8008, not 8080).


The CMOS timer circuit was designed for this project. The Power supply and
valve solenoid power circuits were adapted from the Door Chime Privacy Sentry project.

The Circuit

CMOS 24.055 Hour Timer

The resulting timer circuit is made from a CD4060, includes an oscillator and a 14 stage binary counter, two CD4040's, which are 12 stage binary counters, a CD4012 Dual Nand gate and a CD4013 Dual D Latch.

The CD4060 is connected to a 32768 Hz ECS 3X8 tuning form crystal.  The 10 Meg Ohm resistor between CD4060 pins 10 and 11 are to bias the internal inverter into its analog region, and the 330 K resistor in series with the crystal is to limit the power to the crystal. This setup is directly from the ECS data sheet. The output of the 14th flip flop in the CD4060 appears on pin 3, and it is a 2 Hz square wave. A 2N4401 buffer drives a green LED with this square wave. When I see it blinking through the plastic window of the Irrigation System Controller housing, I know that power is on, and that at least the oscillator and first 14 counter stages are working.

The CD4040's that follow the CD40406 divide the 2 Hz pulses to get the 24 hour cycle and the 34 minute watering period. When the counter counts up to 24.0355 hours, as decoded by the CD4012,  both of the CD4040's are reset and the output of the CD4013 (pin 1) is set high to turn on the valve solenoid. To get a wide enough pulse to assure that all of the flip-flops inside the CD4040's are reset, the reset pulse from CD4012 pin 13 is passed through a low pass filter made of a 10k resistor and a 6 pf capacitor.

A momentary push button, labeled "Resync" is connected to the output of the 10k and 6 pf low pass filter. When the button is pressed, it pulls the reset inputs of the CD4040's and the clock input of the CD4013 high to start a 24 hour timing cycle. The additional l0k resistor in series with the output of the 10k and 6pf low pass filter it to further limit current from the pushbutton to the input of the CD4012, which normally spends all but a few microseconds each day sitting at ground. I use the Resync button to set the time of day that the watering cycle starts.

The CD4013 latch, the output of which (pin 1) goes high to turn on the valve , is reset 34 minutes after the CD4040's are reset, thus turning off the valve .  The pulse to turn off the valve  34 minutes after the watering cycle starts, appears on Q1 of the second CD4040. If I wanted to the watering period to be 68.264 minutes, I would use Q2 (pin 7) of the second CD4040. If I wanted 16 minutes, I would have used Q12 of the first CD4040. Moving the connection to the reset input of the CD4013 (pin 4) one flip-flop to the left in the CD4040 counter chain cuts the watering period in half. Moving the connection to the right one flip-flop doubles the watering period.
 
 Valve Solenoid Power Control

A full-wave bridge rectifier is placed effectively in series with the 24 VAC from the power transformer and the watering  valve. The AC signal passes through the AC terminals of the bridge, while the negative terminal is connected to chassis ground and the positive terminal is connected to the drain of a BUZ-73 MOSFET. While the BUZ-73 is off, current does not pass though the  valve, and the water is off. When the output of the CD4013 (pin 1) goes high, turning on the BUZ-73, current also passes through the AC terminals of the diode bridge and through the valve solenoid.

The gate of the BUZ73 is connected to the output of the CD4013 (pin 1) through two switches, which allow me set valve solenoid OFF, ON, or connected to the daily watering cycle timer. This last position is the normal operating position. The OFF and ON positions are for maintenance and troubleshooting. The output of the two switches also connects to a 2N4401 buffer, a dropping resistor, and a yellow LED. The yellow LED is on whenever the valve solenoid is on. A 100k resistor connects the gate of the BUZ-73 to chassis ground to keep the gate from floating in case one of the switches does not get slid all the way to one position or another, on in case a switch becomes intermittent.  T

There are two series connected 14 VAC metal oxide varistors across the AC terminals of the diode bridge and another pair of series connected 14 VAC metal oxide varistors across the drain and source of the BUZ-73 MOSFET. The purpose of these metal oxide varistors is to protect the diode bridge and the BUZ-73 MOSFET from voltage surges that might appear in either the AC line or the wiring to the valve solenoid. We get a lot of lightning here.

A 1k resistor between the gate of the BUZ-73 MOSFET and the rest of the circuit limits current that might capacitvely couple from a fast rising voltage spike on the drain of the FET to the gate. A zener diode from the gate to ground will limit the gate voltage in the case of such a voltage spike. The .015 mircofarad mylar film capacitor across the drain and source of the BUZ-73 MOSFET is there to reduce the amplitude of induced spikes. 


5.1 Volt Zener Power Supply

One end of the 24VAC power transformer secondary connects to chassis ground through one of the diodes in the full wave diode bridge when that end of the transformer secondary swings through the negative half of the power supply line cycle. At the same time, the other end of the secondary swings positive. The voltage on this second end of the transformer secondary is rectified by a 1N4007, and passed through a 728 Ohm 2 Watt resistor to supply current to the sprinkler timer circuit. A zener diode limits the voltage at this point to 5.1 volts. Three 220 microfarad capacitors mounted around the circuit board provide plenty of filtration so that there is negligible ripple on the 5.1 volt power supply.




The new circuit board mounts in the original box in place
of the original board. All of the original wiring is used.
No new holes were drilled, no new wires were run, and nothing
had to be painted.


Construction and Installation

The circuit board was cut from a ptototyping board that had ground and power busses, and rows of pads for dual in line packages etched on the back (I had this board left over from the 1980's, when we used to use them for small wire-wraping projects). The dimensions were determined by tracing around the outside of the original circuit board from the Rain Bird E3 controller, and later I filed some small notches near the plastic hooks that grip the board in the enclosure, so as to get the fit for the hooks just right. I also traced the open area for the barrier screw strip and the slide switches and push button so that I could be sure of mounting them in the right place.

The barrier screw strip itself was salvaged from the original Rain Bird controller board, and it took quite a bit of fluxed braid to get the barrier strip free from the original board.

All of the components were soldered directly to the pads on the back of the circuit board and wired point-to-point. There are no sockets in this assembly because with the temperature cycling, sockets would be a reliability worry.

The full wave diode bridge assembly is a 4 Amp 600 volt bridge from my junk box. My valve solenoid only draws 188 milliamps, so I am sure I could have gotten by with four 1N4004's or something similar, but I thought it wise to be on the safe side. The bridge assembly does get a little warm during operation - 200 milliamps x 2 volts is almost 1/2 watt, but it should not be a problem given the side of the bridge assembly and that its not in contact with the fiberglass circuit board.

The BUZ-73 MOSFET is my current favorite 7 amp MOSFET. With 5 volts of drive, its drain-to-source voltage is low enough that I do not have to worry about a heat sink for it. It does not get as warm as the diode bridge assembly.

The odd valed 724 Ohm 2 watt resistors was made by placing eight 91 Ohm 1/4 watt resistors in series. I did this because I don't have any 750 Ohm 2 watt resistors.

During assembly, I used a transformer isolated, grounded soldering iron, and I kept a piece of #30 wire wrapped around the leads of the BUZ-73 until the circuit board was complete. I also was careful about keeping me and my tools at ground level during assembly. A grounding wrist strap would have been a good idea, but I don't have one yet, and managed to get by.

The new circuit board snapped into the original box, and since the barrier strip is in the same location within the box as it was when it was on the original Rain Bird E3 circuit board (Assembly No. 633754, by the way,) the wires from 24 VAC transformer, to the valve solenoid, and the earth ground wire were right where they were supposed to be, so no cutting or stripping was required; just a screwdriver to tighten the screws.

Please note that the earth ground wire connects to the sprinkler wiring as shown on the schematic, not to the chassis ground. The chassis ground, to which the source of the BUZ-73 MOSFET and the VSS connections of all of the CMOS chips is connected, floats from earth ground.

I don't want you to think that I just built up the board, stuck it into the old controller box and it worked. The first time I put it in, the valve solenoid would not turn off, so I took the controller back to the workbench and hooked up a 12 VAC transformer to troubleshoot it and discovered that in a feeble moment (its hot in the garage in Mesa Arizona at noon in August!) I had run a jumper from the earth ground to the chassis ground, thereby shorting out one of the diodes in the diode bridge. That was quickly fixed by removing the jumper. After that, I found the water cycle to be only 17 minutes instead of the intended 33 minutes, and that, too, was quickly remedied, this time by moving a single wire.

At this moment,  the watering timer is out there in the sunshine,  on the side of the house, counting 2 Hz ticks, and the plants are waiting to feel the coolness of the drippers on this scorching desert summer afternoon.

Note -four months after installation: I have returned to the house, and the timer is still working as designed. The plants are fine, except for a little frostbite on one bush, and another bush that was crushed by somebody driving over it.


HOME (More Projects)
 
Contents ©2006 Richard Cappels All Rights Reserved. Find updates at www.projects.cappels.org

First posted in August, 2006. Updated December, 2006.

You can send  email to me at projects(at)cappels.org. Replace "(at)" with "@" before mailing.



Use of information presented on this page is for personal, nonprofit educational and noncommercial use only. This material (including object files) is copyrighted by Richard Cappels and may not be republished or used directly for commercial purposes. For commercial license,
click here.


  Liability Disclaimer and intellectual property notice
(Summary: No warranties, use these pages at your own risk. You may use the information provided here for personal and educational purposes but you may not republish or use this information for any commercial purpose without explicit permission.) I neither express nor imply any warranty for the quality, fitness for any particular purpose or  user, or freedom from patents or other restrictions on the rights of use of any software, firmware, hardware, design, service,information, or advice provided, mentioned,or made reference to in these pages. By utilizing or relying on software, firmware, hardware, design, service,information, or advice provided, mentioned, or made reference to in these pages, the user takes responsibility to assume all risk and associated with said activity and hold Richard Cappels harmless in the event of any loss or expense associated with said activity. The contents of this web site, unless otherwise noted, is copyrighted by Richard Cappels. Use of information presented on this site for personal, nonprofit educational and noncommercial use is encouraged, but unless explicitly stated with respect to particular material, the material itself may not be republished or used directly for commercial purposes. For the purposes of this notice, copying binary data resulting from program files, including assembly source code and object (hex) files into semiconductor memories for personal, nonprofit educational or other noncommercial use is not considered republishing. Entities desiring to use any material published in this pages for commercial purposes should contact the respective copyright holder(s).