Silicon ChipThe Rain Brain Automatic Sprinkler Controller - January 1996 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Publisher's Letter: Crystal balling the telephone
  4. Feature: Recharging Nicad Batteries For Long Life by Horst Reuter
  5. Project: Surround Sound Mixer & Decoder; Pt.1 by John Clarke
  6. Feature: Computer Bits by Geoff Cohen
  7. Project: Build A Magnetic Card Reader & Display by Mike Zenere
  8. Project: The Rain Brain Automatic Sprinkler Controller by Graham Blowes
  9. Product Showcase
  10. Order Form
  11. Project: IR Remote Control For The Railpower Mk.2 by Rick Walters
  12. Serviceman's Log: The complaint seemed simple enough by The TV Serviceman
  13. Book Store
  14. Vintage Radio: Converting from anode bend to diode detection by John Hill
  15. Back Issues
  16. Notes & Errata: Dolby Pro Logic Surround Sound Decoder, November-December 1995; Five-Band Equaliser, December 1995
  17. Market Centre
  18. Advertising Index
  19. Outer Back Cover

This is only a preview of the January 1996 issue of Silicon Chip.

You can view 22 of the 96 pages in the full issue, including the advertisments.

For full access, purchase the issue for $10.00 or subscribe for access to the latest issues.

Articles in this series:
  • Surround Sound Mixer & Decoder; Pt.1 (January 1996)
  • Surround Sound Mixer & Decoder; Pt.1 (January 1996)
  • Surround Sound Mixer & Decoder; Pt.2 (February 1996)
  • Surround Sound Mixer & Decoder; Pt.2 (February 1996)
