This article introduced with the PIC16C57 monolithic integrated circuit design’s one kind of multi-purpose hot water controller, has automatic and the manual watering, the establishment water temperature, the real time display water volume and the temperature and the warning function, and has the structure to be simple, the reliability is high, cost low status characteristic.
Key word: PIC monolithic integrated circuit; DS1820 digit temperature sensor; Hot water controller
Introduction
In the current market’s hot water controller basically uses the bimetal piece to control warm, controls the warm precision to be low, the reliability is bad, the function is unitary. Along with microelectronic technology’s development, the monolithic microprocessor function strengthens day by day, the low in price, obtains the widespread application in various aspects. Applies the monolithic integrated circuit in the hot water controller, has the design to be simple, the reliability is high, the function easy to expand and so on merits.
The hot water controller mainly realizes to the water temperature the control, and satisfies the different user the individuality demand. Therefore a perfect controller should have the following function:
Water temperature survey and demonstration;
Water volume survey and demonstration;
The user hypothesis function (for example water temperature hypothesis, fixed time establishes and so on);
To electric heating tube’s control function;
Some functional keys (for example fixed time automatically add water, constant temperature control, manual watering, manual heating and so on).
The security measure (leakage examination, security expires protection, limits warm protection and so on).
![]() |
Figure 1 entire distribution chart
![]() |
2(a) basic temperature water temperature metering circuit
![]() |
Figure 2 (b) basic demonstration circuit diagram chart
![]() |
Figure 2(c) dam preheater pipe control circuit
Hardware circuit design
According to the hot water controller’s function request, and unifies to the PIC16C5X series monolithic integrated circuit’s resource analysis, uses this series mainstream model PIC16C57 to take circuitry’s control core. Electricity hot water controller’s entire distribution as shown in Figure 1.
Basic hardware circuit diagram as shown in Figure 2(a)~(c). In this system, RA0~RA3 uses in the code demonstration, the RB6 control dam switch, the RB7 control electric heating tube, RC3~RC5 uses in the pressed key design and the read water volume, RC0~RC2 uses in with the DS1820 correspondence carrying on the water temperature survey, RB0~RB1 the code carries on the scanning to, RB2~RB5 the LED indicating lamp demonstrated that the RC6 leakage examination, the RC7 control speaker uses in reporting to the police and the instruction.
Water temperature metering circuit
The temperature element uses DALLAS single track digit temperature sensor DS1820. DS1820 provides nine temperature readings, the measuring range - 55℃~125℃, uses the unique 1-WIRE main line agreement, only needs a mouth line namely to realize with the MCU bidirectional communication, has the connection to be simple, high accuracy, characteristics and so on redundant reliability. When work, provides the power source through the main line to it, the monolithic integrated circuit sends out the instruction-code read temperature value.
Keyboard and water volume metering circuit
Because in this system, only requests to demonstrate four files positions the water volume value, what therefore the water volume sensor uses is the switch type sensor, when the water volume achieves some grade will pull the low this grade of levels, the interface circuit and the pressed key presses down similarly. Therefore in the circuit design, connects the water volume files position signal and the pressed key through a piece of 74HC148 first encoder on monolithic integrated circuit’s I/O mouth. Pressed key’s priority is higher than the water volume signal, the water volume upscale position signal priority is higher than the low-grade position signal, guaranteed that can first respond the pressed key.
Display circuit
The temperature uses two code demonstration, the demonstration scope 0℃~99℃. The water volume uses to demonstrate that demonstrates 1, 2, 3, 4, four grades of water levels. Carry on the scan round demonstration to the temperature and the water volume. Four LED uses in the current pressed key function hypothesis.
Water temperature and water volume control circuit
The monolithic integrated circuit carries on the control through the electro-optical coupled pair relay, uses for to shut off either the connection preheater pipe power source, the closure or turns on the water valve, thus achieves the adding water temperate water volume the control.
Leakage examination and alarm circuit
As a result of water heater work in moist situation, must therefore have the leakage examination and the warning function. Leakage examination by leakage examination coil output after the reshaping inputs to the RC6 mouth, electric circuit schematic diagram as shown in Figure 3(a). When leaks the electric current surpasses certain threshold value, the comparator outputs the low level, otherwise maintains the high level, produces as shown in Figure through a monostable trigger electric circuit 3(b) the profile again, the low level maintains time t may carry on the adjustment hypothesis by the monostable trigger. In this system t is 10ms, as a result of PIC16C57 look-at-me function, therefore in the procedure must (be smaller than once in a while 10ms) carries on the inquiry to the RC6 mouth, examines whether to leak, once examines RC6 changes low, the process confirmed, shuts off the preheater pipe electric current, simultaneously carries on the warning. The alarm circuit also when the sensor presents the breakdown, the excess temperature reports to the police the prompt.
PIC16C57 itself has the watch-dog timer, when the system appears exceptionally, can carry on the power failure protection and the system reset automatically.
![]() |
Figure 3(a) electric circuit schematic diagram
![]() |
Figure 3(b) oscillogram
![]() |
Figure 4 system flow chart
![]() |
Figure 5 RTCC schematic diagram
System software design
The system software uses the PIC16C5X simplification instruction compilation. As a result of PIC16C57 look-at-me function, therefore in this system the keyboard scanning, the leakage examination small steelyard procedure realizes through the inquiry, and uses 4MHz the clock rate, has carried on the precise computation and the design to the instruction running time, guarantees software’s reliability and the stability. System master routine diagram as shown in Figure 4, this article discusses the keyboard to demonstrate and the water temperature surveys two modules.
Keyboard and demonstration
In this system, has four function pressed keys: Fixed time watering, constant temperature control, manual watering and manual heating; Three code demonstration and four LED lamp instruction.
a) presses down when fixed time adds water the button, fixed time LED changes bright, and take current time as fixed time time indice, every 24 hour automatic watering to hypothesis water volume; If long surpasses for 5 seconds according to this Niu, fixed time LED extinguishes, and hears “honk” one to carry on the water volume hypothesis, hereafter presses every time Niu, the water volume demonstrated that adds a grade, 1~4 grades of circulations demonstrated that does not surpass according to this Niu for 5 seconds, heard “honk” one once more, the water volume hypothesis finishes. System’s function fixed time mainly completes through the software. PIC16C5X inner tube 8 timer/counter RTCC, when carried on 24 hours fixed time added water has used this timer, RTCC and related electric circuit as shown in Figure 5.
May know by Figure 5, RTCC active status by OPTION register control, OPTION register’s RTS position uses for to choose RTCC the counting supply oscillator, when RTS is “1″, the supply oscillator to come from the RTCC pin the external signal, when RTS is “0″, supply oscillator for internal clock. OPTION register’s PSA position controls the pre-frequency divider assignment object, when PSA is “1″, assigns gives RTCC, after namely exterior or the internal signal passes through the pre-frequency divider frequency division, outputs again gives RTCC. Pre-frequency divider’s frequency division ratio by OPTION in PS0~PS2 decision. The OPTION RTE position uses in choosing the exterior counter impulse triggering along, when RTE is ” 1 ” drops along triggering, “0 “when for rise along triggering. The RTCC counter uses the increasing way counting, when counts to FFH, after the next counting occurs, the automatic return-to-zero, makes a fresh start to count, gets down by this circulation. In the actual design, the OPTION register is “00100111 “, namely timer’s supply oscillator from the RTCC pin’s external signal, the pre-frequency divider’s frequency division ratio is 1:256, rises along triggering. The RTCC pin signal’s input frequency is 1kHz, therefore RTCC counting to FFH time needs 65536ms. General register F0EH, F0FH serve as fixed time temporarily store.
When establishes fixed time adds water the function, initialization RTCC, OPTION, F0EH, F0FH, start to carry on fixed time, every other 256ms inquire a time RTCC value, RTCC every time circulate one time, F0EH-F0FH increases 1, when increases to 1318, 24 hours fixed time, the register repositions, automatic watering.
b) presses down the constant temperature to control Niu, constant temperature LED changes bright, indicated that carries on the constant temperature control, presses LED to extinguish again, cancels the constant temperature control. Is similar with the water volume hypothesis, long, carries on the temperature hypothesis.
c) presses down when manual heats up Niu, heats up LED changes bright, heats up to 65℃, if the water volume is short in 1 grade, then adds water first to 1 grade, then presses one time to cancel the heating.
d) presses down when manual adds water Niu, adds water to the hypothesis water volume value, long according to may establish the water volume. In the manual watering process, presses down once more cancels the watering.
In normal condition, two code demonstration current water temperature, another demonstration current water level.
Water temperature survey
The temperature read is through the correspondence completes with DS1820. The DS1820 correspondence function is time sharing completes, it has the strict time slot concept. Must therefore carry on systematically to DS1820 each kind of operation according to the agreement. The operation agreement is: Initialization DS1820 (sends reset pulse -> to send ROM function order -> to send memory operational order -> processing data). Each operation succession chart like chart 6 and shown in Figure 7.
In this procedure needs the operational order is as follows:
SKIPROM orders (CCH): After this order execution, indicated that the later memory operational order will aim at online all DS1820, because in this system only then piece of DS1820, therefore after issuing this order, may carry on the operation to it.
CONVERT order code [44H]: Starts online DS1280 to carry on the temperature A/D transformation.
READSCRATCHPAD order code [BEH]: Read temperature register’s temperature value.
To DS1820 operation’s overall flow chart as shown in Figure 8.
Other function procedure
The leakage examination, the data processing, fixed time counted and so on other function procedure according to the program run time to carry on the overall plan design, no longer carried on the specification in this.
![]() |
Figure 6 read-write succession chart
![]() |
Figure 7 initialization succession
![]() |
Figure 8 DS1820 operation flow chart
Conclusion
The electric boiler monolithic integrated circuit controller has novel, moderately-priced, safe, practical and so on merits, and has obtained the success application on the domestically produced electric boiler. This article some methods are also suitable for the refrigerator, the air conditioning and so on domestic electric appliances’ computer control design.










