A water and energy conserving irrigation controller by William Evan Kirkpatrick A thesis submitted in partial fulfillment of the requirements for the degree of Master of Science in Electrical Engineering Montana State University © Copyright by William Evan Kirkpatrick (1994) Abstract: Electronic and mechanical irrigation controllers eliminate the task of manually regulating the flow of water. Most controllers water according to a fixed time schedule. These controllers waste water and energy by watering unnecessarily or inefficiently. In market research, no stand alone controller was found capable of modifying both the starting time and duration of watering determined by the major factors affecting water and energy conservation. Parameters were identified which have the greatest contribution to conserving water and energy. Precipitation amount and level of ground moisture determine the water quantity required and thus the duration to irrigate. High wind speed, high precipitation rate, and low water pressure all make watering less effective or unnecessary. An expandable controller is desirable due to the specific requirements of a particular irrigation system. An electronic irrigation controller was designed and fabricated to conserve water and energy. The addition of option boards to the basic controller allow for ground moisture, precipitation, wind speed and water pressure measurements. The controller allows for controlling a water pump and up to 24 electric water valves, including a master valve. All programming and control is through a serial communications line, allowing for wired or wireless remote control. The controller uses both a battery backup and nonvolatile memory to be insensitive to power failure. The use of an intelligent irrigation controller conserves water and energy. Commonly available electronic components allow the controller to be constructed at a relatively low cost. An expandable design and programming flexibility allow adding only the options which will be most advantageous for a particular irrigation system.  A Water and Energy Conserving Irrigation Controller by William Evan Kirkpatrick A thesis submitted in partial fulfillment of the requirements for the degree of Master o f Science in Electrical Engineering MONTANA STATE UNIVERSITY Bozeman, Montana July 1994 / / s i ? ii APPROVAL of a thesis submitted by William Evan Kirkpatrick This thesis has been read by each member o f the thesis committee and has been found to be satisfactory regarding content, English usage, format, citations, bibliographic style, and consistency, and is ready for submission to the College o f Graduate Studies. Date Chairperson, (Graduate Committee Approved for the Major Department ,pproved for the College o f Gradual Date Graduate Dean iii STATEMENT OF PERMISSION TO USE In presenting this thesis in partial fulfillment of the requirements for a master’s degree at Montana State University, I agree that the Library shall make it available to borrowers under the rules o f the Library. I f I have indicated my intention to copyright this thesis by including a copyright notice page, copying is allowable only for scholarly purposes, consistent with “fair use” as prescribed in the U.S. Copyright Law. Requests for permission for extended quotation from or reproduction o f this thesis in whole or in parts may be granted only by the copyright holder. Signature Date 2 Si J ix ly , 4 Z iv ACKNOWLEDGMENTS This thesis was completed with the help o f many people. Harley Leach provided many ideas to improve the functionality o f the controller while providing encouragement and expertise. The other members o f the thesis committee, Dr. Murari Kejariwal and Dr. Fred Cady, willingly arranged their summer schedules to critique and approve the thesis. Mike McCartney of Aquatech, Inc. helped in obtaining much of the research materials on currently available irrigation products. Tony Braun generously shared his time and expertise. Thank you. / TABLE OF CONTENTS CHAPTER I - INTRODUCTION............................................................................................ I CHAPTER 2 - THESIS OBJECTIVE..............................................................................................3 Terminology.................................................................................................................................. 3 Controller Parameters.................................................................................................................. 4 Ground Moisture.......................................................................................................................4 Precipitation.............................................................................................................................. 5 Wind Speed...............................................................................................................................6 Water Pump Control.................................................................................................................7 Miscellaneous Features.............................................................................................................8 CHAPTER 3 - CONTROLLER HARDWARE............................................................................. 10 Hardware Design........................................................................................................................ 10 Main Board................................................................................................................................. 11 Power Supply.......................................................................................................................... 11 Real Time Clock / Power Control........................................................................................... 13 Microcontroller / RS-232 Serial Port................ 17 Program Memory / Address Decoding...................................................................................20 Zone Driver Connections........................................................................................................21 Zone Driver Board...................................................................................................................... 23 Data Latch...............................................................................................................................23 Triac and Triac Driver Snubber Network...............................................................................23 Options Connector Board...........................................................................................................27 CHAPTER 4 - CONTROLLER SOFTWARE...............................................................................29 Memory Allocation............................................................................................................... - - 30 EEPROM................................................................................................................................30 SRAM.....................................................................................................................................33 Reset Routine.............................................................................................................................. 34 Main Routine.............................................................................................................................. 34 One Minute Interrupt Service Routine.......................................................................................35 Get Current Time and Date.....................................................................................................36 Measure the Ground Moisture................................................................................................37 Calculate the Average Wind Speed........................................................................................37 Update Average Precipitation.................................................................................................39 Update Pump Disable Timer...................................................................................................39 Check and Update Block-out and Manual Pause Timers.......................................................42 Compare Current Time to Start Times....................................................................................42 Update Zones Based on New Conditions...............................................................................47 One Second Interrupt Service Routine....................................................................................... 50 Determine the Effect of Water Pressure on the Pump............................................................52 Update the Master Valve Status..............................................................................................52 Turning on Valves from Zone Status Bytes............................................................................54 CHAPTER 5 - CONCLUSIONS AND FUTURE WORK............................................................55 Conclusions........................................................................... 55 Future Work................................................................................................................................ 56 Software..................................................................................................................................56 Remote Control.......................................................................................................................56 Cost Reduction........................................................................................................................57 REFERENCES...............................................................................................................................59 APPENDIX - BILL OF MATERIALS..........................................................................................60 vi LIST OF FIGURES Figure I . Controller Hardware block Diagram.....................................................................11 Figure 2. Power Supply Schematic Diagram...............................................................................12 Figure 3. Real Time Clock and Power Control Schematic Diagram................................ 14 Figure 4. Microcontroller and RS-232 Port Schematic Diagram.....................................19 Figure 5. Memory and Address Decoding Schematic Diagram...........................................20 Figure 6. Zone Driver Connections Schematic D iagram....................................................... 22 Figure 7. zone Driver board Schematic Diagram.................................................................... 24 Figure 8. Triac and Triac Driver Snubber Network...............................................................26 Figure 9. Options Connector Board Schematic Diagram......................................................28 Figure 10. One Minute Interrupt Service Routine...................................................................36 Figure 11. The Effect of Average Wind Speed........................................................................... 38 Figure 12. The Effect of Precipitation Rate...............................................................................40 Figure 13. Servicing the Pump Disable Timer.............................................................................41 Figure 14. Comparing Current Time to Start Times.......................................................... .....43 Figure 15. Calculating New Watering Times............................................................................ 45 Figure 16. Removing Zero-Time Entries........................................................................................46 Figure 17. Filling the Watering Table.........................................................................................48 Figure 18. Updating the Zone Status.............................................................................................49 Figure 19. Determining if a Zone Meets Conditions................................................................ 51 vii Figure 20. The Effect of Water Pressure on the Pump, 53 viii ABSTRACT Electronic and mechanical irrigation controllers eliminate the task of manually regulating the flow of water. Most controllers water according to a fixed time schedule. These controllers waste water and energy by watering unnecessarily or inefficiently. In market research, no stand alone controller was found capable of modifying both the starting time and duration of watering determined by the major factors affecting water and energy conservation. Parameters were identified which have the greatest contribution to conserving water and energy. Precipitation amount and level of ground moisture determine the water quantity required and thus the duration to irrigate. High wind speed, high precipitation rate, and low water pressure all make watering less effective or unnecessary. An expandable controller is desirable due to the specific requirements of a particular irrigation system. An electronic irrigation controller was designed and fabricated to conserve water and energy. The addition of option boards to the basic controller allow for ground moisture, precipitation, wind speed and water pressure measurements. The controller allows for controlling a water pump and up to 24 electric water valves, including a master valve. All programming and control is through a serial communications line, allowing for wired or wireless remote control. The controller uses both a battery backup and nonvolatile memory to be insensitive to power failure. The use of an intelligent irrigation controller conserves water and energy. Commonly available electronic components allow the controller to be constructed at a relatively low cost. An expandable design and programming flexibility allow adding only the options which will be most advantageous for a particular irrigation system. ICHAPTER 1 - INTRODUCTION Electronic irrigation controllers are popular in industrial and home irrigation systems. The level of controller sophistication varies from simple mechanical timers to complex and expensive personal computer based controllers. The majority of controllers designed for the home market are electronic timers which turn water valves on and off only at user specified times. Their ability to water according to a preset time schedule has two primaiy advantages: 1. The user need not be present to turn on and off the water. 2. The quantity of water applied by the irrigation system is consistent. Watering at specific times for fixed periods also has disadvantages. The need for outdoor watering is inherently tied to weather conditions. Wind, rain, temperature and sunlight all affect ground moisture. Watering according to a fixed schedule will inevitability irrigate when either inefficient or unnecessary to do so. This wastes not only water, but in most cases, the energy to supply the water. Some improvements are available for irrigation controllers to aid in water conservation. Ground moisture and precipitation sensors are available for most controllers.' ’2 ’3 However, the majority of those sensors completely disable all watering when a discrete level of moisture or precipitation is reached. The most sophisticated irrigation systems use a dedicated PC (Personal Computer) to talk to one or more satellite controllers.1,2 They are capable of monitoring various weather parameters then modifying the watering of the satellites according to those parameters. 2In market research, no stand alone controller was found capable of proportional control of watering dependent on ground moisture, precipitation, wind speed and water pressure. ^ 2,3,4,5,6,7,8,9 ’,0,11 An intelligent irrigation controller was designed to conserve water and energy by monitoring various parameters and proportionally controlling watering based on those parameters. The expandable controller has inputs to measure ground moisture, precipitation, wind speed and water pressure. The user can select the effect those inputs have for each of 24 individual electronic valves. 3CHAPTER 2 - THESIS OBJECTIVE This thesis describes an electronic irrigation controller developed to conserve water and energy while remaining cost competitive for the home market. To meet these goals, commonly available electronic components and existing irrigation products were used where possible. The system was designed as a basic controller onto which options could be added. The terminology used throughout the paper is discussed followed by specific methods to achieve the objective. Terminology The following terms are defined as used throughout the thesis: BLOCK-OUT TIME- A period of time during which the user does not wish to allow any watering to occur. DRIP ZONE - An area watered by low pressure watering devices. Flowers, trees and shrubs are usually watered using drip irrigation. The area watered is relatively small with a low rate of water flow. ELECTRIC VALVE (or VALVE) - The device used to control the flow of water to the watering devices. IRRIGATION CONTROLLER (or CONTROLLER) - The mechanical or electronic timing device used to activate the electric valves. 4SPRINKLER ZONE- An area watered by sprinklers. Sprinkler zones are used to water lawns or large areas of landscaping. Water flow rates are generally high. START TIME- The time specified when a user wishes to begin either a block-out time or begin watering a group of zones. In the case of watering a group of zones, this time may not be followed exactly, depending on water pressure, rain, wind or a previous block-out time. The watering begins the first minute when conditions allow a valve be turned on. ZONE GROUP (or GROUP) - A logical ordering of zones for simplifying the control of complex systems. Watering start times are given for each zone group instead of each individual zone. Controller Parameters The measurable parameters which affect the conservation of water and energy of an irrigation system were determined. Ground Moisture Ground moisture is the most obvious input parameter required to conserve water. The whole objective of irrigation is to change the amount of ground moisture. Soil type, temperature, wind, sunlight and rain all affect the amount of moisture in the ground. Therefore, it is most accurate and economical to measure ground moisture directly, instead of deriving it from the other contributing parameters. 5Two types of ground moisture sensors are available: 1. Level switching. 2. Proportional control. The level switching type of sensor acts independently of the irrigation controller. When a specific level of ground moisture is reached, the controller will be disabled. It is the most common type of ground moisture sensor used because it can be added to an existing controller and is inexpensive. The primaiy disadvantage of the level switching sensor is the whole system is disabled independent of the intended watering schedule or desired amount of watering. Proportional control sensors modify the amount of watering dependent on the measure of ground moisture. If low ground moisture is measured, the watering amount will be larger than when the ground moisture is high. The desired amount of water can be more precisely controlled with a proportional sensor. This type of sensor must be integrated with a controller capable of measuring an analog signal then calculating new watering times. The proportional ground moisture sensor was selected for this project. A sensor output of 0 to 5 V (Volts) was assumed. The signal requires an ADC (Analog to Digital Converter) on the circuit. To use a single sensor for the entire system, the user needs to have the ability to define how sensitive each zone is to the ground moisture measurement. This compensates for differences in evapotranspiration rates from one zone to another. Precipitation Measurement of precipitation is used instead of a ground moisture sensor in some systems.1,2 They disable the entire irrigation system when a certain amount of rainfall is 6accumulated. The disadvantages are the same as for level switching ground moisture sensors with the additional disadvantages that other parameters which affect ground moisture are not accounted for. A more effective use of precipitation measurement is during watering. If the precipitation rate exceeds a specified value, watering should be stopped. While raining, the amount of precipitation should be measured. When the rain stops, the watering not yet completed should be reduced by the accumulated precipitation. A simple precipitation measurement device uses a “teeter-totter”. As the device is always tilted to one side or the other, one side fills with water while the other drains. When enough water collects in the high side, the weight of the water causes the device to flop over, filling the side that was previously draining. For the controller, this type of device requires only a single digital input and a timer to determine the length of time between transitions. The quantity of water for each transition must be defined in the microcontroller. In order for the controller to calculate the amount remaining to water for each zone, the user must define the precipitation rates for each zone in the system. Some zones may not receive rain, such as in a porch or greenhouse. The user then needs to selectively disable the compensation for precipitation for those Zones. Wind Speed Wind is a factor in the effectiveness of sprinklers. As wind speed increases, the rate of evaporation of water increases. The water being sprinkled can be blown away from where water is required to where no water was intended or needed. Many sprinkler specifications are given 7for a particular wind speed. Nelson sprinkler specifications assume zero wind.4 Toro recommends reducing square sprinkler spacing from 55% of sprinkler diameter with zero wind to 45% with 8 m.p.h. of wind.1 No stand alone controllers were found with the capability of measuring and compensating for wind speed. Only irrigation systems with a dedicated PC as a central computer controlling one or more satellite controllers could measure wind.1,2 The most common device used to measure wind speed is a 3-vane anemometer. The anemometer spins more rapidly as wind increases. The output can either be a small generating device or a digital pulse for each revolution. An anemometer with a digital output was chosen. It requires one digital input and a timer to measure the time for each revolution. Under high wind conditions, all sprinklers which are affected by wind should be paused. It is desirable to average the wind speed over a period of time to ignore wind gusts. When the wind falls below the specified limit for a period of time those sprinklers that were disabled may resume watering. If high wind conditions persist for a long period of time, an override should be provided. Water Pump Control Irrigation systems are designed to operate at some nominal water pressure. If the pressure is low, the sprinkler coverage may be incomplete. The most effective watering is when the water pressure is within design parameters. When a valve is first opened, there may be a sudden loss of pressure due to the water line having drained since the last use. If the water 8pressure is already low, the pump may have to operate for some time before adequate pressure is reached. Water pump control is usually provided as a separate unit to control a pump dedicated to the irrigation system. The pump is normally turned on and off corresponding to valves being turned on and off. None of the irrigation controllers found in the research measured water pressure. A system which controlled the pump based on a measured water pressure would conserve water and energy. The pressure should be above a minimum operating pressure before turning on a valve. While watering, if the pressure falls below a safe value, the valves should be turned off for the pressure to recover. If the pressure still does not rise, either the water well is low or the pump is failing. The pump should be turned off under this unsafe condition. After a recovery period, the pump could be turned on again once to check for adequate pressure. If normal pressure still cannot be achieved, the pump should be permanently disabled until the user corrects the problem. This method of pump control requires one ADC input for water pressure and one digital output for turning on and off the pump. Miscellaneous Features The water and energy conserving features of the irrigation controller only supplement those features which must be present for a marketable product. Some of the basic attributes are: o Clock with battery backup, o Simple programmability. 9o Insensitivity to power fluctuations. A desirable feature would be the remote control of the irrigation controller. This would allow the controller itself to be wired in a less accessible location than the display and keypad. 10 CHAPTER 3 - CONTROLLER HARDWARE The basic hardware was designed to operate as an eight zone irrigation controller with connectors for option boards. The overall hardware design is discussed followed by a detailed discussion of each circuit board. Hardware Design Figure I on page 11 shows the hardware block diagram for the controller. The basic controller consists of the main board, the options connector board, one 8-zone driver board, and a 24 Volt transformer. Connectors on the options connector board and the main board allow the following options to be added to the controller: o Up to two additional 8-zone driver boards, o Ground moisture measurement, o Precipitation measurement, o Wind speed measurement, o Radio frequency remote control. o Weather station sensors (indoor and outdoor humidity and temperature, barometric pressure and wind direction.) 11 Figure I. Controller Hardware Block Diagram. Main Board As shown in Figure I, the main board has been divided into logical blocks. Each block and its associated schematic diagram is discussed separately. Power Supply Figure 2 on page 12 shows the schematic diagram for the power supply circuit. Power is supplied from a 24 VAC (Volts Alternating Current) center-tapped transformer. The electric 12 current requirement of the transformer is dependent on the number and type of electric valves to be turned on at once and the various options connected to the controller. For a typical home irrigation system, one drip irrigation valve and one sprinkler valve may both be on, in addition to a master valve. Most commonly available valves draw 0.50 A (Amperes) or less of inrush current.12 4 The controller itself draws 0.15 W of current under normal operation. Allowing for a margin of safety, the transformer’s current rating should be at least 2 A. 28 VAC was assumed as the maximum supply voltage to allow for high line voltages and poor tolerance transformers. The peak voltage, Vpk, is given by: Vpk = VmsJ l =28V xl.414=39.6r Due to the center tap, half of the peak voltage (19.8 V) will appear at the inputs of the full-wave bridge rectifier formed by D04 through D07. Two transient voltage suppressors (TVS I and TVS2) protect the controller from voltage spikes exceeding 20 F.12 TO ZONE CONNECTIONS SCHEMATIC24UAC CT TRANSFORMER TO CLOCK SCHEMATIC 60Hz UlO LM7812D051NH00H D04 1N400H TUSl F l IA DOS : 1N400H C12 IOOnF CIO 330nE E2 IA Xcus T IOOnF _L C13 X T 330nF T ClH 2200uF DOS 1NH00H Ull LM7912 U12 LM7805 W ~ C19 IOOnE C20 IOOnF CIS IOOnF _L C21 |28 _L C22 120 'T ' IOOnF I u o s I 1 1 4 - T IOOnF I U09 I I10 Figure 2. Power Supply Schematic Diagram. 13 UlO and Ul I, along with their associated capacitors, provide plus and minus 12 VDC (Volts Direct Current) to the circuit. In the case of a power failure, rectifier DOS allows capacitor C16 to provide current to the microcontroller until the capacitor charge is depleted. The voltage available for the 5 V voltage regulator is 12 F minus the voltage drop across the rectifier, minus the dropout voltage across the regulator itself, minus the output voltage of 5 V. The maximum instantaneous forward voltage drop across a 1N4004 is 1.1 K13 The dropout voltage for the LM7805 voltage regulator is 2.0 U.14 Assuming the measured controller current draw of 0.15 A is constant, the time available for the microcontroller to prepare for the power failure is given by: I => dt = 2200x10"6 F U V -U V -2 .0V -5 .0V 015 A 57.2msec 57.2 milliseconds allows for the completion of any write to EEPROM currently in progress (maximum of 10 msec.) and execution of approximately 17,400 instructions before power is lost. Real Time Clock /Power Control Figure 3 shows the schematic diagram for the real time clock and power control circuit. The real time clock is a Motorola MC68HC68T1P.15 Operations performed by the clock are: o Keeping time and date, o Power supply monitoring and control, o Microcontroller reset control. - o Microcontroller interrupt at time intervals and power failure, o Data transfer to and from the microcontroller. 14 The clock is connected to keep time from a 32.768 kHz crystal. The adjustable capacitor C06 is used to calibrate the frequency of crystal oscillation. The clock is configured to output the crystal frequency at TPl (Test Point I.) Internally, a one second clock pulse is derived from the crystal. The one second pulse is used to keep time and date in seconds, minutes, hours, day of week, day of month, month and year. MC68HC68T1P CLKou t USYS PSE LINE XTLin GND XTLou t UDD POR MOSI MISO SCK SS UBAT CPUR INT UOl C05 RO 7 IOM J_ YOl a 3 2 7 6 8 T kHz R08 200k 2 2 p F 6 5-H0pF_ -"MOSI - e MISO ■^SCK -RESET -IRQ -USTBY UJ si Z= Figure 3. Real Time Clock and Power Control Schematic Diagram. The resistor divider formed by ROl and R02 limit the 60 Hz signal from the transformer to be under 10 (Volts peak-to-peak) at the input of the clock. The signal is AC coupled to the clock through COl and biased at the supply voltage, V Dd by R04. The voltage is monitored for transitions above and below a fixed threshold. If the voltage fails to exceed the threshold in 15 greater than 4.64 msec, the microcontroller is interrupted. As described in the power supply circuit, the microcontroller will then have approximately 57.2 msec to prepare for the power failure. The battery shown as BTOl is actually three AA-size Nickel-Cadmium batteries connected in series. R06 trickle charges the batteries when power is present. Assuming a 0.7V drop across diode D07, the charge rate is: E R 5 F -0 .7 F -3 .6 F 100Q ImA The PSE (Power Supply Enable) output from the clock will switch off the 5 V supply to all circuits not essential for microcontroller operation when power is lost. This reduces the current draw from the 5 V supply thereby increasing the length of time the microcontroller has to prepare for the power failure. The switching is accomplished by resistors R13-R15 and transistors QOl and Q02. The minimum DC current gain for the transistors is 60 hFE (@ Ic = 50mA) and 20 hFE (@ Ic = -500mA), respectively.16 Assuming a maximum current draw of 500mA for the switched supply, the required current at the base of Q02 is: 4 500mA 20 = 25mA Rl 5 acts to ensure that Q02 stays off when QOl is off. Maximum VBE(sat) (Base-Emitter saturation Voltage) for Q02 is -1.3 F so the required current through QOl is: 13V Ic = 25mA + = 28.9mA The maximum VcE(sat) (Collector-Emitter saturation Voltage) for QOl is 0.2F so the value of R l4 is determined by: 16 R E_ I 5 .0V -1 3V -0 .2V 28.9mA 1210 Then the required current at the base of QOl is: h 28.9 mA 60 0.48mA Maximum V BE(sat) for QOl is 0.95 V and the clock is capable of sourcing 1.6mA at 3.7K Then the maximum value for R13 is determined by: R E_ I 3 .7F-0 .95F 0.48mA 5.73AO Selecting a smaller value for Rl 3 ensures more current will be drawn through both QOl and Q02 to keep them in saturation. R13 was selected to be 4.99kO. The clock also controls microcontroller reset. When a power failure is sensed, the microcontroller responds to the clock by placing it in power-down mode. The clock will then hold the reset line low until power is restored and Vsys rises above the battery voltage. SWOl can be used to manually reset the microcontroller by allowing the Vsys input to fall by discharging capacitor C02 through resistor R03. Besides interrupting the microcontroller on power failure, the clock will interrupt once every minute. The microcontroller can read a status port to determine the cause of the interrupt. If the interrupt was caused by one minute elapsing, the microcontroller will perform all time related operations such as checking to start or stop zone valves and update timers. Configuration for the one minute periodic interrupt is performed during the microcontroller reset routine. 17 Communication with the microcontroller is through the synchronous serial peripheral interface formed by MOSI (Master Out Slave In), MISO (Master In Slave Out), SCK (Synchronous Clock) and SS (Slave Select). Either a read or write is initiated when SS is brought high by the microcontroller (the master). The first character received by the clock (the slave) is the start address of either the read or write register. Each sequential byte transferred after that is a data byte. Because the clock increments the address after each data byte, a block of data can be sent or received. Communication is ended when SS is forced low by the microcontroller. Microcontroller / RS-232 Serial Port A Motorola 68HC11A1 microcontroller was chosen as the basis of the project.17 The main features of the 68HC11 as used in the irrigation controller are: o 256 bytes SRAM - Memory for storage of all temporary operating parameters with battery backup. o 512 bytes EEPROM - Permanent memory for all zone and group definitions, start times, and user defined operating parameters, o 8-channel, 8-bit ADC - Inputs for ground moisture, water pressure and other weather parameters. o 2 timer input captures - Timers for precipitation rate and wind speed, o Synchronous Peripheral Interface - Communications interface to real time clock. o Asynchronous Serial Port - Communications interface for remote control. 18 o Watchdog timer - Recovery from operational errors caused by power fluctuations or communication failures. Figure 4 on page 19 shows the schematic diagram for the 68HC11 microcontroller and the RS-232 port. The internal registers are backed up through VSTBY which is connected to the battery. The maximum crystal frequency for the microcontroller is 8 MHz. 7.3728 MHz was selected as the actual crystal frequency because an exact 300 baud asynchronous clock rate can then be derived from the system clock. The SPI (synchronous Serial Peripheral Interface) connects the real time clock. The microcontroller is the master while the clock is the slave. Because the SS (Slave Select) is used on the microcontroller only when it is configured as a slave, the pin was used as a general purpose output pin when selecting the clock as a slave. The SCI (asynchronous Serial Communications Interface) is used for all remote control and programming of the microcontroller. Conversion from a 0-5V digital signal to RS-232 levels (+-12V) was accomplished with a Texas Instruments SN75C1406 triple low-power driver/receiver.18 The serial output drives both the RS-232 port and the RF communications transmit data. Because an idle RS-232 line is normally a low voltage, diodes D02 and D03 form a wired-OR gate so data from either the RS-232 port or the RF link can be received by the microcontroller. The RF receive line is converted to an RS-232 level before the wired-OR gate. RTS (Request To Send) and CTS (Clear To Send) signals are connected to provide handshaking for data transfer across the RS-232 port. Squelch In and Transmitter On allow the RF link to be monitored and controlled. 19 ;>14SPD / RAIM g < XMTON^ AN7 AN6 AN5 AtSH AIH3 ANg ANl ANO < URH 4 USTBY > - NOSl > - NISO-*- SCK-*- S S -* - R09 —W - IOk U ; W h 2 17 o R E ^ > W i H 19 RNOl IOk 3 WIND SPEED . . 6 18vV W — NC W 8 3H Ig RAIN GUAGE W 5 2 7 SQUELCH IN W h 7 3 2 PUNP START 10 TRAMSNlTTER ON 19 OUTDOOR HUNIDITY .5V RN02 i 100k W i 3 15 INDOOR HUNIDITY W h 5 HS 11 BARONETRIC PRESSURE W h 7 HG 7 GROUND NOISTURE W 9 HH 17 OUTDOOR TENPERATURE W H H9 13 INDOOR TENPERATURE W i 6 H7 9 WIND DIRECTION W 8 H5 5 WATER PRESSURE W l O H3 + 120 TP3 t RU 2k0 R lg —1—C07 IOK T IOOnF POP NC68HCI IA I NODA/L1R XTAL NODB/VSTBY PD3/NOSI PD 2 /N IS 0 PDH/SCK PD 5 /S S EXTAL RESET IRQ XIRQ PA0 / IC 3 PA7 /PA I PA2 / IC 1 PA3 /OC5 PAHyQCH PE7 /AN7 PE6 /AN6 PE5 /AN5 PEH/ANH PE3 /AN3 PEgyANg PE 1/AN I PEO/ANO URH URL PDO/RxD PD l /T xD PA1 / IC 2 PA 5 /0C 3 PC7 /AD7 PC6 /AD6 PC5 /AD5 PCH/ADH PC3 /AD3 PCg /ADg p c i / a d i PCO/ADO PB7 /A 15 PB6/A1H PB5 /A 13 PBH /A lg PB3/A11 PBg /A lO PB1 /A9 PB0 /A8 STRA/AS STRB /R /U E PAfe/OCg 8 J_ YOg t = J 7 3 7 g 8 7 T ™ * C08 -------If- R 16 2 2 p F ION C09 ------- ie- g g p F 15 DG IH D5 / 13 DH 12 D3 11 D2 10 Dl / 9 DO 35 A15 36 AlH 37 A13 38 A12 39 A l l HO AlO Hl A9 Hg AS J DATA BUS ADDR "BUS V) Il 25 UOH -AS_ TO NENORY -R/W ISCHENATIC -E TO ZONE -OE CONNECTIONS SCHENATIC Figure 4. Microcontroller and RS-232 Port Schematic Diagram. 20 Program Memory /Address Decoding Figure 5 shows the schematic diagram for the program memory and address decoding circuit. Port C of the microcontroller outputs both the data bus and the low byte of addressing. U05 is an octal latch which loads the low address byte when AS (Address Select) goes high and holds the address when AS is low.19 The full 16-bit address is then formed on the address bus. atu O DATA BUS AS >- ADDR BUS" D7 3 D6 18 D5 4 DH 17 D3 7 D2 IH Dl 8 DO 13 7HHC373 ID 8D 2D 7D 3D 6D HD 5D LE Fl -0IOC IQ 8Q 20 70 30 6 0 HO 5 0 U05 I 2 7 A12 2 A l l 2 3 ' AlO 21 ' AS RH ' AS 25 A15 7HHC00 AlH A13 Cs 7HHC139 . U06 R/U -^ E >— uo6 u 7HHC00 O V U06 2 7C 6H -1 2 U07 U pp PGM AIR A l l AlO AOS A08 A07 D7 A06 D6 A05 D5 AOH DH A03 D3 A02 DR AOl Dl AOO DO NC CS OE U08 -ZNUR -OPRD D7_y D6 / D5_/ DHv D3_v DRv Dl / DO TO ZONE CONNECTIONS SCHEMATIC Figure 5. Memory and Address Decoding Schematic Diagram. 21 Address decoding is comprised of U06 and half of U07. Three sections of the NAND gates make discrete active low Read and Write signals. A normal reset for the microcontroller fetches its reset address vector from FFFEh. The EPROM size is 8 kilobytes20 so its valid address range must extend from EOOOh to FFFFh. The 74HC139 is a dual l-of-4 decoder/demultiplexer with active low outputs. The EPROM will be selected when A13 is low, both A14 and Al 5 are high and the microcontroller is not writing. This fulfills the specified addressing requirements for EPROM. The other outputs of the 74HC139 are used for decoding the option read line and the zone write line. Both lines are active for addresses COOOh through DFFFh, but only one byte is available for reading which options are connected and three bytes for latching zone output data. Zone Driver Connections Figure 6 on page 22 shows the schematic diagram for connecting the zone driver boards. Each of the three boards has two connectors. One connector provides data from the data bus for latching the individual zone drivers on or off and an input for determining which cards are connected. Another connector provides power and control lines. The connectors are identical for each zone driver card with the exception of the operation read lines (OPT4-OPT7 & OPOK) and the zone clock lines (CK). The zone clock lines are derived from the zone write line on the address decoding schematic and the second half of the l-of-4 decoder/demultiplexer. The individual decoder outputs will each go low when data is written to address COOOh, COOlh or C002h, corresponding 22 to each zone driver card. The data on the data bus will then be latched, with each of the 8 bits dedicated to a zone valve. 7HHC5HI TO MEMORY SCHEMATIC OPRD >■ ZNWR > 18 DZ IZ D6 3 Z W 16 D5 4 AAr 15 D4 14 D3 6 |W 13 D2 12 Dl 8 TWj 11 DO <0P0K < D3 D2 ZD2 Z < Dl 8Dl 8Dl 8 9» Dl DO 9DO 9DO 9 GND y,GND / q DAT A ^ u BUS I l ® o 5 ADDR g BUS Z4HC139 Al 13 AO 14 GND > TO POWER SCHEMATIC Figure 6. Zone Driver Connections Schematic Diagram. The operation read lines are used for the microcontroller to determine which option cards are present. When each card is present, it will short the corresponding operation input line to 23 ground which is otherwise pulled high through resistor network RN03. The 74HC541 octal buffer19 will connect the operation input lines to the data bus when the microcontroller reads from address COOOh. Zone Driver Board Figure 7 on page 24 shows the schematic diagram for the zone driver boards. The basic controller will use only one of these boards for controlling eight zones. The zone driver boards used to expand the system to 16 or 24 zones are identical. The circuit is discussed in two sections, the data latch and the snubber circuit. Data Latch The data is latched from the data bus into the 74HC374 octal D-type flip-flop. The 74HC374 outputs are connected to the MOC3011 triac drivers so that a I written to the flip-flop results in the driver being turned off and vice versa. The tri-state control line enables all zones to be disabled using a single line of the microcontroller. Triac and Triac Driver Snubber Network The triac and triac drivers are susceptible to turning on due to a rapid voltage rate of change across their output terminals. A snubber network limits the rate of change to an acceptable level. 24 7 4HC 37 4 . ■ g 3 3 18 I 4 4 5 17 6 IH | 7 7 8 8 9 13 K QPOK 4 >GMD > POl B !>5U !>GND >24UAC g^HUAC, POg DO D7 Dl D6 D5 Dg D3 DH QO >CK OC___QH U09 , JgO-,I U09 I 5 0 ‘ RMOl —W .CIO IOOnF - A V —W -A V —1W 330 MOC3011 \ rli UOl MOC3011 UOg MOC3 0 I I x 1+1 U03 MOC3011 UOH M0C3011 JXsz^ U05 MOC3011 ¥X=p_ U06 MOC3011 Jxs^ U07 MOC3011 Jxsz^ DOS ROl -A V ROg -w - R03 —W ROH -A V R05 -A V R06 -A V R07 -A V R08 -w - R l l —W COl Hf- 3 = % 7 1 R lg O 5 6 u F -AA-------------- COg Hf- 3=gRlo7. R13 O 5 6 u F -AA-------------- C03 -Kr R 14 O 5 6 u F —W--------- COH H(- ^ F % 7 1 R 15 O 5 6 u F -AA-------------- C05 Hf- R16 O 5 6 u F -AA-------------- C06 Hf- R17 O 5 6 u F -AA-------------- C07 Hf \ 7/\ G07 gM6071 R 18 O 5 6 u F -AA-------------- C08 If 0 5 6 u F Z^0ME8> ->Z0MF7> B zOME6> 5>j>Z0NE5> B zomeh> ->Z 0N E 3> -N>ZOMEg> 4>Z0ME1> P03 Figure 7. Zone Driver Board Schematic Diagram. 25 A triac normally turns on when sufficient current is supplied through its gate. If the gate current is reduced below its trigger level, the triac will still remain on until the current through the main terminals goes to zero. A triac will also turn on when a rapid change in voltage (dv/df) appears across the main terminals, even when no current is being supplied to the gate. While the triac is on, its impedance is very low, so no voltage appears across the main terminals. When the triac turns off, its impedance becomes much greater than the load impedance so the supply voltage is present across the main terminals. For inductive loads such as a sprinkler valve, the voltage leads the current by some phase angle, was determined by the ratio: _±_ 360° 2.44x10 3sec 1/60 sec =360ox2.44xl0~3x60=52.7° All commonly available sprinkler valves such as the Rain Bird are designed to operate on 24VAC. To accommodate high line voltages and poor tolerance transformers, 28 VAC RMS was used for determining snubber circuit values. The peak voltage, Vpk, is given by: ^ = 7r,,V2=287xl.414=39.6F 26 MOC3011 T r i a c D r i v e r R l R2 AA/----- ------W I n d u c t i v e L o a d ie 2N6071 T r i a c 28VAC 60 Hz Figure 8. Triac and Triac Driver Snubber Network. Figure 8 shows the snubber network. Ri limits the capacitor discharge current through the triac driver. For the MOC3011, the maximum surge current is I A. R, > VPk 39.6V IOA =39.60 R1 was selected to be 47 O. The resistance between the gate of the triac and the output of the triac driver determines the voltage at which the triac turns on. This voltage was selected to be 8 Volts which is approximately 1/5 the peak voltage. At -40 °C the 2N6071 triac triggers at 60mA so the value of Ri + R2 is determined by: V 8V R. +R7 < — = ^ in 3 -; =133Q=>R2 <133Q-470 =860 I rr 60x10 A R2 was selected to be 75 Q. When the triac current is zero, the voltage still appearing across the triac due to the sprinkler valve inductance is: Fto = Vpk sinM =39.6Fxsin(52.7°) =31.5F 27 The voltage rate of change across the triac and triac driver must be limited to the worst case rate at which either device will trigger on. For the MOC3011 triac driver operating at 100 °C, the worst case static dv/dt is 0.8 V/gs. For the 2N6071 triac, the typical rate is 5 V/ps at 85 °C. The time constant r, formed by the series combination of R2 and C, limits the rate of change of voltage across the triac and triac driver. Using the worst case dv/dt of 0.8 V/ps, r is determined by: = > T > Vto _ 31.5F dv/dt 8x105FZj1 =39.4 j j s C is then given by: 39.4x10-* j 75Q 0.52 JiF C was selected to be 0.56 pF. Options Connector Board Figure 9 shows the schematic diagram for options connector board. The board serves simply to split the signals from the microcontroller into individual connectors used to connect the options. Each option board that plugs in has a signal connector and a power connector. The power connector also serves as an operation input line to determine which option boards are plugged in. 28 S U - 1 2V 3< - 1 2V 3*-1 2V 3- 1 2 V 3 - 12V ;>-1 2V + 12V 2 + 12V > +> GNDGMDGND > P 107 POWER BUS > STRT, URL 10-7* TxD;> TxD GND / w4) GND 45 days). 38 Update one minute \ wind speed data, j Determine average wind speed over wind averaging time period. average speed greater than the,-"' xX limit ? Set wind pause flag. Load wind delay timer for full delay time.Is wind pause flag set ? ^ l s wind \ pause being overridden Decrement wind delay timer. Decrement the wind pause override timer.Does wind delay timer = 0 ? . / Does \ x" wind pause Xpverride timer =Clear the wind pause and wind pause override flags. Load the wind pause override timer for full I time before override. Set the wind pause override flag. Continue Figure 11. The Effect of Average Wind Speed. Update Average Precipitation Both precipitation rate and wind speed signals are digital pulse rates proportional to the measured parameter. This parallel behavior allows the rain signal to be treated nearly identically to wind. Figure 12 on page 40 shows the flowchart for rain. There are two obvious differences to the procedures. No override is provided for continued rain. And, after the rain ceases, the measured precipitation is converted to a time to reduce watering durations in the watering table. The conversion is possible because the sprinklers were originally defined as a precipitation rate and the drip zones use a conversion factor found defined in the EEPROM. The calculated time is subtracted from the corresponding entry in the watering table. Any negative result from the subtract is treated as zero. So the zone will cease watering. Update Pump Disable Timer Servicing the pump disable timer is used only when the pump has been stopped due to a severe loss of water pressure. If the pump was stopped and has not been disabled for the full user specified time, the disable timer is decremented. If the timer decrements to zero, the pressure build timer is loaded. The pump will then be turned back on in the one second interrupt service routine. Ifwater pressure still does not increase, both timers will become zero and the pump will be disabled until the pressure is forced higher by a manual override switch on the pump. Figure 13 on page 41 shows the process for updating the pump disable timer. 40 Update one minute X rainfall rate data. M Determine average I rainfall rate over ram averaging time period. || average rate greater than Ih erf X . limit? Set rain pause flag. Load rain delay timer for full delay time. Is rain pause flag set ? Decrement rain delay timer. Does rain delay timer = 0 ? Clear the rain pause I flag. (The rain has [* stopped.) / / Is a watering sequence X s^ pending ? Reduce the watering I table times by the accumulated rainfall. Clear the accumulated I rainfall. Continue Figure 12. The Effect of Precipitation Rate. 41 The end of the waiting period for the well water to recover is ended. The pump will turn back on to check if the pressure will build back up. One Minute Service X Routine of Pump Jl Is pressure build timer zero ? Is pump disable timer zero ? , Decrement the disable timer. Is pump disable timer zero ? . No—► Load pressure build timer for full number of seconds. End of one minute X pump service III If the pressure is dangerously low, the pump is on until the pressure build timer becomes zero For normal pump pressure, the timer will be zero. The pump is permanently disabled if both timers are zero. Figure 13. Servicing the Pump Disable Timer. Check and Update Block-out and Manual Pause Timers Two 16-bit timers are kept in SRAM to disable watering. If either the block-out or manual pause timers are non-zero, watering is disabled. Each timer is decremented every minute if it has not yet reached zero. Block-out T im er The block-out timer will automatically be loaded at the time and day the user specifies. In a conventional controller, this would have no meaning because the watering times are all discretely defined. The intelligent controller will pause its watering until all conditions are met. This may allow watering to occur when the user cannot allow it. For example, during drought conditions watering may only be allowed on certain days of the week or the user might mow the lawn on the same day every week. M anual P ause T im er The manual pause timer is useful to postpone watering for reasons other than a regularly scheduled event. For example, if rain is forecast within two days, the controller could be paused for 48 hours to conserve water. Compare Current Time to Start Times Figure 14 on page 43 shows the flowchart for comparing the current time to the user defined start times. Four possible start times are available for each day of the week. The times are defined either to start watering a group of zones or to disable watering for a length of time. The current time that was retrieved at the beginning of the program is used to compare against the starting times. If the two times are equal, then the group number defines whether to start watering a group of zones or start a block-out time (group number of zero). 43 Compare current time to start table times Point to first entry for the day in start times table. Is next group number valid (0-4) ?1 / Does current time = table start time Set block-out flag and load block-out timer with hours & minutes from start table. Group number Oor (1-4)? Calculate new watering table for the group number. XxHave all 'entries for the da: < been checked Continue Figure 14. Comparing Current Time to Start Times. 44 N ew Block-out T im e Ifthe group number is zero, a new block-out time is loaded. The length of time is saved in the start-time definition as hours and minutes. The block-out timer requires only minutes so the number of hours is multiplied by 60 then summed with the defined number of minutes. If the block-out timer had not yet completed a scheduled pause, the remaining time will be overwritten with the new value. C alculate N ew W atering Tab le To start watering a new group of zones, three steps are taken: 1. The duration of watering is determined for each zone in the group. The duration (Time) is calculated from ground moisture (GndMsi), sensitivity to ground moisture (GMsens), the precipitation rate for the sprinkler or drip zone (Rate) and the desired amount of water (Amnf). Each zone number for the group is first copied into the scratch-pad table then its duration is calculated as follows: (GndMst • GMsens) 1282 The maximum values for GndMst and GMsens are each 128. If either the sensitivity or actual ground moisture value is zero, the calculated time will be greatest. The flowchart for this process is shown in Figure 15 on page 45. 2. Once the durations have been placed into the scratch-pad table, the watering table is modified. Starting at the top of the table, each entry is checked for the completion of watering the current zone. If the remaining time for the zone is unequal to zero, the entry is moved to the next available location at the top of the table. This process is repeated until all zones with non-zero time have been moved to the top of the table. Figure 16 on page 46 illustrates this process. Time ■ Amnt • 60 . Rate 45 I Calculate reduce wat ground rr zone's grou sens J amount to j ering due to ioisture & nd moisture itivity f Calculate maximum I watering time from I desired group precip I and zones precip. rate | No I Enter 255 minutes for watering time W T Reduce w; by ground ground sensitiv atering time I . moisture & moisture I ity result I ► Figure 15. Calculating New Watering Times. 46 Set source & \ dest. pointers to top of watering table / MoveV Table Jf Is watering table active ? Move source zone number & time remaining to destination Is time = O for source entry ? / Was zone x moved an active x drip zone ? / Move the drip offset value to stay with the drip zone /W as ZonexX moved an active x . sprinkler zone Move the sprinkler offset value to stay with the sprinkler zone Increment the destination pointer Increment the source pointer / I Have all \ source entries been checked CIearX Table/ Figure 16. Removing Zero-Time Entries. 47 3. Finally, the new calculated durations are moved from the scratch-pad table into the watering table. Each zone number moved is compared to any remaining zone numbers in the watering table. If a match is found, the maximum of the two watering durations is entered as the new time to water the zone. Ifno match is found, the scratch-pad entry is moved into the next blank location in the watering table. This process is shown in Figure 17 on page 48. Update Zones Based on New Conditions The final task accomplished in the one minute interrupt service routine is to update the status of all zone valves based on the new conditions. Figure 18 on page 49 shows the process. This task is performed twice - once for sprinkler zones and once for drip zones. If a zone is currently on, then it has been on for the last minute. Its remaining time is decremented. If it still meets all conditions to remain on, then the routine is finished. The zone is turned off if it no longer meets the conditions to stay on, or if its remaining time was decremented to zero. If no zone is on, a search is started at the top of the watering table for the first zone to meet all conditions. The routine is completed when either a zone was turned on or after the whole table was searched. 48 CIearX Table/ Point to top of scratchpad table/ f s DestinatiorK pointer at end of x table ? x Point to next entry in scratchpad table Point to top of watering table Clear time remaining I and zone number for destination entry I Point to next entry in watering table / Is current K s entry in watering xtable empty Kg!?Increment the destination pointer / / Does K s ^ scratchpad z o n e \ = watering table,' ' K s zone ? Move scratchpad zone! into watering table I scratchpad time > watering table K s time ? Move scratchpad time I into watering table | / Have K s all scratchpad zones been S s moved ? K Set watering sequence active flag Return from subroutine] Figure 17. Filling the Watering Table. 49 Update the zones Is a zone on \ (offset /= 24) ? Decrement active zone time remaining. Are conditions met Xfor zone to water Turn active zone off. Point to the top of the watering table. Are conditions met x X for zone to w aterx# Point to next location I in the table. Turn the zone on. Set the offset equal to the zone's location in the watering table.Have all x . rater table entriesX been checked Continue Figure 18. Updating the Zone Status. 50 Figure 19 on page 51 shows the decision tree for determining if a zone meets conditions to either stay on or be turned on. The zone must be turned off or cannot be turned on if any of the following conditions exist: o The zone has completed watering. O The controller is paused due to low pump pressure, manual pause or a block- out time. O If the wind speed is too high, the zone is defined to pause due to high wind and the wind pause is not being overridden, o If it is raining and the zone is defined to pause during rain, o The zone number is invalid. • o The zone type is such that it cannot be on simultaneously with another zone that is on. One Second Interrupt Service Routine This interrupt service routine is actually entered every half second. All processes which relate to actual controller behavior are performed every other interrupt, or every second. The output compare register is 2 bytes allowing for a maximum count of 65535. The free-running timer’s frequency is 115.2 kHz. The next interrupt will occur in another 500 msec by setting the output compare’s next capture to occur at its current count plus 57,600. Three controller functions are performed every second: 1. The water pressure is measured with possible action being taken on the pump status. 2. If a main valve is defined, its status is updated according to the other zones. 3. If adequate water pressure exists, the zone bytes are sent to the zone driver boards. 51 C h e ckX Type Il Check conditions for turning on zone / Does offset \ type match zone X type ? W Does remaining^, zone time = 0 Yes—►* / Testing x offset for shared \d r ip zones Tgi / Is b lock-out,\ manual or pump X flag set ? ^ Zx Is a x X sprinkler zone on (offset * 24) Zx Is current \ sprinkler zone type sVmay share' V x Is wind override flag se t? / Is drip Zonex x type 'must' or 'may "X share' ? x Is wind x pause flag set Return True (OK to turn zone on) Does this zone ignore wind ? Is rain pause flag set Does this zone ignore rain ? C h e c kX ,Typey1 Return False (May not turn zone on Figure 19. Determining if a Zone Meets Conditions. 52 Determine the Effect of Water Pressure on the Pump Figure 20 on page 53 shows the decisions used in turning on and off the pump. The water pressure is measured and its value saved. The pressure is then compared to pressure levels defined by the user: o Maximum water pressure - when this pressure is reached, the pump turns off. o Minimum zone pressure - if the pressure is below this level, the pump will be started and pressure allowed to build before a new zone valve is turned on. o Minimum water pressure - when the pressure drops below this pressure, the pump turns on. o Danger pressure - when the pressure drops below this pressure, all zones are shut off. If the pressure fails to rise above the danger level in a short period of time, disable the pump for a long period of time. After the disable time is completed, the pump will be started. If the pressure still does not rise to a safe level, the pump is permanently disabled. Update the Master Valve Status A master valve is used in a system to turn off the main water line before going to any other valves. Therefore, if one is used, it must be turned on at the same time as any other zone. If defined, the master valve must be connected as zone number I . The program checks the zone definitions in EEPROM for zone number I. A master valve is assumed to be present if it is defined as a special function zone (type I) and the master valve zone number is I. All other zone bits are checked to determine if any zone is to be turned on (ON - bit=0, OFF - bit=l). If so, bit corresponding to the master valve is cleared, otherwise it is set. 53 Check Effect of WaterX Pressure on Pump J J Measure current water pressure. Is pressure > danger pressure ? Just dropping" below danger pressure ? - Is pressure > mininum pressure ? No------ Set pump flag. Load seconds timer with full time.Turn pump on. Clear pump flag. I Load minutes timer § with full time. Clear | seconds timer. Turn all zones off. Is pressure > maximum pressure ? Is seconds timer zero ? Turn pump off. Turn pump on. Decrement seconds. ITurn pump off. Done Figure 20. The Effect of Water Pressure on the Pump. 54 Turning on Valves front Zone Status Bytes The one minute ISR turns off zones by writing directly to the zone driver board and writing to the zone status bytes. However, when it decides to turn a zone on, only the zone status bytes are written to. This part of the one second ISR is responsible for turning on any zones by writing to the zone driver boards. Once the master valve bit has been updated, the water pressure is compared to the minimum level to turn a zone on. Ifthe pressure is adequate, the zone status bytes are copied to the zone driver boards, turning on the valves. If the pressure is not adequate and one or more valves are to be turned on, the pump will be turned on. 55 CHAPTER 5 - CONCLUSIONS AND FUTURE WORK Conclusions Some improvements which decrease the water and energy consumption of irrigation controllers have been unavailable in a stand alone controller. An expandable irrigation controller was designed and built which allows water and energy conserving features to be added as needed. The basic unit functions as an 8-zone controller, expandable to control 24 zones. The completed hardware and software allows for inputs of wind speed, proportional ground moisture, water pressure and precipitation. Each of these input values is used to either change the duration of watering or to postpone watering. Watering will then occur under optimal conditions to conserve water and energy. The remote control via an RF link or RS-232 port allows for future expansion and various levels of control possibilities. The RS-232 port was used in conjunction with a personal computer for verifying the operation of the controller. The PC program allowed a great deal of flexibility in presenting the many user options in an understandable format. The ability to simultaneously water both high and low flow rate zones as allowed by the user prolongs pump life as the number of starts and stops will be reduced. An economical design of the controller was possible by using a combination of existing electronics and irrigation products. 56 Future Work The many alternatives for input measurement and controller communications forced a relatively narrow scope for the thesis project itself. Many avenues are available for continued improvement of the project. Software The software for the microcontroller itself is complete for operating the energy and water conserving features of the controller. Provision was made in the hardware to monitor additional weather parameters which would not yet be available to the user. Perhaps a greater software enhancement would be in the PC itself. The GUIs (Graphical User Interfaces) now prevalent on PCs could be used to greatly enhance the usability and programmability of the irrigation controller. Graphic displays of the irrigation system would make the many options and definitions available much simpler to understand and select. Remote Control The flexibility provided by the RF link and RS-232 port provide many possibilities for controlling the unit remotely. A hardware design using a liquid ciystal display and either a touch panel or discrete switches would provide a panel that could communicate to the irrigation controller over either RF or a serial line. Cost Reduction The marketability of any product, regardless of its features, is inevitably determined by its cost. The appendix shows the cost of parts on the three circuit boards comprising the basic controller. All of these parts were for small quantities. Purchasing in quantities of thousands of pieces greatly reduces the pairts cost. The current design did not underestimate the hazardous effects of power fluctuation or loss which affects many low cost controllers. Some of these features could possibly be made optional to further reduce the cost of the basic controller. 58 REFERENCES 59 REFERENCES 1 Toro 1991 Irrigation Products, The Toro Company, 1991. 2 Rain Bird TurfTrrigation Equipment 1991-1992, Rain Bird Sales, Inc., 1991. 3 Griswold Moisture Sensing Systems. Griswold Controls, 1990. 4 Nelson 1993 TurfProducts Catalog. L.R. Nelson Corporation, 1992. 5 Touch Command LX Solid State Controller, Hardie Irrigation, 1991. 6 HR6100-1 Controller, Hardie Irrigation, 1991. 7 Rain Dial Controller, Hardie Irrigation, 1992. 8 Richdel Hybrid Controllers, Hardie Irrigation, 1991. 9 Intermatic Energy Controls, Intermatic Incorporated, 1992. 10 Weather-Tec Turf Products, Weather-Tec/Skinner, 1990. 11 I ,awn Genie Automatic Watering System. Hardie Irrigation, 1991. 12 TVS/Zener Device Data. Motorola, Inc., 1991. 13 Rectifiers and Zener Diodes Data. Motorola, Inc., 1988. 14 TinearData Book I, National Semiconductor Corporation, 1988. 15 Real-Time Clock plus RAM with Serial Interface, Motorola, Inc., 1993. 16 Small-Signal Transistors. FETs. and Diodes Device Data, Motorola, Inc., 1991. 17 M68HC11 Reference Manual. Motorola, Inc., 1991. 18 Texas Instruments Interface Circuits Data Book, Texas Instruments, 1991. 19 Motorola High-Speed CMOS Logic Data. Motorola, Inc., 1989. 20 Microchip Data Book, Microchip Technology, Inc., 1992. 60 APPENDIX- BILL OF MATERIALS 61 Bill of Materials Options Connector Board: Otv. Designator Description 7 P101-P103,P105-P108 5-pin Molex Straight Header, 0.100” Spacing I P104 10-pin Molex Straight Header, 0.100” Spacing Subtotal Sprinkler Zone Driver Board: Qtv- Designator Description 8 C01-C08 0.56pF, 50V Stacked Metallized Film Capacitor I CIO 0 .1 pF Monolithic Ceramic Capacitor I POl 8-Contact Terminal Strip Plug, 0.200” Spacing I POl 8-Contact Horizontal PC Socket, 0.200” Spacing I P02 6-pin Molex Side Entry PCB Connector, 0.100” Spacing I P03 10-pin Molex Side Entry PCB Connector, 0.100” Spacing 8 Q01-Q08 2N6071 4A Triac 8 R01-R08 470 I/2W Carbon Film Resistor 8 Rl I-R l8 750 I/2W Carbon Film Resistor I RNOl 3300 I/8W Common Terminal 9 Resistor Network 8 U01-U08 MOC3011 Optoisolated Triac Driver I U09 74HC374 Octal Tri-State D-type Flip-Flop Subtotal Microcontroller Board: Otv. Designator Description I BTOl 2-pin Molex Straight Locking Header, 0.100" Spacing I BTOl 2-pin Molex Terminal Housing, 0.100” Spacing 2 BTOl Crimp Terminal for 0.100” Housing I BTOl 3 AA Cell Battery Holder w/ 6” Wire Leads 3 BTOl AA Cell, 1.2 Volt, Nickel Cadmium Battery 4 C01,C10,C13,C17 0.33pF, 50V Metallized Film Capacitor 2 C02,C03 O.lpF, 50V Metallized Film Capacitor 10 C04,C07,C 12,C 15,C 18- O.lpF Monolithic Ceramic Capacitor 3 C23 C05, C08, C09 22pF, 100V Ceramic Capacitor I C06 6.5-40pF Plastic Encased Variable Capacitor 3 Cl 1,C14,C16 2200uF, 25V HFQ Radial Lead Elecrolytic Capacitor 6 DO I, D04-D08 1N4004 I A, 400V Rectifier 2 D02,D03 1N4148 Switching Diode 2 F1,F2 IA Fast Acting Fuse I POl 26-pin Dual Row Straight Header, 0.100” Spacing I P02 DB-9F P C. Straight Mount Connector I P03 3-Contact Terminal Strip Plug, 0.200” Spacing I P03 3-Contact Vertical P C. Socket, 0.200” Spacing 3 P04, P06, P08 10-pin Molex Straight Header, 0.100” Spacing 3 P05, P07, P09 6-pin Molex Straight Header, 0.100” Spacing I QOl 2N3904 NPN Small Signal Transistor I Q02 2N4402 PNP Small Signal Transistor, 500mA I ROl 30.1 kO 1/4W, 1% Metal Film Resistor 4 R02, R09, R10, R12 10 kQ 1/4W, 5% Carbon Film Resistor Price $2.65 $0.61 $3.26 Price $3.10 $0.21 $4.16 $1.33 $0.66 $ 1.10 $6.00 $0.43 $0.43 $0.30 $5.52 $0.61 $23.85 Price $0.23 $0.12 $0.16 $1.06 $4.95 $1.22 $0.37 $2.10 $1.61 $0.98 $4.92 $0.41 $0.11 $0.41 $0.59 $0.45 $1.65 $0.50 $1.80 $1.35 $0.18 $0.18 $0.10 $0.21 62 Q lL Designator Description Price 3 R03, R04, R05 100 kO I/4W, 5% Carbon Film Resistor $0.16 I R06 100 Q I MW, 5% Carbon Film Resistor $0.05 2 R07, RI6 10 Mfi 1MW, 5% Carbon Film Resistor $0.10 I R08 200 kfi I MW, 5% Carbon Film Resistor $0.05 I RH 2.0 kQ I MW, 5% Carbon Film Resistor $0.05 I R13 4.99 kQ I MW, 1% Metal Film Resistor $0.10 I R14 121 Q I MW, 1% Metal Film Resistor $0.10 I R15 330 Q I MW, 1% Metal Film Resistor $0.10 I R17 3.01 kQ I MW, 1% Metal Film Resistor $0.10 I RNOl IOkQ I/8W Common Terminal 7 Resistor Network $0.24 I RN02 IOOkQ I/8W Common Terminal 9 Resistor Network $0.30 I RN03 IOOkQ I/8W Common Terminal 7 Resistor Network $0.24 I SWOl 2-pin Straight 0 .100” Spacing Header $0.00 I SWOl 2-pin Shorting Block $0.09 2 TVS I, TVS2 1500W, 20V Transient Voltage Suppressors $3.44 I UOl MC68HC68T1P Motorola Real-Time Clock $4.62 I UOl 16-pin Machine Pin Socket $0.83 I U02 LM336Z-5.0 Precision 5-Volt Reference Diode $1.50 I U03 SN75C1406 Texas Instruments RS-232C Driver/Receiver $2.12 I U04 MC68HC1 IAl Motorola Microcontroller $15.23 I U 04 52-pin PLCC Socket $2.03 I U05 74HC373 Octal Tri-State Latch $0.62 I U06 74HC00 Quad NAND Gate $0.31 I U07 74HC139 Dual 2-4 Decoder $0.44 I U08 27C64-12 64k-bit EPROM - 250ns $3.45 I U08 28-pin Machine Pin Socket $1.35 I U09 74HC541 Octal Tri-State Buffer $0.64 I UlO LM7812 Medium Power Positive 12 Volt Regulator $0.48 I U ll LM7912 Medium Power Negative 12 Volt Regulator $0.55 I U12 LM7805 Medium Power Positive 5 Volt Regulator $0.48 I YOl 32.768 kHz Quartz Crystal $0.54 I Y02 7.3728 MHz Quartz Crystal Subtotal $1.72 $67.69 O