Articles in this series:
  • Computer Bits (July 1989)
  • Computer Bits (July 1989)
  • Computer Bits (August 1989)
  • Computer Bits (August 1989)
  • Computer Bits (September 1989)
  • Computer Bits (September 1989)
  • Computer Bits (October 1989)
  • Computer Bits (October 1989)
  • Computer Bits (November 1989)
  • Computer Bits (November 1989)
  • Computer Bits (January 1990)
  • Computer Bits (January 1990)
  • Computer Bits (April 1990)
  • Computer Bits (April 1990)
  • Computer Bits (October 1990)
  • Computer Bits (October 1990)
  • Computer Bits (November 1990)
  • Computer Bits (November 1990)
  • Computer Bits (December 1990)
  • Computer Bits (December 1990)
  • Computer Bits (January 1991)
  • Computer Bits (January 1991)
  • Computer Bits (February 1991)
  • Computer Bits (February 1991)
  • Computer Bits (March 1991)
  • Computer Bits (March 1991)
  • Computer Bits (April 1991)
  • Computer Bits (April 1991)
  • Computer Bits (May 1991)
  • Computer Bits (May 1991)
  • Computer Bits (June 1991)
  • Computer Bits (June 1991)
  • Computer Bits (July 1991)
  • Computer Bits (July 1991)
  • Computer Bits (August 1991)
  • Computer Bits (August 1991)
  • Computer Bits (September 1991)
  • Computer Bits (September 1991)
  • Computer Bits (October 1991)
  • Computer Bits (October 1991)
  • Computer Bits (November 1991)
  • Computer Bits (November 1991)
  • Computer Bits (December 1991)
  • Computer Bits (December 1991)
  • Computer Bits (January 1992)
  • Computer Bits (January 1992)
  • Computer Bits (February 1992)
  • Computer Bits (February 1992)
  • Computer Bits (March 1992)
  • Computer Bits (March 1992)
  • Computer Bits (May 1992)
  • Computer Bits (May 1992)
  • Computer Bits (June 1992)
  • Computer Bits (June 1992)
  • Computer Bits (July 1992)
  • Computer Bits (July 1992)
  • Computer Bits (September 1992)
  • Computer Bits (September 1992)
  • Computer Bits (October 1992)
  • Computer Bits (October 1992)
  • Computer Bits (November 1992)
  • Computer Bits (November 1992)
  • Computer Bits (December 1992)
  • Computer Bits (December 1992)
  • Computer Bits (February 1993)
  • Computer Bits (February 1993)
  • Computer Bits (April 1993)
  • Computer Bits (April 1993)
  • Computer Bits (May 1993)
  • Computer Bits (May 1993)
  • Computer Bits (June 1993)
  • Computer Bits (June 1993)
  • Computer Bits (October 1993)
  • Computer Bits (October 1993)
  • Computer Bits (March 1994)
  • Computer Bits (March 1994)
  • Computer Bits (May 1994)
  • Computer Bits (May 1994)
  • Computer Bits (June 1994)
  • Computer Bits (June 1994)
  • Computer Bits (July 1994)
  • Computer Bits (July 1994)
  • Computer Bits (October 1994)
  • Computer Bits (October 1994)
  • Computer Bits (November 1994)
  • Computer Bits (November 1994)
  • Computer Bits (December 1994)
  • Computer Bits (December 1994)
  • Computer Bits (January 1995)
  • Computer Bits (January 1995)
  • Computer Bits (February 1995)
  • Computer Bits (February 1995)
  • Computer Bits (March 1995)
  • Computer Bits (March 1995)
  • Computer Bits (April 1995)
  • Computer Bits (April 1995)
  • CMOS Memory Settings - What To Do When The Battery Goes Flat (May 1995)
  • CMOS Memory Settings - What To Do When The Battery Goes Flat (May 1995)
  • Computer Bits (July 1995)
  • Computer Bits (July 1995)
  • Computer Bits (September 1995)
  • Computer Bits (September 1995)
  • Computer Bits: Connecting To The Internet With WIndows 95 (October 1995)
  • Computer Bits: Connecting To The Internet With WIndows 95 (October 1995)
  • Computer Bits (December 1995)
  • Computer Bits (December 1995)
  • Computer Bits (January 1996)
  • Computer Bits (January 1996)
  • Computer Bits (February 1996)
  • Computer Bits (February 1996)
  • Computer Bits (March 1996)
  • Computer Bits (March 1996)
  • Computer Bits (May 1996)
  • Computer Bits (May 1996)
  • Computer Bits (June 1996)
  • Computer Bits (June 1996)
  • Computer Bits (July 1996)
  • Computer Bits (July 1996)
  • Computer Bits (August 1996)
  • Computer Bits (August 1996)
  • Computer Bits (January 1997)
  • Computer Bits (January 1997)
  • Computer Bits (April 1997)
  • Computer Bits (April 1997)
  • Windows 95: The Hardware That's Required (May 1997)
  • Windows 95: The Hardware That's Required (May 1997)
  • Turning Up Your Hard Disc Drive (June 1997)
  • Turning Up Your Hard Disc Drive (June 1997)
  • Computer Bits (July 1997)
  • Computer Bits (July 1997)
  • Computer Bits: The Ins & Outs Of Sound Cards (August 1997)
  • Computer Bits: The Ins & Outs Of Sound Cards (August 1997)
  • Computer Bits (September 1997)
  • Computer Bits (September 1997)
  • Computer Bits (October 1997)
  • Computer Bits (October 1997)
  • Computer Bits (November 1997)
  • Computer Bits (November 1997)
  • Computer Bits (April 1998)
  • Computer Bits (April 1998)
  • Computer Bits (June 1998)
  • Computer Bits (June 1998)
  • Computer Bits (July 1998)
  • Computer Bits (July 1998)
  • Computer Bits (November 1998)
  • Computer Bits (November 1998)
  • Computer Bits (December 1998)
  • Computer Bits (December 1998)
  • Control Your World Using Linux (July 2011)
  • Control Your World Using Linux (July 2011)
Articles in this series:
  • Railpower MkII: A Walk-Around Throttle For Model Railways; Pt.1 (September 1995)
  • Railpower MkII: A Walk-Around Throttle For Model Railways; Pt.1 (September 1995)
  • Railpower MkII: A Walk-Around Throttle For Model Railways; Pt.2 (October 1995)
  • Railpower MkII: A Walk-Around Throttle For Model Railways; Pt.2 (October 1995)
  • IR Remote Control For The Railpower Mk.2 (January 1996)
  • IR Remote Control For The Railpower Mk.2 (January 1996)
