Download Microcomputer controlled demand/scheduled water softener
Transcript
United States Patent [191 [11] Patent Number: Seal [45] Date of Patent: * Dec. 25, 1984 4,490,249 [54] MICROCOMPUTER CONTROLLED DEMAND/SCHEDULED WATER SOFI‘ENER OTHER PUBLICATIONS Operating Manual, “Compute-A-Save System”, Water [75] Inventor: J- David Seal, Waukesha, Wis‘ Re?ning Company, Middletown, Ohio, Jul. 1, 1978. Sales Literature, “Water King”, Sta-Rite Industries, [73] Assignee: Autotrol Corporation, Milwaukee, Dela?eld’ wise. wls- Sales Literature, “The Lindsay KNOW-IT-ALL”, _ [*] _ Notice: _ The Lindsay Corporation. The portion of the term of this patent subsequent to Jan. 17, 2001 has been disclaimed. [21] Appl. No.: 511,876 _ _ Prima'?‘ Examiner-1V3" C- clntms Attorney, Agent, or Firm—Quarles & Brady [57] ABSTRACT An improved control for a resin bed water softener [22] Filed: Jul. 8, 1983 includes a microcomputer which is supplied with input data from a ?owmeter indicative of the quantity of soft _ [63] _ water leaving the softener. In accordance with the flow Related U‘S' Apphcatlon Data Continuation of Ser. No. 412,279, Aug. 27, 1982, Pat. No. 4,426,294‘ [5 Int. CL} ............................................ .. [52] [15- Cl- ---- “ receives input data indicative of the total resin bed treat 210/89; 210/98; ing capacity and the incoming water hardness. At a 21o/ 140; 210/143; 364/502 prescribed hour each day, the microcomputer deter of Search ............... .. 89, mines the remaining water softener resin bed treating 210/98, 102, 103, 109, 140, 143, 190, 191, 269; 364/500, 502 capacity as calculated from the water hardness, the total resin bed treating capacity and the amount of water _ [56] data, the microcomputer determines the amount of water used since the last regeneration and also deter mines the average daily soft water consumption. The microcomputer also coupled to a data input device and used since the last regeneration. The remaining resin References cued U_$_ PATENT DOCUMENTS bed treating capacity is compared to the reserve estab lished as a proportion of the average daily consumption of soft water and regeneration is initiated when the 11121211211" reserve is greater than the remaining resin bed treating 4,275,448 6/1981 Le Dall 4,332,678 6/1982 4,385,357 5/1983 Davis et al ....................... .. capaclty Spiegl .... .. 7 Claims, 9 Drawing Figures U.S.> Patent Dec. 25, 1984 ‘ Sheet 2 of 8 20¢ ZLnc 28 7.5g 4,490,249 US. Patent Dec. 25, 1984' TO,FROM CKT. 50 FIG. 4 Sheet40f8 4,490,249 US. Patent Dec. 25, 1984 4,490,249 Sheet 5 of 8 @100 POWER - V ENTER DEFAULT VALUES 7 FILL 7 DAY? CHECK FLOW WITH 1/4 CAP. INPUT FOR TRANSITION Z30 YES FIND \ WHICH SWITCH Z32 _ NO 2 I NCREM ENT FLOW DISPLAY COUNT IT 234w TOGGLE FLOW LED. .____| V I NCREMENT POWER LOSS 7.3M: COUNTER OUTPUT DIGIT T TO J DISPLAY vs I 2 mspLAY ERROR 2A0 CODE OUTPUT men 2 AND OTHER DATA \71‘ CHECK l sec COUNT \ZZZ BLANK DISPLAY US. Patent Dec. 25, 1984 Sheet60f8 4,490,249 FROM FIG. 5A RELOAD l S EC COUNTER -/ ZZb FIG. 58 IO SECOND COUNT Y 1‘!u— CONVERT\ PULSES' T0 GALLONS r 215 A DD GALLO NS ‘ p TO DA l LY TOTAL TURN IT ON US. Patent Dec. 25, 1984‘ Sheet70f8 MAKE / 4,490,249 Z50 suRE IT IS OFF MAKE suRE lT \s ON 14% SECONDS Y cLEAR l0 SECONDS 254 Y cLEAR EL: 3 MIN. y 25¢] INCREMENT J S AVE DATA HOURS ‘ 20o A Fri-£55 J Z71) BLANK \DATA FOR DISPLAY FLAG ‘ ‘ ZbZ cLEAR ERRoR CODE us C U.S. Patent Dec. 25, 1984 Sheet 8 of 8 4,490,249 FROM FIG.5B ADD TODAY'S GALLONS TO TOTAL BETWEEN "\sm FIG. 5D REGENERATION CA LCULATE 7 DAY AVERAGE ‘ ‘53A CALCULATE J UNITS :3“) SHIFT DATA IN FOR AVG. CAPACITY SUBTIQACT J3‘ GALLONS USED SO FAR SAVE TO DAY'S GAL. TO COMHARE AGAINST ) COMPARE TO BESERVE 355' VALVE CALC I20% OF AUG. 51b RESET DAY it 31% 1 4,490,249 2 mand-type water softener control units initiate regener MICROCOMPUTER CONTROLLED, DEMAND/SCHEDULED WATER SOFI‘ENER RELATED APPLICATIONS This application is a continuation of U5. patent appli cation Ser. No. 412,279 ?led Aug. 27, 1982, now US. Pat. No. 4,426,294. BACKGROUND OF THE INVENTION This invention relates generally to a control unit for a resin bed type water softener and more particularly to ation is dependent on the selected reserve value repre senting the anticipated amount of soft water which will be used prior to the next regeneration interval. Since the actual amount of soft water used‘will likely not remain constant, but will vary greatly from day to day, the chosen reserve value must be made large to assure that soft water will always be produced by the water soft ener. Thus, regeneration will likely occur at a greater frequency than is actually necessary. In contrast to the prior art mechanical clock-type water softeners which initiate regeneration on a peri an improved microcomputer-based control unit for a odic basis and prior art demand-type water softener resin bed water softener which initiates regeneration of control units which initiate resin bed regeneration in 15 the water softener resin bed only when necessary. accordance with an arti?cially determined reserve The most common type of water softener is the ion value, the present invention concerns an improved mi exchange resin-type softener having a tank which holds crocomputer processor-based water softener control a bed of resin through which the hard water is passed to unit which initiates water softener regeneration when remove undesirable minerals and other impurities. The ‘the remaining resin bed capacity as determined from the capacity of the resin bed to absorb minerals and impuri actual soft water consumption is less than a reserve ties is ?nite and it is thus necessary to periodically re value calculated in accordance with the actual soft charge or regenerate the resin bed with a regenerant, water consumption to assure that the resin bed is regen typically a brine solution so as to restore the capacity of erated only when necessary. the resin bed for further water treatment. It is an object of the present invention to provide an With the earliest types of water softeners regenera improved water softener control unit which utilizes a tion was effected manually only after it was discovered microcomputer to control water softener resin bed re that the treatment capacity of the resin bed has been generation. exceeded and the water ?owing therethrough was no It is another object of the present invention to pro longer soft. In an effort to eliminate the need for manual vide an improved microcomputer based water softener regeneration, water softener control systems were de control unit which controls water softener resin bed veloped utilizing a mechanical clock which initiated regeneration in accordance with the remaining capacity water softener regeneration on a periodic basis, the of the water softener resin bed to treat water. frequency of such regeneration being set in accordance It is yet another object of the present invention to with the known capacity of the resin bed and the antici pated daily usage of soft water. While mechanical 35 provide an improved microcomputer-based water soft ener control unit which initiates water softener resin clock-type water softener control units have alleviated bed regeneration when the remaining resin bed capacity the need for manually regenerating the water softener resin bed, such water softener control units are subject as determined from the actual soft water consumption is less than a reserve value calculated in accordance with ener resin bed at ?xed intervals, regeneration may actu 40 the actual soft water consumption so that regeneration occurs only when necessary, thereby achieving a sav ally be occurring too often if actual soft water consump to the disadvantage that by regenerating the water soft tion is less than the anticipated soft water consumption or not often enough when the actual soft water con sumption exceeds the anticipated soft water consump tion. Regenerating the water softener resin bed when suf?cient capacity still exists to treat an amount of water equal to, or in excess of the anticipated soft water con sumption, is wasteful of salt and the water needed in regeneration. Conversely, failure to regenerate the water softener resin bed after the resin bed capacity has diminished to a point below that required to treat the actual quantity of soft water demanded results in hard water leaving the water softener. In an effort to better regulate the frequency of water softener resin bed regeneration, demand-type water softener control units have been developed which sense the remaining capacity of the water softener resin bed to soften water. Most present day demand-type water softener control units operate to initiate regeneration of ings of regenerant and water. BRIEF SUMMARY OF THE INVENTION Brie?y, in accordance with the preferred embodi ment of the invention, I have provided a control for a water softener requiring periodic resin bed regeneration comprising a ?owmeter for detecting the quantity of softened water leaving the softener. A data input device is also provided for receiving data indicative of the capacity of the resin bed and the hardness of the incom ing water. Both the ?owmeter and the data input device are coupled to a controller which determines the aver age daily consumption of soft water from the ?owmeter data and which determines the remaining resin bed treating capacity from the ?owmeter data and the data entered through the data input device. Once the remain ing resin bed treating capacity is, the controller deter mines whether or not regeneration should occur by the water softener resin bed at an off-peak time, usually 60 comparing remaining resin bed treating capacity to a 2:00 am, if the remaining capacity ofthe water softener reserve value established by the controller in accor resin bed, as sensed by the control, is less than that dance with the actual average consumption of soft wa required to re?ne the amount of water which would ter. If the remaining resin bed treating capacity is less likely be used prior to the next regeneration interval. than the established reserve value, then regeneration is While demand-type water softener control units do initiated. achieve better regulation of water softener resin bed In accordance with another aspect of this invention, I regeneration than do mechanical clock-type water soft ener control units, the frequency at which such de have provided an improved method for controlling water softener resin bed regeneration commencing with 3 4,490,249 the steps of measuring the quantity of water leaving the 4 FIG. 2 is a side view of the control of the water softener over a given period of time and then determin ing the actual daily average quantity of soft water con sumed and the amount of soft water used since the last regeneration in accordance with the measured amounts softener illustrated in FIG. 1; FIG. 3 is a front view of the control of the water softener illustrated in FIG. 1; FIG. 4 is an electrical schematic diagram of the cir cuitry embodied in the control of the water softener illustrated in FIG. 1; and of soft water leaving the softener. Thereafter a reserve quantity of soft water is established from the calculated daily average of soft water consumption. The remaining water softener resin bed treating capacity is then calcu lated in accordance with the amount of soft water used FIG. 4a is a cut away view of the water softener of FIG. 1 taken along lines 4a—4a. FIGS. 5A through 5D illustrate, in flowchart form, since the last regeneration and the incoming water hard the program executed by the water softener control of ness. Water softener resin bed regeneration is effected the present invention during operation. when the remaining water softener resin bed treating DETAILED DESCRIPTION OF THE capacity is less than the established reserve value. PREFERRED EMBODIMENT In operation of my improved control, data from the 5 flowmeter is monitored by the microcomputer and at a Referring now to the Figures, FIG. 1 illustrates a particular time each day, as determined by the clock, resin bed-type water softener 10 which includes a tank data representing the actual amount of soft water used 12 containing a resin bed 14. As incoming hard water during the previous 24 hour period is stored in the mem enters the tank through an opening (not shown) in the ory. Typically, seven consecutive values representing 20 top thereof, the water in the tank is forced through the the actual daily soft water usage for each of the previ resin bed and out the draw pipe 16 extending through ous seven days are stored in the memory. After storing the center of the resin bed so that water exiting via the draw pipe has been treated by the resin bed to remove the soft water consumption data, the microcomputer ?rst calculates the total amount of soft water used since minerals and other impurities. The capacity of resin bed the last regeneration from the data stored in memory 25 14 to absorb the minerals and impurities of the incoming and then determines the actual average daily soft water hard water is ?nite, and depends on the treating capac used by averaging the stored data representing actual ity of the resin in the tank as measured in kilograins of soft water usage. Following calculation of the total hardness as well as the hardness of the incoming water amount of soft water used since the last regeneration, as typically measured in grains per gallon. To regener the microcomputer then calculates the remaining resin ate the resin bed, once its treating capacity has been bed capacity by subtracting the amount of resin bed depleted, the resin bed is ?ushed with a brine solution so that the minerals and other impurities can be released from the resin bed and carried out the tank. In practice, the brine solution is stored in a separate tank 18 and is capacity depleted, as determined from the total amount of soft water used since the last regeneration and the water hardness, from the total water softener resin bed capacity. Having now calculated the remaining water softener capacity this value is then compared to a re serve value established by the microcomputer as a pro 35 admitted to the softener tank 12 during regeneration portion of the determined actual average daily soft through a tube 20 and a air check valve 22. The control of brine ?ow into tank 12 from brine tank 18 as well as the control of hard water ?owing into the water usage. Typically, the reserve is calculated by multiplying the actual average daily soft water usage by tank via inlet 23a and the ?ow of soft water leaving the tank via outlet 23!) is accomplished by a valve module 1.2. If the reserve is greater than the calculated remain ing water softener capacity, then water softener regen 24 threaded on the top of tank 12 so as to be in commu nication with the tank inlet (not shown) and draw pipe 16. Valve module 24 typically comprises a control body updates the data received from the ?owmeter and waits such as manufactured by Autotrol Corporation Glen another 24 hours before repeating these calculations to 45 dale, Wis., under part No. 24N. As best illustrated in eration is initiated. Otherwise, the microcomputer only determine whether or not regeneration should occur. Furthermore, the advantage of the water softener control of the present invention can account for excep tional variations in soft water usage. If the usage during any one of the previous seven days is less than 20% of the calculated average, then that small value of soft water usage is not entered in memory as the daily usage but is added to the amount of soft water used since the previous regeneration. Also, should the previous day's, consumption exceed 200% of the average daily con sumption, then that previous day’s usage will be substi tuted as the reserve to assure that sufficient water soft ener resin bed capacity exists for the increased soft water usage. BRIEF DESCRIPTION OF THE DRAWINGS The invention, both as to organization and method of FIG. 2 valve module 24 includes seven disc-type valves 2511 through 25g, respectively. In the present valve module, valves 25e and 25f are designated as the inlet and outlet valves, respectively as the valves 25e and 25f each regulate the flow of hard water into tank 12 from inlet 23a and the ?ow of soft water up from draw pipe 16 (FIG. 1) out through to outlet 23b, respectively. Valve 25g serves to regulate the ?ow of brine from brine tank 18 into tank 12 and is therefore referred to as the brine valve. The valve 25d controls water flow in the valve module through a port (not shown) in com munication with inlet 23a and outlet 23b so that when the inlet and outlet valves are closed, water may ?ow directly through the inlet and out the outlet while value 60 25d is open. The remaining valves 25a, 25b and 250 serve to control the flow of water and brine from the tank into a drain conduit 30 (FIG. 1). During a regeneration cycle, each of valves 250 thereof may best be understood by reference to the through 25g is actuated at an appropriate interval by a following description taken in conjunction with the 65 separate one of the corresponding cams 260 through 26g operation, together with further objects and advantages accompanying drawings in which: FIG. 1 is a resin bed type water softener embodying the control of the present invention; carried on a cam shaft 28 when the cam shaft is rotated to bring the corresponding cam into contact with the valve. Cam shaft 28 is journaled at its rearend into a cam 5 4,490,249 shaft support 31 extending upwardly from the valve module. The forward (rightward) end of cam shaft 28 has a forwardly extending shank for engaging the “T” shaped slot in the rearward end of the outwardly ex tending shaft 320 of a gear 32 (FIG. 3). As best illus trated in FIG. 3, gear 32 is journaled for rotation within 6 becomes disengaged from idler gear 44 so as to allow the cam shaft to be manually rotated upon rotation of the hub. As the hub is rotated either manually, or upon the gear 32 being driven the motor 48, an arrow 55 on the hub points to indicia (not shown) on the face of cover 38 representing the various states of water soft ener operation, to indicate which step of the regenera the cavity 33 of a control housing 34. Returning to FIG. 2, control housing 34 is slidably secured to the forward tion cycle is then being executed, or, whether valves are end of the valve module 24 by a pair of support guides presently in the service position. 36 (FIGS. 1 and 2) which each engage complimentary 10 Protruding outwardly from the gear 32 is a member ?anges (not shown) on the exterior of the control hous 56 which, as the gear rotates, comes into contact with mg. What has been described thus far with respect to the the spring biased arm 57a of a leaf switch 57. Leaf switch 57 is connected to control circuit 50 in a manner construction and operation of the valve module 24 is described hereinafter. The switch is actuated either by well known in the art. member 56 as the gear is rotated or when the hub is The cavity 33 (FIG. 3) within the forward end of the simply depressed since the outward force of the mem control housing 34 is closed by a cover 38 which is secured to the forward end of the control housing by screws 39 (illustrated in FIGS. 1 and 3). Referring now ber 56 keeps the spring biased arm 57a from normally moving downwardly to actuate the switch. When to FIG. 3 which is a frontal view of control housing 34 showing portion of cover 38 cut away, cover 38 is gen erally opaque except for a window 40 which carries the indicia “PM” and “WATER FLOW". As will become switch 57 is actuated, the control circuit initiates regen eration. Thus, regeneration can be effected not only by manually rotating hub 52 but by simply depressing the hub to activate switch 57. The details of control circuit 50 are set forth schemat ically in FIG. 4. At the heart of control circuit 50 is a clear hereinafter by reference to FIG. 4, window 40 allows a display within the cavity to display certain 25 data processing unit 58 which, in the presently pre information. Immediately below window 40 is a pas ferred embodiment, takes the form of a single chip mi sageway 41 through the cover which has a spring biased crocomputer such as a model 8048 microcomputer as button 42 protruding outwardly therethrough. As will also become clear by reference to FIG. 4, button 42 is depressed to set the time displayed by the display through window 40. With a portion of cover 38 broken away in FIG. 3, it can be observed that not only is gear 32 journaled within the cavity 33, but an idler gear 44 is also jour manufactured by Intel Corp, Santa Clara, Calif. Mi crocomputer 58 includes “on-board” random access memory for storing data previously entered to the mi crocomputer or developed during the course of opera tion thereof. Also, the microcomputer includes on board read only memory in which is stored the operat ing program to be described in greater detail with re naled within cavity 33 and is in meshing engagement 35 spect to FIGS. 5A to 5D. This program controls the with gear 32. Idler gear 44 is driven by a gear 46 which operation of the internal microcomputer arithmetic is carried on the forward end of the shaft of motor 48, logic unit which performs the necessary calculations (FIG. 2); the motor being mounted on the rear of the and logic ‘determinations, to decide whether regenera control housing so that its shaft extends through the tion should be effected. In addition to the on-board control housing 34 and into the cavity to receive gear 40 memory and the arithmetic logic unit, microcomputer 46. Motor 48 of FIG. 2, which is typically a 1 RPM A.C. 58 also includes an internal timer which serves as a real cause cams 26a through 26g to actuate a corresponding whose primary winding 60a is coupled to a supply of time clock. For a further, more complete description of clock motor, is energized with alternating current by a the Model 8048 microcomputer, reference should be control circuit 50 of FIG. 4 (described hereinafter) had to the “MCS-48 User’s Manual” published by Intel when the control circuit determines, in accordance with 45 Corporation. a particular algorithm, that regeneration should be ef A 5 volt regulated dc. voltage to energize microcom fected. Motor 48, when energized from control circuit puter 58 is supplied to the microcomputer at its Vcc pin 50, drives cam shaft 28 through gears 46, 44 and 32 to by a power supply 59 comprised of a transformer 60 one of valves 250 through 25f respectively. The cams 50 110-220 volt, 50-60 Hertz a.c. supply (not shown). 26a-26f are shaped such that valves 25a through 25f Because of the lack of space within the cavity 33 for the respectively are actuated in a particular sequence for a transformer, transformer 60 is mounted to the rear of particular duration during a single revolution of the the control housing as shown in FIG. 2. The low volt cam shaft so that the backwash, brining, slow rinse, and age a.c. produced across the center tapped transformer brine re?ll and purge steps, which are normally re 55 secondary winding 60b when the primary is coupled the quired to complete resin bed regeneration, are per a.c. supply voltage, is rectified by a pair of diodes 61a formed in the desired sequence. Following a single and 6111 whose anodes are each coupled to one of oppo revolution of the cam shaft, the valves returned to the site ends of the transformer secondary winding 6011. service position so as to allow normal water flow With the diode cathodes connected together, an unreg through the softener. Although water softener resin bed regeneration is normally effected when control circuit 50 energizes ulated dc. voltage appears between the junction of the diode cathodes, hereafter referred to as the power sup ply unregulated voltage (unreg) output terminal and the motor 48, there may be instances when manual regener transformer center tap, hereinafter referred to as the ation is desired. To enable manual regeneration, gear 32 power supply common (com) terminal. has a hub 52 extending forwardly of the gear and 65 The unregulated dc. voltage present between the through an opening 54 (FIG. 1) in cover 38. Gear 32 and hub 52 are spring biased from shaft 320 so that when the hub 52 of the gear is pushed inwardly, gear 32 unregulated voltage and common terminals of power supply is ?ltered by a pair of parallel coupled capacitors 62a and 62b before being supplied to a voltage regulator 7 4,490,249 63. The 5 voltage regulated dc. voltage produced at the output of the regulator, which is designated as the “+ 5 V” output of the power supply, is ?ltered by a pair of 8 that the logic level voltage appearing across transistor 78, which is supplied to the microcomputer at pin T1 to capacitances 64a and 64b coupled in parallel between the +5 V power supply terminal and the power supply common terminal before being supplied to pin Vcc of strobe the internal timer, will be logically inverse to the logic level voltage appearing across the collector-to 5 emitter portion of transistor 73. In order for the internal microcomputer timer to keep the microcomputer. Although the regulated 5 volt dc. voltage produced by the power supply is well ?ltered, it the correct time, the timer must usually be initially set to the appropriate time. Setting of the timer is accom plished by closing a switch 79 coupled between the microcomputer pin Vcc and the power supply common 0 microcomputer timing input at pin To and the power is desirable to connect a ?lter capacitance 65 between terminal. A completed circuit between the power sup ply and the microcomputer 58 is accomplished by con necting the microcomputer ground pin Vss to the power supply common terminal. Within the microcomputer 58 is a master oscillator 5 supply common terminal input to force the voltage at the timing input to a logic low voltage level. In practice switch 79 is activated by depressing button 42 (FIG. 3) protruding through the cover 38 (FIG. 3). While switch 79 is open, the timing input is maintained at a high logic (not shown) whose periodic clock signals control the level voltage via a resistance 80 coupled between the internal microcomputer timer and arithmetic logic unit. The frequency of this oscillator is determined from the reactance appearing across the microcomputer pins XTALl, and XTAL2. In the presently preferred em pin To and the +5 V power supply terminal. Because the internal microcomputer timer counts time in accordance with the alternations of the a.c. 20 supply voltage as processed by clocking circuit 70, the bodiment, this reactance is established by a inductance microcomputer must be alerted as to whether the a.c. 66 coupled across the XTALl, and XTAL2 pins of microcomputer 58 and a pair of capacitances 68a and supply voltage frequency is 60 Hz. as is the case in the 68b each coupled between a separate one of the mi crocomputer XTALl, and XTAL2 pins and the power supply common terminal. The power supply common terminal is also coupled to the microcomputer pin EA to assure that during microcomputer operation, all memory accesses by the internal arithmetic logic unit in response to periodic timing signals from the internal United States or 50 Hz. as is the case in many European countries. To alert the microcomputer as to the a.c. supply voltage frequency, a switch 81 is coupled be tween the second highest order microcomputer data bus line (7) which terminates at pin DB7 and the power supply common terminal. After determining whether or not that bus is at a ground potential (i.e. whether or not switch 79 is closed) the microcomputer then knows master oscillator are made from the internal random whether the a.c. supply voltage is 50 or 60 Hz., respec access and read only memories of the microcomputer. The internal timer of the microcomputer, which as tively. indicated serves as a real time clock, is strobed or clocked in accordance with the alternations of the a.c. 35 supply voltage. Since the a.c. supply voltage is accu Normally, the microcomputer power is provided from power supply 59, and the timing signal for clock ing the internal timer is provided from the clocking circuit 70. However, should the a.c. supply voltage fail, then not only does the clocking circuit fail to supply custom, the frequency of alternations of the a.c. supply periodic pulses, but more importantly the internal mi voltage can be used as a basis of measuring real time. To crocomputer memories which store collected data may strobe the internal microcomputer timer, a clocking 40 be erased. To keep at least the microcomputer memo circuit 70 is provided for supplying microcomputer at ries from being erased, a battery 82 is coupled at its its T1 pin with a logic level voltage which changes positive terminal via Zener diode 84 to the standby logic states in accordance with the alternations of the voltage input pin Vdd of the microcomputer 58. The a.c. supply voltage. Clocking circuit 70 includes a diode negative terminal of the battery is coupled to the power 71 and a resistance 72 serially coupled between the one supply common terminal. While there is an a.c. voltage of the two secondary winding terminals of transformer at the input to the power supply 59, a regulated dc. 60 and the base of a ?rst transistor 73 whose collector voltage is provided to pin Vdd from the power supply to-emitter portion is coupled in series with a resistance via a diode 86. 74 between the +5 V and common terminals of power Usually the battery voltage is less than the sum of the supply 59. Transistor 73 is also coupled at its base to the break over voltage of the Zener diode 34 and the volt +5 V terminal of the power supply through a pair of age drop across diode 86 but is greater than the Zener serially coupled resistances 75a and 75b. Each time the diode break over voltage. Thus, only when the supply a.c. voltage at the secondary 60b of transformer 60 voltage fails will battery 82 render Zener diode 84 con undergoes an alternation, the transistor 73 is rendered ductive and supply voltage to the microcomputer. Note conductive. A ?lter comprised of the parallel combina that a capacitance could be substituted as an energy tion of a capacitance 76 and a resistance 77 ?lters stray storage device in place of battery 82. A capacitor 87 is noise to prevent false conduction of transistor 73. ' connected between microcomputer pin Vdd and the A second transistor 78 has its base coupled to the power supply common terminal to ?lter any noise. junction between resistance 74 and transistor 73 and Once the a.c. supply does fail, resetting of the mi transistor 78 has its collector-to-emitter portion coupled 60 crocomputer is usually necessary. A reset circuit 90 for between the junction resistances 75a and 75b and the accomplishing resetting of microcomputer upon power supply common terminal. The conduction of “power up” includes a resistance 92 and a Zener diode transistor is controlled by transistor 73 and when tran 94 coupled in series between the power supply unregu sistor 73 is conductive, transistor 73 shunts current from lated voltage output terminal and the base of a ?rst the base of transistor 78 to keep transistor 78 from con 65 transistor 96 whose collector-to-emitter portion is cou ducting. While transistor 73 is nonconductive, transistor pled in series with a resistance 98 between the power 78 is supplied with base current and becomes conduc supply unregulated voltage output terminal and the tive. In this way transistor 78 acts as a logic inverter so power supply common terminal. The base-emitter junc rately maintained either at 50 or 60 Hz depending on the 9 4,490,249 10 tion of the transistor is shunted by the parallel combina crocomputer pin P17. By counting the number of volt tion of a resistance 100 and a capacitance 102. A second transistor 104 has its base coupled to the junction between resistance 98 and transistor 96 and transistor 106 has it collector-to-emitter portion cou pled in series with resistance 108 between the mi age level transitions, the microcomputer can determine the turbine velocity which is directly related to the flow rate of water leaving the softener. A pull up resistance 119C couples the microcomputer pin P17 to the +5 V power supply terminal to prevent random noise from crocomputer reset input terminating at the RESET pin causing an erroneous ?ow measurement. and the power supply common terminal. During inter vals while a.c. is supplied to the power supply, transis Input data indicative of the total treating or softening capacity of resin bed 14 of FIG. 1 and data indicative of the hardness of the incoming water is entered into the tor 96 is rendered conductive to divert current from the base of transistor 106 to keep it from conducting, microprocessor through the low order lines (0-5) of the thereby keeping the impedance at the microcomputer microprocessor data bus terminating, at pins DB0 reset input high. However, once the ac. supply voltage fails and then is reapplied to the power supply, transis through DB5 and through the four lower order lines (20-23) of the second microprocessor port which termi nate at pins P20—P23. In practice, input data representing tor 96, which had become nonconductive once the ac. supply voltage failed, will not again become conductive until the unregulated output voltage of the power sup ply 59 reaches the threshold voltage of Zener diode 94. the total resin bed treating capacity is entered as a bi nary number by connecting the appropriate ones of data bus pins DBQ-DB5 and port pins PZO-P23 to the fourth highest line (14) of the ?rst microprocessor port termi In the meantime, with transistor 96 temporarily noncon ductive, transistor 106 becomes conductive once the 20 nating at pin P14. The existence of a connection by way power is reapplied to provide a low impedance path between the microcomputer reset input and the power of an associated one of jumpers 1200 between one of data bus pins DEG-DB5 and port pins Pz()—~P23, and port pin P14 represents a binary 1 digit while the lack of a supply common terminal to reset the microcomputer. As will become better understood by reference to connection represents a binary zero digit. The most ?ow chart FIGS. 5A-5D, microcomputer 58 is pro 25 sign?cant digit of the two digit number representing grammed to initiate water softener resin bed regenera incoming water hardness as measured in grains is also tion when the remaining resin bed treating capacity, as entered as a binary number by connecting an associated determined from the amount of water used since the one of data bus pins DBQ-DB5 and port pins PZQ-PZ} to previous regeneration and the water hardness, is less the third highest line (15) of the second microcomputer than a reserve value calculated as a percentage of the 30 port terminating at pin P15 via one of jumpers 1201). The actual average daily soft water consumption. Input data representing the flow of softened water least signi?cant digit of the two digit number represent ing the incoming water hardness is likewise entered as a leaving resin tank 12 of FIG. 1 is supplied from a flow binary number by connecting an associated one of data meter 110 (FIG. 1) disposed in the outlet 23b to the bus pins DBQ-DB5 and port pins P20—P23 to the second highest order line (17) of the ?rst of the two ports of 35 highest line (16) of the ?rst microprocessor port termi microcomputer 58 terminating at pin P17. Referring nating at pin P16 via an associated one of jumpers 1200. now to FIG. 4a, which is a cut away view of the inlet Since the incoming water hardness is entered as a two 23b taken along lines 4a——4a of FIG. 1, flowmeter 110 is digit decimal number varying between 0 and 99, only four binary bits are required to represent each digit. Therefore only the four higher order data bus pins DBz-DB5 or the four port pins P2Q-P23 need be jump comprised of a turbine 111 having a magnet 1120 em bedded in the periphery of the turbine so that the south 40 magnetic pole is facing radially outwardly. A counterweight 112b is located in the turbine pe riphery opposite magnet 112a to balance the turbine. The turbine is journaled at its rightward most end by a ?rst bearing 113a secured in a bearing strut 114 disposed in the rightward end of the outlet. Turbine 111 is jour ered to one of port pins P15 and P16 to enter the most signi?cant and least signi?cant digits of the water hard~ ness data. The remaining pins can be jumpered to cause 45 the microcomputer to execute certain self-test instruc tlons. naled at its leftward most end by a bearing 11% carried Referring to FIG. 3, each of pins BBQ-DB5 and in a bearing strut 116 that is disposed in the interior bore Phi-P16 and Flo-P23 of the microcomputer are con of a collar 117 which is dimensioned to be received in nected to a separate one of the tenninals of one of con the leftward most end of the outlet. An 0 ring 118 is 50 nector blocks 1220-1220 which are carried on the cir disposed in sealing engagement between the collar and cuit board 124 to which the components of control the outlet to prevent water leakage. As water flows circuit 50 are mounted. During water softener installa through the outlet, the force of the water drives the tion, the installer enters data indicative of the total treat turbine 111, so that the magnet passes a Hall Effect ing capacity and the incoming water hardness by con switch 119 disposed in a wall of the outlet adjacent to 55 necting the appropriate terminals of connector blocks the turbine. . 122a-122c together with one or more of the appropriate Returning now to FIG. 4, Hall Effect switch 119, jumpers 120a, 120b and 1200. which typically comprises a model UGN 3040 T. Hall Returning to FIG. 4 if the microcomputer determines Effect switch as manufactured by Sprague Electric Co., from the input ?ow meter data and the resin bed treat Concord, NH, is coupled at its input terminal I and its ground terminal G to the +5 V and common terminal of the power supply. A capacitance 119b shunts the I and G input level to filter any stray noise. When ener gized in this manner, the Hall Effect switch generates a ing capacity and water hardness input data that regener ation is required, then the microcomputer outputs a high level logical voltage on the second highest order data bus line (6) terminating at pin DB6. This voltage is supplied to the base of a transistor 124 which is also high logic level voltage at its output terminal each time 65 supplied with a regulated 5 volt dc. voltage from the the magnet of the turbine passes the switch. This volt power supply via pull up resistance 126. Transistor 124 age is supplied to the microcomputer at line 17 of the has its collector-to-emitter portion coupled in series second microcomputer port terminating at the mi with a resistance 128 between the power supply com 11 4,490,249 mon terminal and one of the light emitter input termi nals L; of an optical triac 130 whose other light emitter input L1 is coupled to the unregulated voltage output 12 puter terminating at pin P]; so as to receive a high logic level voltage therefrom at appropriate intervals during execution of the microcomputer program to energize terminal of the power supply. When transistor 124 is L.E.D. segments a, d, e and g. Segment b of L.E.D. rendered conductive by microcomputer 58, the transis display 134i: is coupled to the power supply common tor provides a completed circuit path for current to pass in the light emitter of the optical isolator 130 to render terminal via a resistance 144 in series with a collector the optical isolator conductive. Optical isolator 130, when rendered conductive, provides a completed cir cuit path between each of its input terminals I1 and 1;, which are supplied with an a.c. voltage, and one of output terminals M1 and M2, respectively, which are coupled to motor 48. Thus, when transistor 124 is ren dered conductive, the motor is energized with ac. cur rent to drive cam shaft 28 of FIGS. 1-3, thereby initiat ing resin bed regeneration. To ?lter the voltage switched by optical triac 130, a resistance 132 is coupled to-emitter portion of a transistor 146. Transistor 146 is supplied at its base with a regulated ?ve volt d.c. volt age from the power supply through a pull up resistance 148 and is also supplied in its base with the logic level output signal appearing on the third lowest line (13) of the ?rst port of the microcomputer which terminates at microcomputer pin P13. Segment 0 of LED. display 134b is switchably connected by the ?rst contactor 150A of a double pull, double throw switch 150 to resistance 144. The second contactor 15% of double pull, double throw switch 150 couples one terminal of a in series with a ?lter capacitor 134 across terminals M1 and M; of the optical triac. . resistance 152, between the decimal point segment d.p. upon depression of hub 52 and gear 32 or upon rotation of the gear. Returning to FIG. 4, switch 57 has its tor 154 to the power supply common terminal. Transis tor 154 is supplied at its base with the ?ve volt regulated contacts connected to collector and emitter of transistor d.c. output voltage of the power supply via pullup resis 124, respectively. Thus, when switch 57 is actuated, the switch shorts the collector-to-emitter portion of the transistor to energize the optical triac 130. In addition to the previously described subcircuitry tance 155 and is also supplied at its base with the logic level voltage of the second lowest order line (11) of the of the L.E.D. display 134b and segment 0 of light emit As will be recalled, a switch 57 (FIG. 3) is positioned 20 ting diode 134b. The other terminal of resistance 152 is coupled by the collector-to-emitter portion of a transis within cavity 33 so that the switch is actuated either ?rst microcomputer port terminating at microcomputer pin P11. When switch 150 is set at the “12 Hr" position so that the decimal point segment d.p. of display l34b is coupled to resistance 152 and segment c is coupled in parallel with segment b, then when transistor 154 is of the control circuit 50, the control circuit 50 also includes a display comprised of a pair of 7 segment light emitting diodes (L.E.D.’s) 134a and 134k for displaying rendered conductive as a result of a microcomputer not only the time of day as measured by the number of generating a logic high voltage at pin P11, which is the alternations of the ac supply voltage as recorded in the case during the p.m. hours of the day as determined by internal microprocessor timer, but also for providing an indication of soft water flow from the tank 12. Both of 35 the internal microcomputer timer, ‘decimal point seg ment d.p. of light emitting diode display 134b is ener L.E.D.’s display 134a and 134b are coupled to the + 5 V gized. Once energized, the decimal point segment d.p. and unregulated output voltage terminals of the power illuminates the indicia “PM" on the outer face of win supply 59. Each of the seven segments a-g of LED. dow 40 of FIG. 3 to indicate the hourly time displayed 1340 is connected via a separate one of pull up resis tances 136a through 136g, respectively, to a corre 40 by L.E.D. displays 134a and 134b is after noon. With switch 150 in the “12 Hr” position, a “l” is displayed by sponding one of the outputs 01-07 of a display driver L.E.D. display 134b when transistor 146 is rendered circuit 138 which typically comprises a model 74 LS 47 conductive by the microcomputer. This will occur display driver such as manufactured by Texas Instru when the time of day, as determined by the internal ments, Dallas, Tex. In addition to being coupled to the +5 V and common terminals of power supply 59 so as 45 microcomputer timer, is between either noon and 1:00 p.m. or midnight and 1:00 am. to receive a regulated 5 volt d.c. voltage therefrom, If, however, switch 150 is set at the “24 Hr” position display driver circuit 138 has its four input terminals so that transistor 154 now drives segment c of L.E.D. I1-I4 coupled to a separate one of the four highest lines display 134b, then, L.E.D. 134b displays a “1” when (24-27) of the second port of microcomputer 58 which terminate at microcomputer pins P24-P27, respectively. both transistor 154 and transistors 146 are rendered During execution of its internally stored program, mi crocomputer 58 outputs a four-bit binary signal at pins conductive to energize segments b and c. This will occur when the microcomputer outputs a logical high P24—P27 representing the least signi?cant digit of the level voltage at pins P13 and P11 during the interval when the time of day is between 1200 and 100 hours. hour of the day which is supplied to the display driver During the interval when the time of day, as determined 138 which in turn energizes the appropriate segments of by the internal microcomputer timer, is between 2000 L.E.D. display 1340 to display this least signi?cant digit hours and 2400 hours, then the microcomputer outputs of the hour of the day. To enable control circuit 50 of the present invention a logic high level voltage at both pins P13 and pin P12 so to be utilized both domestically and internationally, it is that segments a, d, e, and g are energized by transistor desirable that L.E.D.’s 134a and 134b display the hour 60 140 and segment b is energized by transistor 146 to display a “2” at display 134b. of the day either in a 12 hour fashion or a 24 hour fash L.E.D. 134a, like display 134b is also provided with a ion. To this end, segments a, d, e, and g of display 134b decimal point segment d.p. which is linked via a resis are each coupled to the common terminal of the power supply through resistance 139 in series with a collector tance 158 to the lowest order line (10) of the ?rst mi to-emitter portion of a transistor 140. Transistor 140 is 65 crocomputer port terminating at pin P10. During inter vals other than when regeneration is occurring that is, coupled at its base to the power supply +5 V terminal during intervals when soft water is ?owing through via a pull up resistance 141 and is coupled to the third resin bed 14 of FIG. 1 and out outlet 23b of FIG. 2, lowest order line (12) of the ?rst port of the microcom 13 4,490,249 then, microcomputer 58 outputs a logic level voltage at pin P10 which alternate between a high and low logic level to alternately energize the decimal point segment d.p. of L.E.D. display 134a. Decimal point segment d.p. of display 134b appears behind the indicia “WATER - 14 a particular code representing the switch is displayed (Step 210). DISPLAY OF TIME OF DAY-STEPS 212-222 Once the microcomputer 58 has determined that it is FLOW” on window 40 of FIG. 3 so that while water is not operating in the self test mode, the microcomputer ?owing through the softener, the decimal point seg examines the conduction state of switch 81 to determine whether or not the incoming a.c. supply to the primary of transformer 60 is at 50 or 60 hertz (Step 212). The ment d.p. of L.E.D. 134a ?ashes. As indicated previously, within the internal memory of microcomputer 58 of FIG. 4 is a program which controls the microcomputer to enable the microcom puter to process the incoming data to determine frequency of the a.c. supply voltage is important since the internal timer of microcomputer 58 is clocked in whether or not motor 48 of FIGS. 2 and 3 should be energized to initiate regeneration as well as to enable hertz, then, microcomputer 58 operates light emitting the microcomputer to display the time of day on L.E.D. displays 134a and 134b of FIG. 4. PROGRAM START UP-STEPS 200-206 Referring now to FIGS. 5A through 5C which illus trate in flow chart form the program executed by the microcomputer and in particular FIG. 5A, execution of the microcomputer program is commenced (Step 200) when power is applied to the microcomputer. Follow ing program startup, a default value for the time of day is entered into the register of the internal microcom puter timer for time keeping purposes (Step 202). Typi cally, this default value is “12 noon.” However, the default value can be incremented while switch 79 of control circuit 50 is actuated so that if the correct hour of the day is other than 12 noon, then the appropriate value can be entered into the timer register. Following entry of the default value into the timer register, seven separate memory locations of the microcomputer inter nal memory are each ?lled with a value representing } of the total re?ning capacity of resin bed 14 of FIG. 1, as measured in gallons (step 204). Since the microcom puter of the present invention operates to initiate water softener regeneration when the actual treating capacity of resin bed 14 of FIG. 1 is less than a reserve quantity calculated in accordance with the actual average daily soft water consumption, the entry of ?nite arti?cial values for the daily amount of soft water consumed in place of the value 0 enables the microcomputer to better response to the alternations of the a.c. power supply voltage. If frequency of the a.c. input voltage is 50 diode displays 134a and 1341) (FIG. 4) as a 24 hour clock (Step 214), assuming that switch 150 has been set to the “24 hour” position. In a location where the frequency of the a.c. supply voltage is 50 hertz, time is usually mea sured in 24 hour fashion rather than a 12 hour fashion. Following either a determination that the a.c. supply voltage is 60 hertz, or following the operation of the L.E.D. 134a and 134b (FIG. 4) in a 24 hour clock mode, microcomputer 58 checks to see whether or not there are any errors (Step 216), such as a failure to establish values for the total resin bed treating capacity and the incoming water hardness. Detection of an error results in a code indicative of the errors being displayed on L.E.D.’s displays 134a and 1341) (Step 218). Otherwise, if no errors are detected, then the microcomputer causes L.E.D. 134b to display the least signi?cant digit of the hour of the day (Step 220) and causes L.E.D. display 1340 to display the most signi?cant hour of the day (Step 221). TIME KEEPING AND FLOW DETECTION-STEPS 222-234 After displaying either the time of day, assuming that no errors exist, or after displaying the error code, the microcomputer then checks the one second count re corded by the internal microcomputer timer (Step 224). When the microcomputer has completed this task, that is to say that the lapse of one second has been recorded by the one second register then, the microcomputer branches to program block A and reloads the one sec regulate the frequency of water softener regeneration 45 ond register (Step 226) as indicated in FIG. 5B. Other during the ?rst week of operation. Each of the seven wise, while the microcomputer is waiting for one sec arti?cial values representing the daily consumption of ond to elapse, the microcomputer checks the flow soft water used for a particular day of the week is, how meter (Step 228) by inputting the logic level output ever, replaced with the actual value of the daily con voltage of the flow meter. The output logic level volt sumption of soft water as determined from the ?ow meter during later operation of the water softener con trol. age of the flow meter is compared to a reference level SELF TEST MODE STEPS 206-210 Following entry of each of the seven arti?cial values which initially represent the amount of soft water used for each of the seven days of a week, the microcom puter 58 then checks whether it is operating in a self test mode (Step 206). During installation as well as during intervals when the operation of microcomputer 58 is to be evaluated, the microcomputer is placed in a self test the stored reference value is indicative of the passage of water through the flow meter. In response an internal mode by jumpering certain of the microcomputer data bus pins DBO-DBS and port pins Flo-P23 to one of port pins P14, and P15. If the microcomputer is operating in the self test mode, then the microcomputer checks to see which of any of the switches connected thereto, such as switches 150 and switch 136, have been actuated (Step 208). Should a particular switch be actuated, then stored in memory (Step 230). A determination that the logic level voltage produced by the flow meter equals microcomputer counter storing a count representative of a passage of a certain quantity of water through the flow meter during a given interval is incremented (Step 232) and thereafter, the decimal point segment d.p. of light emitting diode display 1340 (FIG. 4) is energized or toggled (Step 234) to indicate water ?ow through the softener. POWER LOSS DETECTION-STEPS 236-242 Following a determination that the output logic level voltage of the flow meter has not changed states, or following toggling of the L.E.D. display decimal point segment, an internal microcomputer register designated as a “power loss" counter is incremented (step 236). 15 . 4,490,249 This register is referred to as a power loss counter be cause its count continues to be incremented during the period while the microcomputer is awaiting its internal timer to record the lapse of one second. Failure of the power loss counter to be incremented indicates failure of the internal microcomputer timer to record the pas sage of one second, thus indicating a loss of a_.c. power. By checking the count of the power loss counter, (Step 238) a power loss can be detected. If the count of the power loss counter has not been incremented, as deter mined during Step 238, a power failure has occurred and the microcomputer then blanks the display of light emitting diodes 134a and 134b of FIG. 4 (Step 240) to conserve on power. After the display has been blanked, the microcom puter checks whether the internal microcomputer timer has resumed counting (Step 242) and continues to check until the internal microcomputer timer records the pas sage of one second as will normally occur once power is reapplied to the microcomputer. Upon a determina tion that one second has elapsed, the microcomputer branches to program block A (FIG. 5B) and the one second register is reloaded (Step 226). However, after 16 Following the determination that switch 79 has been closed to set the time display by the light emitting di odes 134a and 13% of FIG. 4, the microcomputer then clears the internal microcomputer timer one second register recording the number of elapsed seconds (step 252). Thereafter the microcomputer then clears the timer ten second register recording the number of ten second intervals that have elapsed (step 254). Next, the microcomputer clears the register recording the num ber of 60 second or one minute intervals that have elapsed (step 256) before the microcomputer increments the register of the internal microcomputer timer which records the passage of hours (step 258). Upon incrementation of the hour-register of the inter nal microcomputer timer, a “?ash” ?ag is reset (step 260)'before clearing the register storing the error codes (Step 262). The purpose of the ?ash ?ag will be ex plained below. After, either the microcomputer has cleared the error code register (step 262) or after the computer has determined that the time switch 79 of FIG. 4 has not been closed (Step 248), the microcom puter determines whether the ?ash ?ag has been set (Step 264). During execution of the presently described program, an internal ?ag within the microcomputer checking the power loss counter (Step 238), if no power 25 referred to as the “?ash ?ag” is alternately set and reset loss has been detected, then the microcomputer every second. As will become clear immediately herein branches to step 222 to recheck the one second register after, the alternation of the state of the ?ash ?ag causes to determine whether or not one second has elapsed. the display of light emitting diodes 134a and 134i) to ?ash on and off during alternate seconds. A determina TIME SETTING—STEPS 244-265 tion that the ?ash ?ag was unset when checked during Referring to FIG. 5B, following completion of checking the one second register (step 224) and reload ing of the register (step 226), the microcomputer deter mines whether or not the internal microcomputer timer ten second register has counted out the passage of ten seconds (step 243) after the one second register has been reloaded. If ten seconds have not elapsed, the mi crocomputer branches to block B and determines whether or not the relay ?ag has been set (step 244) as illustrated in FIG. 5C. As will become better under stood by reference to the remaining steps of the pro gram, once the microcomputer determines that regener ation should occur, microcomputer 58 sets a relay ?ag causing a high logic voltage to appear at microcom step 264, causes the microcomputer 58 to execute a jump instruction (step 265) to branch to program block C so that step 216 is re-executed after which either the appropriate error code is displayed (Step 218) or if no error exists, then the time of day is displayed on LED 134a and 13% of FIG. 4. (Steps 220 and 221). However a determination that the ?ash ?ag is set, causes the microcomputer 58 to check to see whether another ?ag, referred to as the “alter ?ag”, has been set (Step 266). This ?ag is set each time the time of day data to be displayed by the light emitting diodes has been altered or changed as will occur when the hour of the day has changed. When the alter ?ag has been set, then the altered time of day data to be displayed, is stored in puter data bus pin DB7 in response to which, transistor 45 microcomputer memory in place of the previous time of 124 of FIG. 4 is rendered conductive to energize the day data (Step 268) and jump step 265 is then executed optical triac 130 of FIG. 4. The optical triac then ener gizes motor 48 (FIG. 2) to drive cam shaft 28 (FIGS. 1 and 2) to initiate regeneration. After regeneration is initiated by setting of the relay ?ag, the relay ?ag re mains set for ten minutes to assure that the optical triac keeps motor 48 of FIG. 2 energized. Once the motor has been energized to drive the cam shaft 28 of FIGS. 1 and so that program control branches to step 216. If the alter ?ag has not been set, then the time of day data is stored (step 270) in a section of memory other than that associ‘ ated with the data to be displayed on the light emitting diode display and data representing a blank display is moved into the memory location where the time of day 2 via gears 46, 44 and 32, the switch 57 is kept closed by the rotation of the gears to keep the motor energized data to be displayed is usually stored (step 272) before jump step 265 is executed. When data represented a blank is stored in this memory location of the mi well after the 10 minutes has clasped so that the entire crocomputer memory, and when steps 220 and 222 are regeneration cycle, which usually takes between l-2 hours will be completed. Returning to FIG. 5C, if the relay ?ag has been set, or is “on” the microcomputer makes sure that the relay 60 executed, neither of light emitting diode displays 134a and l34b are energized, so as to effectively display a blank. WATER FLOW CALCULATION AND TIME UPDATE-STEPS 274-298 set the time displayed by light emitting diodes 134a and Returning now to FIG. 5B, when the internal mi 134b of FIG. 4. Alternatively, the microcomputer crocomputer timer has in fact counted ten seconds, ‘then makes sure that after having not detected a set relay 65 the program branches to step 274 after the ten second register has counted out rather than to step 244 as was ?ag, that no ?ag was in fact set (step 250) before check described previously. Upon execution of step 274, the ing to see whether switch 79 is closed to alter the dis ?ag has been set (step 246) before determining whether or not switch 79 of FIG. 4 has been closed (step 248) to played time (step 248). micrcomputer increments the ten second register. Fol 17 4,490,249 lowing incrementationnof the ten second register, the previously stored count representing the number of transitions of the logic level of the ?owmeter output voltage is converted into gallons (Step 276) This is accomplished by multiplying the flowmeter output voltage transition count by a constant. The constant is actually a conversion factor which equals the number of thirteen, then the program executes jump instruction 299 to branch to step 244 directly without resetting of the hours register. gallons ?owing past the ?owmeter during the interval betwen each transition of the ?owmeter output voltage. The calculated amount of soft water that left the soft ener during the 10 second interval is added to the previ ously calculated daily volume of soft water already 18 or not the number of hours counted equals thirteen (step 296). A count of 13 requires that the number of hours counted by the hour register be reset to one (step 298) before the program executes jump instruction 299 to branch the to program block B to re-execute step 244. Otherwise if the count of the hour register is other than 0 DECIDE IF REGENERATION IS REQUIRED—STEPS 285-324 stored in memory (step 278) to keep an ongoing record Should the microcomputer determine during execu of the amount of soft water passing through the softener tion of step 286 that the time of day is 2:00 a.m. or such for that day. Thereafter, the microcomputer checks 5 other offhour time as designated for regeneration, then whether the ten second counter has counted out six the microcomputer proceeds to determine whether or times thus indicating the passage of a minute (step 280). not regeneration should occur by branching to block D If the ten second timer has not counted out six times, and executing the following steps illustrated in flow then the microcomputer jumps to program block B to chart form in FIG. 5D. First, the total number of gal re-execute step 244 and those following it described 20 lons used during the just elasped 24 hour period, as previously to make sure that the relay flag is set or not determined during execution of steps 260-264, are set and then to cause the time of day to be ?ashed on the added to the total number of gallons used since previous L.E.D.’s 134a and 134b of FIG. 4. regeneration (step 304). Thereafter, the average daily When, however, the ten second register of the inter amount of soft water used over the past seven days nal microcomputer timer has in fact counted out six 25 (excluding the just elapsed day) is calculated (step 306) times indicating the passage of a minute, then the mi by summing the seven separate values which each rep crocomputer checks the 60 minute register to determine resent the soft water consumption for each of the past whether or not the number of minutes that have been seven days and then dividing the total sum by seven. counted equals sixty (step 282) indicating the passage of Once the average of the daily comsumption of soft an hour. The microcomputer will execute a jump in 30 water is calculated, this average value is compared to struction (step 283) to branch to block B of the program the previous day’s total consumption (step 308). If the if an hour has not elapsed so that the microcomputer previous day’s consumption is greater than 20% of the commences re-execution of step 244. Otherwise, if the average daily consumption, then the previous day’s number of minutes counted does equal sixty, then the usage is stored in memory as the amount of water con hour register which counts the number of hours that sumed for that day causing each of the daily stored have elapsed is incremented by one (step 285). values of the water consumption to be shifted in mem Following incrementation of the hour register the ory to now represent one earlier day's usage (step 310) microcomputer then determines whether or not the before proceeding to the next step. Note that the earliest particular time of day as determined by the count of the day's usage will be erased. However, when the previous hour counter is 2:00 am. (step 286) so tthat the mi 40 day’s usage is less than 20% of the average daily con crocomputer can determine whether or not regenera sumption, then the amount of water used during the tion should occur at this off-hour. Should the time not previous day is stored to enable it to be added to the be 2:00 am, then the microcomputer checks the count total amount of water used between regenerations dur of the hour register to determine whether or not the ing the next execution of the program, but the previous count of the hour register is twelve which would indi 45 day’s consumption is not stored in memory as the cate a time of either 12:00 noon or 12:00 midnight (step amount of soft water consumed during that day so that 288). Upon a determination that the count of the hour no data shifting occurs. In this way, an unusually low counter was 12, the microcomputer then checks daily consumption of soft water is ignored to avoid a whether or not the decimal point segment d.p. of light zero average daily consumption of soft water such as emitting diode 1340 of FIG. 4 was previously energized 50 might occur during intervals of non usage such as dur (step 290). If, at the time the count of the hour register ing vacations. equals 12 the microcomputer has determined that the Following execution of step 310, or following execu decimal point segment d.p. of LED. 1340 of FIG. 4 tion of step 308 if the consumption for a given day is less was previously on, indicating that the time of day was than 20% of the average daily consumption, the mi after 11:00 pm. but before 12:00 midnight, then the crocomputer then checks whether or not the previous decimal point segment d.p. is turned off (step 292) indi day’s consumption was greater than 200% of the aver cating that the time is now after midnight and before age daily consumption (step 312). Should the previous noon. However, if the decimal point segment d.p. of the day’s consumption of soft water be 200% greater than light emitting diode 1340 had previously been off or the seven day average consumption of soft water due to de-energized before the count of the‘ hour register 60 a sudden increase in water consumption which may reached twelve, then after the hour counter has counted result from the arrival of weekend guests for example, twelve, the decimal point segment d.p. of light emitting then this previous day’s usage is stored in memory as a diode display 1340 is turned on (step 294) to indicate reserve value (step 314). This reserve value represents that the time is now post meridian rather than an the total amount of soft water likely to be consumed timeridian. 65 during the next 24 hour interval before the microcom When the microcomputer has determined that the puter will again make a determination as to whether or ' hour register has not counted twelve during step 288, not regeneration is necessary. Otherwise the reserve then, the hour register is checked to determine whether value is determined as a percentage of the calculated 19 4,490,249 20 seven day average (step 316). Typically, if the previous day’s consumption is less than 200% of the calculated total water softener resin bed treating capacity has been calculated, the quantity of water consumed since the average, the reserve calculated during step 312 is ob last regeneration is subtracted from the total water soft tained by multiplying the seven day average by 1.2. ener resin bed treating capacity (step 336) to yield a value representing the remaining water softener resin bed treating capacity. The value representing the re maining water softener capacity is then compared to the reserve value (step 338) previously calculated during either during step 314 or step 316. Following compari After the reserve is established, either during execu tion of step 314 or step 316, depending whether the previous day’s consumption was greater than or less than 200% of the calculated seven day average, respec tively, then the microcomputer checks whether or not the particular day of the week is the ?rst day following start-up after a power failure (step 318). If the day hap 0 son of the reserve value to the calculated value repre senting the remaining water softener resin bed treating capacity, the microcomputer then determines whether pens to be the ?rst day following start up after a power failure, then the microcomputer initiates regeneration or not regeneration should occur (step 340). If the re serve value as previously calculated during either step 314 or step 316 is greater than the remaining water by executing jump instruction 320 to branch to program block E so as to execute instruction 322. Step 322, when executed, causes the microcomputer to set the previ softener resin bed capacity so that it is highly improba ously described relay flag which results in the energiza ble that the water softener would be able to treat that tion of motor 48 of FIGS. 1 and 2 to initiate regenera amount of soft water likely to be consumed during the tion of the water softener. In this way regeneration next 24 hour interval, then regeneration is effected by always occurs the ?rst day after a power failure to 20 branching to step 322 to cause the relay flag to be set assure that soft water always leaves the softener which and motor 48 of FIGS. 1 and 2 to be energized. Other may not otherwise occur if a large quantity of soft water wise, the remaining water softener capacity calculated is consumed during the power failure. After the relay flag has been set, then the memory location within the internal microcomputer memory storing the data repre senting the number of gallons used since the previous regeneration is cleared (step 324). Once this memory location has been cleared, the internal microcomputer register which keeps track of the number of days be tween regeneration intervals is reset (step 326). Thereaf ter, the microcomputer executes jump instruction 328 so that microcomputer program branches to program block B to step 244 FIG. 5C which is then executed in the manner described previously. If, however, more than one day has elasped since start up of the microcomputer following a power fail— ure, then jump instruction 320 is not executed but rather the microcomputer branches to step 330 during which step the microcomputer checks to see whether the fre quency of the incoming power is 50 Hz. If the frequency during step 334 is greater than the reserve calculated during either of steps 314 or 316, and no regeneration need be effected. In this event the microcomputer exe cutes jump instruction 328 to branch to program block C and step 216. Following execution of step 216, the microcomputer then executes an appropriate sequence of steps 220-265 in the manner described previously. Execution of the above described program occurs continuously during operation of the water softener without any need for manual intervention. Once the initial input data of the water softener resin bed re?ning capacity in kilograins and the incoming water hardness as measured in grains per gallon is entered to the mi crocomputer memory, no further adjustments need be made. Even a power outage will not totally prevent execution of the internal microcomputer program con 40 trolling the water softener although it is necessary for power to be resumed in order for the control circuit 50 is 50 Hz, then the microcomputer checks to see whether to effectively control water softener regeneration. Although the control circuit of the present invention 8 days have elapsed since the last regeneration (Step 332). Should the count of a register recording the num has been described for use with a resin bed water soft ber of days since regeneration be 8 or greater, indicating that 8 or more days have elapsed since the previous regeneration, then the microcomputer will execute jump instruction 320 to branch control to program block E and instruction 322 which, when executed initiates water softener regeneration. In this way, regen eration is automatically effected every 8 days if no pre— ener, it is equally useful for controlling other types of water treatment devices having a ?lter bed requiring periodic regeneration. quired by the health laws of countries foreign to the The foregoing describes an improved control circuit for a water softener for controlling regeneration of a water softener resin bed in accordance with the actual average daily consumption so as to prevent the water softener from regenerating too often- or not often United States. When the microcomputer has determined that the power frequency is not 50 H, or if the power frequency enough. While only certain preferred features of the invention have been shown by way of illustration, many modi?ca is 50 H; but 8 days have not elapsed since the previous regeneration, then the microcomputer proceeds to exe cute step 334 to calculate the total treating capacity of tions and changes will occur to those skilled in the art. vious regenerations have occurred as is sometimes re It is, therefore, to be understood that the appended claims are intended to cover all such modi?cations and changes as will fall within the true spirit of the inven resin bed 14 in gallons. Such a calculation is accom plished by dividing the resin bed water treating capacity 60 tion. as measured in kilograins, (previously entered in the microcomputer by jumpering one or more of the mi crocomputer data bus pins BBQ-DB5 and port pins Ibo-P23 to port pin P16) by the incoming water hard ness, as measured in grains/gal, (which has previously 65 added to the microcomputer memory by jumpering one or more of the microcomputer data bus pins DBQ-DB5 and port pins P20-P23 to port pins P15 and P14). After the What is claimed is: L A control for a water treatment device having a particle bed comprising: a flow meter for measuring the amount of treated water leaving the water treatment device; a data input device for entering data indicative of the total treating capacity of the water treatment de vice; and 21 4,490,249 22 setting said treated water reserve and for dynamically a controller coupled to said flow meter and to said updating said reserve each day. 5. The water softener control according to claim 1 particle bed treating capacity in accordance with a wherein said controller further includes a display for prescribed relationship between the amount of treated water leaving the softener since the last 5 displaying the time of day. 6. The water softener control according to claim 1 regeneration and total particle bed treating capac wherein said controller includes manually activated ity, said controller setting a treated water reserve means for initiating regeneration. representing the anticipated treated water usage 7. A control for a water softener having a particle bed and dynamically updating said reserve value each comprising day, and said control initiating regeneration at a set a flow meter for measuring the amount of treated data input device for determining the remaining time each day if said treated water reserve exceeds wherein said controller sets said treated water reserve water leaving the water treatment device; a data input device for entering data indicative of the total treating capacity of the water treatment de— vice; and in accordance with the number of days since the previ a controller coupled to said flow meter and to said said remaining particle bed treating capacity. 2. The water softener control according to claim 1 data input device, said controller establishing a ous regeneration. 3. The water softener control according to claim 1 treated water reserve in accordance with the num ber of days since the previous regeneration and dynamically updating said reserve value each day, and said controller initiating regeneration of the wherein said controller sets said treated reserve as a proportion of the average amount of water anticipated to be used each day. 4. The water softener control according to claim 1 wherein said controller includes a microcomputer for particle bed if the treated water reserve exceeds the remaining treating capacity of the particle bed. i 25 30 35 45 50 55 65 i it i i!