1、附录 3 The Controller of the Domestic Electric Water-Heater 1.The perspectives of appliance Water-heater is a kind of domestic electric appliance which can be used in bathroom, wash room and kitchen. The types of water-heater available in the market at present includes: electric water-heater, solar wa
2、ter-heater, gas water-heater. To be specifically in China, the use of solar water-heater is limited by the weather and the scope for use is narrow while gas water-hater is fueled by petrol and gas, the supply of which will be difficult to meet the increasing demands and bad for environment. So the e
3、lectric water-heater has become more and more popular among customers. According to statistics from Chinese commercial federation not long ago, the market share of electric water-heater in sales volume and sales revenue has surpassed the gas water-heater which keeps ahead for along time. It is predi
4、cted by this federation that driven by the larger-scale reconstructing of the electric network in the city and the extensive startup of the housing market in the city, the market for electric water-heater will present the strong growth tendency in the next few years. 2. The Goal for Design There are
5、 two kinds of electric water-heaters available in the market at present: the continual fluent type and water storage type. Considering the special demand of the moist working conditions on single chip, we adopt the newly promoted MC68HC08 single chip by Motorola to be the control center. With its hi
6、gh resistance to interference, steady working, flash memory and so on, this single chip can satisfy the demand of the electric water-heater with high performance. Also considering the fierce competition in domestic appliances industry, we will realize these functions by using components as simple as
7、 possible to reduce the cost. We will make full use of the internal and outer functions to enhance the performance-to-price ratio. With few improvements, it can be produced massively with low cost in practice. 3. The LZC-CI Hardware Design 3.1 Technology Standards and Characteristics The main functi
8、on of the controller is to control the temperature. Besides that, it has to realize the following functions: To display the real-time temperature of water, the range is 099 . To set the temperature of water arbitrarily within 2080 . Have the function of appointment which enables 24 hour turning on s
9、etting willfully. Have LTD to display real-time temperature digitally. When setting, the temperature and the time set will be displayed by flicker and the controller will have instructions of appointment, heat preservation and heating. Able to look over and revise the time of system. Equipped with r
10、emote controller, the control will be easy and simple. Cut the power swiftly when temperature is too high and alarm. When electricity leaks, cut the power swiftly and propose alarming. When the power is cut, the data set can be preserved. 3.2 The Structure of the System The system consists of two ma
11、in parts: the main controller of water-heater and the remote controller, realized by two pieces of 68hc908gr8 respectively. 3.2.1 The Power Supply and the Clock Circuit The power circuit consists of the transformation bridge, the rectification bridge, the filter resistance, the pressure sensitive re
12、sistance and integration voltage-stabilizer circuit MC7812T and MC7805T, which can provide +5V and the +12V power source for the controller. OutsideOSC1 and OSC2, 8 kHz crystal oscillator is connected with the circuit. 3.2.2 The Keyboard The function of controlling and the enactment of parameters ar
13、e realized by the pressing the keys. The two keys of the systems main controller complete directly the functions of heating and the inquiring of the water level, using the keyboard severance pattern and PTA2, PTA3 as the input entrance of the pressing. The keyboard of the remote controller is design
14、ed into matrix type. The pressing of the keys will initiate the keyboard severance, by scanning from line to line; the number of the key can be judged and then sent to the register for preservation and the delivering. The main procedure will deal with it in the keyboard procedure after receiving the
15、 number of the key. Since there will be vibration at the moment of turning on and off, the design uses software time delay to eliminate the vibration. 3.2.3 The Display Circuit Considering that the working environment is humid, the main controller takes LED Nixie tube to display. It takes the main w
16、ay of SPI to expand two piece of 74LS164 as the output orifice of the static demonstration of the seven-segment display. When there is no pressing, the main controller will display the current temperature of water and the remote controller will display the current time; when setting or inquiring, th
17、e remote controller and main controller will flash to display the information set or inquired while when stopping pressing, the display will automatically back to normal. 3.2.4 The Real-time Temperature of Water and the Circuit of Water-Level Detecting The thermistor will transmit the temperature in
18、formation into the voltage information and then will be input into CPU by the PTB0 A/D transformation module. After checking, the real-time temperature will be deduced. The circuit of water-level detecting consists of the parallel connection of three resistances with different resistance value. The
19、electricity of the electrode is small (only several microamperes), thus the erosion is little which suits the wide range variety of the resistance of water(10K 一 100K O). When the water of level of certain resistance doesnt arrive where the resistance is, the resistance will not work; when the water
20、-level arrives, the three resistances are linked into parallel connection. The information of water-level can be judged by transforming voltages from different resistances through PTB1 (high, middle, low and burning). 3.2.5 The Detecting of Electricity Leaking and Alarming Circuit Since the working
21、environment of water-heater is humid, the controller should be able to detect the electricity leaking to ensure the safety of the user. Under normal circumstance, the electric current passing the magnetic circle is the same but with opposite directions. The magnetic detecting circle wouldnt sense an
22、y signal of electric current and the integrated circuit of electricity leaking detecting will output low electric level. When the electric current leaks, the electric current passing the magnetic circle is lopsided. The detecting circuit will detect the signal of electricity leaking and magnify the
23、electric level output through the integrated circuit M54123L and then will be output into CPU after inverting by audion. Receiving the signal of electricity leaking, the CPU will stop heating and preservation and the operation of keyboards, ends the operation and sends alarming signal. The electrici
24、ty light will flicker to warn and the buzzer will buzz continuously. Generally speaking, CPU will send out a reliable pulse for leaking protection every 10ms to replace the ordinary detecting switch and control the connection of crystal tube. So the electric current passing the magnetic circle is la
25、rger than 10 MA, which will be detected by the detecting magnetic circle as stimulant signal for leaking, magnified by M54123L and inverted by audion and then output to CPU.CPU will judge whether the detection is eligible. If there is signal, the detection is eligible and can go on working; if there
26、 is no signal, the detection is not eligible and heating, preservation and keyboard operations will stop automatically. CPU will end whole operations and send out alarm. The light for power will flicker to warn and the buzzer will buzz continuously to ensure the safe use of the electric water-heater
27、. When the leaking detection protection and detection are not eligible, we have to turn off the power, obviate the obstacles, switch on again and then the water-heater will work. 3.2.6 The Protection Circuit When Heating and Relay Are Out of Control Under normal working conditions, the two repays ca
28、n carry on double-pole separation of power to ensure that when heating stops, the heating system is completely isolated from the electricity outside. It is almost impossible for two relay to have a screw loose simultaneously, however, during the normal life of electric water-heater, it is possible t
29、hat one relay will have a screw loose. If it is not dealt with in time, the other relay will possibly have the same problem later which may result real danger. So the key to solve this problem is that the system can detect as soon as one relay has problems and can relay on the other normal relay to
30、carry on the protection measures of the system and detect the sticking and disconnection of the two relays. 3.2.7 The Remote Controller The remote controller utilizes simple controlling circuit which doesnt decrease the functions. Some hardware circuits will be realized by software and the interfere
31、nce resisting has been considered. Since the supply for buttery has to save energy, the remote controller uses the low-consumption model. When the system is not working, it stops. When it begins working, one has to use the keyboard signal to end the low-consumption model and turn into normal (press
32、the key to evoke the system). The low voltage resetting can be achieved by MC34064. The keyboard is designed into matrix type with two lines and has connected by PTA0PTA3 orifice. When set for keyboard, the pressing of keyboard will result to the stopping, making the system back to normal. The cryst
33、al oscillator is 6MHZ. The infrared signal output uses the software encoding method. The software of the main controller will decode. In order to reduce cost, LCD display is used. 4543 drive and decoding used for driving. 4. The Software Design The whole programs consist of the main program, service
34、 intermitting program and numerous subprogram of functional model. Among them, the main program includes the transmitting subprogram (the level and temperature of water), subprogram of keyboard dealing and displaying, subprogram of heating controlling (the function of output comparison is used), sub
35、program of infrared signal receiving, the subprogram of leaking and burning protection, subprogram of calendric clock of the TBM module, subprogram of data-preserving, subprogram for delaying, etc. The intermitting includes time intermitting, keyboard inputting intermitting, TIM inputting intermitting, TBM module intermitting, etc. The programs of remote includes