n i a R n i a Br By GRAHAM BLOWES This automatic sprinkler controller allows you to selec­tively water any area of a garden or nursery as little or as often as you like. It can control up to eight solenoids plus an optional master solenoid. T HE FIRST VERSION of this de- sign was published in the July 1992 edition of SILICON CHIP. It was a popular project and I still get enquires from the original article. About a year ago, I decided that an update was due. The most obvious thing that needed replacing was the microcontroller, as the NMOS 68705­P3 microcontroller was to be discontinued. The controller now uses a PLCC version of the popular 68HC­705­C8. There was also some changes made 54  Silicon Chip to the power supply, which now uses a switching IC. While I was at it, I also decided to make a couple of changes to the front panel layout. First, I deleted the row of green LEDs that were used to indicate which solenoids were on. This function is now taken care of by the row of red LEDs – when a solenoid turns on, the appropriate LED flashes at a fast rate to provide the “on” indication. I also added an extra button to the front panel to make it easier to get back to the default mode. Apart from that, the layout of the front panel worked pretty well, so I kept it that way. The PC board is also now a lot easier to put together than before. And finally, I’ve added three inputs –designated Rain 1, Rain 2 and Frost 1 – that enable almost complete automation of your garden! Two of the inputs are for optional rain switches that enable the controller to turn off selected cycles if it is rain­ing. This facility is especially important in a country like Australia, where many parts of the country suffer from low rain­fall. Wasting water costs money, especially these days with the in-vogue user-pays principle, so turning off the sprinklers when it rains makes economical (and ecological) sense. The third input is for a temperature sensor (again option­al). This enables the controller to switch in extra cycles on a hot day. It even works in reverse; an extra cycle can be switched in if the temperature falls below a set trip point. The con­troller even stores the MIN and MAX temperatures (time stamped) for today and yesterday. Each rain switch and temperature trip point can be set on a cycle by cycle basis. The default mode can display the time and date, or the time and current temperature. This facility n Main Features (1). Uses a 16 x 1 liquid crystal display (LCD) to show time, date and sprinkler settings, plus all the various system menus. (2). Controls up to eight solenoids plus a master solenoid. (3). Each station can have up to four cycles on Program A and Program B, or eight cycles on Program C (Program C = Program A + B). Each cycle can operate with either the three-week built-in calendar or on a continuous schedule for up to 99 days (4). Each station (and cycle) is completely autonomous, providing a possible 64 programmable start times per day (Program C). (5). LED indication of station status. Continuously lit = auto mode on; fast flash = solenoid on; 1Hz flash = Rain Off mode. (6). Manual on/off control for each solenoid. The run time of cycle 4 can be used to provide an automatic cutoff feature. This lets you manually is pro­ grammable via the “CONFIG” menu. More about that later. Main features The original version allowed sprinklers to turn on every day, every second day, every third day, etc. While this system worked OK, it was a bit difficult to nail down exactly which days the sprinklers would turn on. To rectify this, the Rain Brain now has a 3-week cycle as well as the original method – the original method being useful for plants that require watering at a set interval, regardless of whether it is a weekend or not. The “3-week cycle” method is based on a built-in calendar. It lets you choose exactly which days the sprinklers will turn on up to three weeks in advance! For example, you could program the unit so that solenoid 1 turned for two 1-hour cycles on Monday of the first week, Wednesday of the second week and Thursday of the third week. All the facilities mentioned above are available to every single cycle, and are programmable via the “AUXILIARY FUNCTIONS” menu. To cater for the extra facilities, the Rain Brain has twice the EEPROM capacity of the previous version. Each switch on a sprinkler and forget it. The sprinkler will then automatically turn off after the run time of cycle 4 has expired. (7). Run time (per cycle): 1-99 minutes. The cycles can be joined so the maximum run-time (per solenoid) is: 8 x 99 minutes = 13 hrs, 10 mins. (8). An EEPROM stores all settings, so settings are not lost if the backup battery fails. Battery backup is provided by a 3V lithium battery. (9). A “Rain Mode” deactivates all automatic cycles while saving program settings. (10). Two fully programmable Rain Switches (optional) allow any/all of the 64 cycles to be controlled by the immediate weather conditions automatically. (11). An optional Temperature Sensor enables any/all of the 32 cycles of Program A (or B ) to switch to another cycle if the programmed trip temperature is exceeded. This allows extra cycles to of the eight stations can switch on as often as eight times a day (ie, there are up to eight daily cycles), or as little as once every 99 days! As before, each cycle can be programmed for an “on time” of 1-99 minutes. A new feature allows you to choose from three standard programs, designated A, B and C. Programs A and B allow each station to programmed for four cycles per day, while program C combines programs A and B to provide up to eight cycles per station per day. If this isn’t enough, you can add optional extra memory plus a switch to select an alternative group of A, B and C pro­grams. The row of eight LEDs beneath the LCD indicates the status of the solenoids at a glance. If a LED is flashing quickly, this indicates that the solenoid is turned on. If a LED is steady, the station is active, meaning that it will switch on automatically once its “turn on” conditions are satisfied. And if all enabled LEDs are flashing slowly (1s on, 1s off), a rain switch has been activat­ed. A flash rate of 0.5s on, 0.5s off indicates the “RAIN OFF” mode. This means that all automatic cycles have been globally disabled (see later). This mode has precedence over the rain be automatically added; eg, so that plants get extra water on a hot day! The sensor is accurate to ±0.1°C and has a range from -20°C +60°C. (12). The controller stores the maximum and minimum temperatures sensed that day and the time at which these extremes occurred is also recorded. This information is accessed by pressing the “Cursor” button while in the Default Mode. The previous day’s temperature extremes can also be displayed, as well as the current temperature! (13). Uses the well proven MC68HC­ 705C8 microcontroller. A watch dog circuit ensures a proper reset is issued to the microcontroller if it “crashes” due to a mains glitch. (14). All appropriate solenoids are enabled and the various cycles completed after a reset, or when power is restored after a power failure. (15). Runs from a 10-24VAC or a 1035V DC 1A plugpack supply. switch inputs and the fast flash rate has precedence over them all. Although these different flash rates may seem initially confusing, it all makes perfect sense when you start using the unit. Power requirements The unit is powered by the usual 24V AC plugpacks associat­ ed with watering systems, or from voltages as low as 10V DC. As with the first version, flat batteries are not a problem, as all settings are stored securely inside an EEPROM. The controller reads the EEPROM when it is first turned on, so it knows exactly which mode it should be in (RAIN OFF or DEFAULT) and which sprin­klers are active. Other uses By this stage, you are probably already thinking of other uses for this versatile controller, apart from its primary use as a sprinkler solenoid controller. For example, those of you who have an interest in satellites can set the controller to switch on a tape recorder at the time it is due to pass overhead, even though you may be on holidays for a few weeks. Alternatively, the unit could be used as a security light controller or January 1996  55 56  Silicon Chip Fig.1 (left): the circuit is based on IC4, a 68HC705C8 microcontroller. IC3 is a real-time clock (RTC), while IC1 is an EEPROM and is used to store the programmed settings. as a general-purpose timer. In these applications, the on-board relays can act as slaves to appropriately rated offboard relays, so that other equipment can be controlled. How it works The circuit is fairly straightforward (Fig.1), with all the heavy work being done by the software in the micro­ controller (IC4). Starting with the power supply, diodes D1-D4 rectify the 24V AC input, which results in about 35V DC across C1. IC8 (LM2574-5) is from the “simple switcher” series from National Semiconductor and provides a very efficient method of providing a 5V rail to power the circuitry. The resultant 5V across C2 is further decoupled by L1 and L2. These inductors attenuate any spikes generated by the sole­noids as they switch on and off. Note that the relay driver (ULN2804, IC5) is supplied from the “noisier” 5V across C2. C16, C17 and C18 are spread around the PC board to decou­ple the power supply. The circuit draws the following currents from a 24V AC plugpack under the following conditions: (1) all LEDs off = 26mA; (2) all LEDs on = 32mA; and (3) all LEDs and relays on = 88mA. The microcontroller (IC4) uses a standard 3.58MHz crystal (Xtal2) as a timebase. A feature of this micro­ controller is an internal watchdog function, called the Computer Operating Proper­ly (or COP). I tried to get this to work but the maximum timeout period with this crystal is a bit over one second. This is a bit short and I eventually opted for a tried and tested alternative built around timer stage IC2. The time function is supplied by real time clock stage IC3 (PCF8573), hereafter referred to as the RTC. This RTC chip inter­ rupts the micro­ con­ troller every minute. Each time it receives an interrupt, the micro­con­ troller reads the RTC and stores the time in an internal RAM buffer. After this, it reads 12 bytes of January 1996  57 set if any of these inputs are activated. The temperature input (PD4) is read every minute, for one second exactly. During this time, writes to the LCD and LED flashing routines are disallowed, so as to prev­ent incorrect temperature measurements. Button switches The button switches are connected directly to the microcon­troller (PD0-PD4 & TCAP). An RC network attached to each pin provides a small amount of debounce, while the software does the rest. Buttons S1-S4 (Menu, Cursor, Up, Down) are polled during the main loop, whereas button S5 (Exit) is connected to the TCAP input. The TCAP pin is an interrupt pin associated with the internal timer function. In this application, it is simply used to notify the micro­controller that the button was pressed in a manner similar to how a normal interrupt would be used. Watchdog timer This circuit comprises a CMOS 7555 IC (IC2), configured as an astable multivibrator but normally prevented from oscillating. If IC4 is functioning correctly, PA7 (pin 5) is set to a logic 1 within the timer interrupt routine and cleared in the mainloop. The resulting waveform continually charges and discharges C14. This means that Q1 is continually turned on and off, which prev­ents C4 from charging up and thus disables IC2. However, if the pulses from PA7 stop due to a spike causing the program to stop and/or crash, IC2 will begin to oscillate. After about 10 seconds, its pin 3 output will pull IC4’s reset pin (pin 1) low via D16, thereby resetting the microcontroller. Note that the time-out period is set to 10 seconds to allow for the “dead time” during the EEPROM read cycle every minute. The timer interrupt interval is set to 5ms. Fig.2: install the parts on the PC board as shown here. Note that IC1, IC3, IC4 & IC11, the relays and the LCD should not be mounted until after an initial “smoke” test has been carried out (see text). EEPROM (IC1 or IC11) asso­ciated with cycle 1 of solenoid 8 and compares the stored start times with the current time and date. It then repeats the process 31 more times for the other cycles and solenoids (this process takes twice as long when program C is selected). The LCD and the two 8-bit latches IC6 & IC7 (74HC573) share port B as a common data bus. When the micro­ con­troller needs to send data to either latch, pin 11 of the re­quired latch is pulsed high (by either PA5 or PA6). At reset, all port pins are initialised as inputs (high Z), therefore the OE pin (pin 1) of IC7 is held high by R18 until the latch is cleared and PA2 is made an output. This stops inadvertent operation of any relays until initialisation is complete. The LCD data is validated by the E pin (pin 6, LCD connec­tor). As the microcontroller is not required to read the internal RAM of the LCD display, the R\W pin can be tied low, which is write mode. VR1 is used to adjust the contrast of the display. The two Rain Switch inputs (PD7 & PD5) are tested during the timer interrupt routine. Appropriate flags are 58  Silicon Chip The EEPROM The EEPROM is an 8Kb device, internally organised as 1024 x 8 bits. Each cycle of each solenoid is allocated 12 bytes of the EEPROM (11 of these are used, with one spare). Another part of the EEPROM is set aside for storing “global” variables like the current year, the LED status, and whether “Rain Mode” is active or not. Pin 3 (A2) of IC1 and IC11 is an address pin, which allows two of these chips to be connected onto the same I2C bus. The A2 pins are connected to either side of S6, which allows either of the EEPROMs to be switched into circuit. The selected EEPROM is read at power up, to determine which mode it should be in (ie, “RAIN OFF” mode or just the Default mode) and which LEDs are active. At the next interrupt from the RTC (IC3), any cycle that satisfies the “On Time” conditions will be switched on. No settings will ever be lost! Real time clock The RTC chip (IC3) interrupts the microcontroller every minute, causing it to read the time. IC3 re­quires a 32.768kHz crystal (commonly called a “watch” crystal) for its internal dividers. The oscillator can be trimmed using C12 to provide very accurate time keeping. Note that the FSET pin (frequency SET) is brought out to a The switches, the eight station indicator LEDs and the LCD are all installed on the reverse side of the board. PC board pin to facilitate easy tuning using a frequency meter. When power is lost from the main circuit, a 3V lithium battery (B1) cuts in and keeps IC3’s oscillator going. The bat­tery is held off via D14 and D13 when normal power is applied to the circuit. IC3 draws about 7µA when the power is off. Note that if the HOURS or MINUTES setting is altered when setting the time, the seconds counter in the RTC will be reset. The DAY and MONTH settings do not cause the seconds counter to reset but the HOUR and MINUTE settings are written to. The YEAR and (P)rogram settings have no effect on the RTC. Rain/temperature inputs The three input circuits are identical and are based on LM393 comparator ICs. VR2-VR4 are used to adjust the trip voltag­es, which can vary from about 0.9V to about 2V. Resistors R3, R15 & R16 (1MΩ) provide hysteresis to prevent the outputs from oscillating. R8, R9 and R10 provide the current The programmed data in the EEPROM is backed up by a 3V lithium cell. Take care with the orientation of IC4. feed to the rain switch­es and temperature sensor circuit. The output circuits of the rain switch and temperature sensor act as constant current sinks. If the probes are wet, then the Rain Switch draws an extra 13mA compared to when the probes are dry. The current flows to ground via 68Ω resistors R4, R14 & R17. The extra current flowing when the probes are wet causes the voltage across these resistors to increase, which in turn causes the comparator to trip. Normally, the open collector outputs of the comparators are held high by 10kΩ pullup resis­tors. When they trip, the outputs turn on, thereby presenting a logic 0 to the micro­controller port pins (PD7, PD5 & PD4). The temperature input requires a frequency that is directly proportional to the temperature at a resolution of 50Hz/°C. 1000Hz corresponds to 0°C, 2000Hz corresponds to 20°C and so on. When the temperature sensor is not connected, the temperature display will be -19.9°C. Relay drivers & relays IC7 drives IC5, a ULN2804 relay driver IC. This device has open collector outputs and can therefore be used to drive relays with an operating voltage different to that specified. To do this, the component side track marked “*” (above the battery holder) must be cut. A wire running off to a separate power supply is then soldered into the via on the solder side, about 10mm below the “*”. The controller can operate all of the specified relays at once if need be. Each relay draws about 41mA at 5V. This does not mean that all solenoids should be operated at once, however. This very much depends on the transformer that is used to power your sprinkler system. Most solenoids draw around 300mA when supplied by 24V AC. Diodes D5-D12 form an 8-input diode AND gate. If any of the relays (RLY1-RLY8) is (are) switched on, then the associated diode(s) will also be forward biased, thereby switching on RLY9 (the master relay). This relay January 1996  59 The PC board is mounted on the front panel using 12mm spacers and machine screws and nuts. Similarly, the lower edge of the LCD module (near the LEDs) is secured to the PC board using 5mm spacers and machine screws and nuts. can be used to switch on the master solenoid in a sprinkler system, or to start a pump in a rural situation. Manual operation In addition to automatic operation, the solenoids can also be switched on manually. To do this, you simply select the solenoid with the Menu button, then press the Down button; the select­ed solenoid will immediately turn on, as indicated by the fast flashing LED. It will subsequently automatically switch off after the “Run Time” of cycle 4 (cycle 8 if program C) for that sole­noid has expired. If the “Run Time” is set to “00”, then the solenoid will switch off at the next interrupt from the RTC. Note that this facility works whether the “RAIN OFF” mode is active or not. Construction Construction of the Rain Brain is straightforward, since it is supplied as a complete kit. All the parts mount on a double-sided PC board with plated-through holes and a screened layout overlay, so that you can see at a glance where the parts go. As always, eyeball the PC board for any obvious faults before starting assembly. Begin by fitting all the ICs and sockets (except the PLCC socket for IC4). The RTC IC (IC3) and the EEPROM(s) (IC1 & IC11) are the only ICs that require sockets. Do not use sockets for the other ICs. In particular, IC8 (LM2574-5) absolutely must be sol­ dered to the PC board This done, fit the PLCC socket. This socket has one corner chamfered and this must match up with the screened 60  Silicon Chip The five pushbutton switches are all mounted in modified 6-pin DIP sockets on the track side of the board. Note that two pins of each socket are removed – see text. overlay on the PC board. Also pin 1 on the PC board is square, and you will see a little ridge on the side of the socket that denotes pin 1. Do not plug the microcontroller in yet! The three SIL resistor networks (R1, R2 and R7) should be installed next, noting that the pin with the dot goes into the square hole. Note that two of these resistor networks are 10kΩ types, while the other is a 1kΩ type so don’t get them confused. All three can be either 9-pin or 10-pin types. The following parts are mounted on the solder side of the board: LEDs 1-8 (discussed later), the five 6-pin DIP sockets, and the 14-pin SIL connector for the liquid crystal display. Pins 2 & 5 of the 6-pin DIP sockets (used to mount the push buttons) have to be cut out so that they won’t interfere with the PC board (pushing the pins out with the hot soldering iron re­sults a neater job). Solder in all five sockets, then turn the board over and fit the battery holder (don’t fit the battery yet). This done, solder in the 14-pin LCD connector, remembering that it goes onto the solder side of the board (along with the five switch sockets). Next, fit the four trimpots (VR1VR4) and the trimmer ca­pacitor (C12). Set VR2, VR3 and VR4 to midway, then install power supply components IC8, C1, C2, D15 and L3. Note that the cathode of D15 goes into the square hole. The resistors can now all be installed. In particular, install R15 (1MΩ near pin 1 of IC10) so that its long lead goes into the top hole. The same goes for R16 (1MΩ below IC10), while R3 (1MΩ near pin 1 of IC9) should have its long lead to the left. The reason for this is that these long leads are used as test points when adjusting the comparator trip points. The capacitors, diodes, the transistor and the two crystals can be fitted now. You will notice that all the diode cathode pads have square holes, as do all the positive pads of the elec­trolytic capacitors. L1 and L2 have small lengths (23mm) of spaghetti sleeving fitted over their mounting leads so that they stand proud of the board. If only one EEPROM is to be installed, solder a link between the bottom two holes of S6 (marked SW1 on the screened overlay). This links the A2 pin of IC1 to ground. Installing the LEDs As mentioned earlier, the LEDs are mounted on the solder side of the board, so that they match up with clearance holes in the front panel. Insert each LED into its position, remembering that the cathode (short lead) goes into the square hole but do not solder any yet. This done, carefully fix the front panel to the PC board using 12mm spacers and machine screws and nuts – just install two spacers diagonally opposite each other, as this is only a temporary operation. Once the panel is on, manipulate the LEDs so that they fit into the appropriate holes, then solder These two photos show typical displays for the Auxiliary Functions menu. At left, rain sensor 1 has been enabled (1R), the temperature trip point is 10°C, the three-week cycle mode (W) has been selected, week 1 has been selected (—), and the sprinkler will turn on every day of this week. In the photo at right, the continuous schedule (D) mode has been selected and the sprinkler will turn on every day (01). them in from the component side and remove the front panel. Now fit the fuse clips and the connector blocks to the PC board. Don’t fit the LCD or the relays yet, as a smoke test needs to be done first! Smoke test Before applying power, ensure that IC3, IC4, IC1, IC11 (if supplied) and the LCD have not been fitted. This done, connect a suitable power supply to the designated connectors and switch on. Now check that 5V is present across the power supply pins of IC6 (or IC7); ie, between pins 20 & 10. If so, touch the top of each IC for a few seconds, particularly IC8. All the ICs should be cool to the touch. If all is well, switch off and plug in the rest of the ICs. Make sure that you install the microcontroller around the right way. The chamfered corner of the IC must match the chamfered corner of the socket. the connec­tor on the main board and force it down slightly so that it firmly grips the pins. Now turn the power on, while making sure that nothing on the LCD board can short against the main board. You should be greeted with a message telling you to check the battery, a soft­ware version message for a second or two, and then the time and date display. Assuming that all is well, the LCD can be permanently mounted. The lower edge of the LCD (near the LEDs) is secured to the main board using 5mm spacers and machine screws and nuts. Once these are fitted, judge the gap at the connector edge and solder tack a pin. This done, check that the LCD board is paral­lel to the controller board, adjust it as necessary, then solder the rest of the pins. By the way, all the LCDs are tested before they are packed into the kits, as are the microcontrollers. However, it is still nice to know that it works before soldering it in as it is an unpleasant job trying to unsolder them. The five pushbutton switches can now be installed by fit­ting them to the previously installed DIP sockets (there’s no need to solder them). Once they’re in, the plastic switch caps can be clipped into position. If you have purchased the additional memory kit, solder the wires to the toggle switch, then mount the switch in a convenient loca­tion on the side of the case. Make sure that this switch can not foul other parts on the main board when it is installed in the case. Now the front panel can be refitted using the four 12mm spacers provided. This done, clip the lithium battery into its holder (positive side up), connect a power supply and switch on. The LCD should go through the same routine as above. Once the time has been programmed into the RTC, the battery flat message should not show at power up unless the battery is flat. Note that, at this stage, the time display will have mis­cellaneous characters in the time and date fields. Memory initialisation The next step is to put the memory Where To Buy The Parts Parts for the Rain Brain Sprinkler Controller are available as follows: ITEM Rain Brain Kit (excludes relays) Relays – FBR211D005M (Price ea.; specify number required) PRICE P&P $175.00 $10.00 $4.50 Installing the LCD Built & tested (relays extra) $225.00 $10.00 Before installing the LCD, the six tabs that secure the metal frame to the LCD board should be bent over slightly. This is to prevent possible contact with any of the leads protruding through the main PC board. Also check that none of the tabs is shorting to any of the fine tracks around the edges of the tab holes. Next, turn VR1 clockwise until it stops, so that it is in the full contrast position. This done, fit the LCD to Rain switch kit (Price ea.; specify number required) $25.00 $2.00 Temperature probe kit $33.00 $2.00 Optional memory kit $12.00 $2.00 Optional super twist LCD with LED backlight upgrade $8.00 Note 1: p&p is $10.00 for Rain Brain kit plus any combination of other kits. Individual parts are also available (POA). Note 2: Payments by cheque or money order to Mantis Micro Products. Send order to Graham Blowers, 38 Garnet St, Niddrie, 3402 Vic. Phone/fax (03) 9337 1917. For COD orders, you pay $4.75 COD charge plus postage at the destination post office. The Post Office will notify you when the parcel arrives. January 1996  61 PARTS LIST 1 double-sided PC board, code SPV6 1 plastic case with screened front panel 1 P1601 liquid crystal display (H1) 1 BH800 battery holder (BH1) 1 3V lithium battery (B1) 9 5V SPDT relays, FBR211CD005M (RLY1-9) 2 M205 fuse clips (FH1,FH2) 11A M205 fuse (F1) 2 ferrite (6-hole) inductors (L1,L2) 1 470µH inductor (L3) 1 50kΩ miniature horizontal trimpot (VR1) 3 10kΩ miniature horizontal trimpots (VR2-VR4) 1 44-pin PLCC IC socket 1 8-pin DIP socket 1 16-pin IC socket 5 momentary contact pushbutton switches plus plastic caps (S1S5) 5 6-pin DIP sockets (for switches) 4 15mm x 3mm dia. machine screws plus nuts 4 12mm x 3mm dia. spacers 2 5mm x 3mm dia. spacers 1 14-way connector (X1, for LCD) 1 6-way terminal block (X2) 4 3-way terminal blocks (X3-X6) 2 PC pins (X7,X8) Semiconductors 1 CAT24C08P EEPROM (IC1) 1 LM7555 CMOS timer (IC2) 1 PCF8573P real time clock (IC3) 1 MC68HC705C8FN microcontroller (IC4) into a known state. To do this, turn off the power, hold down the Menu and Cursor (⇒) buttons, and turn the power back on. This time, the LCD will tell you to press the Menu button. Once this is done, the “Config” menu will be displayed. This consists of three options: (1). “M” is memory initialisation. Press the Down (⇓) button to ini­ tialise the memory. As each block of 16 bytes is initialised, a LED lights. The LEDs chase each other from left to right, eight times. This routine also acts as a fault locater. If more than one LED lights at the same time, then there is a short circuit on the port B 62  Silicon Chip 1 ULN2804 8-channel driver (IC5) 2 74HC573 latches (IC6,IC7) 1 LM2574-5 5V switching regulator (IC8) 2 LM393 dual op amps (IC9,IC10) 1 BC548 transistor (Q1) 4 1N4004 silicon diodes (D1-D4) 11 1N4148 silicon diodes (D5D14,D16) 1 MUR120RL fast recovery diode (D15) 8 3mm red LEDs (LED1-8) 1 32.768kHz crystal (Xtal1) 1 3.579545MHz crystal (Xtal2) Capacitors 1 1000µF 16VW electrolytic (C2) 1 220µF 63VW electrolytic (C1) 4 10µF 10VW electrolytic (C3,C4,C10,C11) 1 1µF 10VW electrolytic (C13) 10 0.1µF monolithic (C5-8,C1418,C20) 2 27pF monolithic (C9,C19) 1 3-40pF trimmer capacitor (C12) Resistors (0.25W, 1%) 1 10MΩ 5 2.2kΩ 4 1MΩ 1 1kΩ 1 33kΩ 3 470Ω 1W 5 10kΩ 3 68Ω 1 4.7kΩ 2 10kΩ SIL resistor networks 1 1kΩ SIL resistor network Optional memory kit 1 CAT24C08P EEPROM (IC11) 1 8-pin DIP IC socket 1 SPDT switch (S6) data bus. Each cycle is set to 00:00:00 which is actually a start time of midnight, with a run time of 00 minutes. All cycles and both rain switches are enabled. The temperature trip point is off. The 3-week cycle is active, with all days set to on (upper­case). (2). Press the Cursor (⇒) button to move to the next option (A) which is the VR4 adjusting mode. This mode continually reads the tem­perature and displays the result. If VR4 is adjusted correctly, the display will show a steady temperature. How to do this is included as part of the temperature sensor kit. (3). D is the default display setting. A “D” indicates that the date will be displayed in the default display. A “T” means that the temperature will be displayed instead of the date. Press the Down (⇓) button to toggle from “D” to “T”. Adjustments The contrast pot (VR1) should already be set up. The range isn’t very broad, so maximum is probably the best to start with (fully clockwise). The other pots (VR2-VR4) were originally set during construction. Assuming that you are using the optional Mantis Rain Switches (available from the author), VR2 and VR3 can be further adjusted to set the trip voltages to 1.5V. This can be monitored by connecting the positive lead of your meter to the top lead of R15 for Rain Switch 1 (VR2), or to the top lead of R16 for Rain Switch 2 (VR3). To adjust IC3’s oscillator, connect a frequency meter to the pin marked “128Hz” (X7) and the ground lead to the GND pin (X8) nearby. Now tune C12 until a display of “128.0000 Hz” is ob­tained. Note that the frequency counters built into some multi­meters will probably prove unsuitable, as they do not have the resolution required. If a frequency meter is unavailable, check the time against a known good source and tweak the trimmer until the unit keeps good time. Installation The case is not waterproof, so mount it on a wall in the garage or in some other sheltered location. If you must have it outside, the controller will have to be installed in a waterproof case. You will have to drill two rows of five holes (5mm dia.) in the bottom of the case to provide access for the external wiring. Position one row close to the back of the case and the other row about 5mm away. Programming At first sight, programming this controller may seem a little daunting but it only takes about 20 minutes to get the hang of things. If you can program a VCR, you can program this device. We don’t have space to include the programming instructions here but full instructions will be supplied SC with the kit.