Refrigerator thermostat system based on STC89C516RD single chip microcomputer

As the requirements for energy saving, environmental protection and comfort of refrigerators continue to increase, more and more intelligent control technologies are introduced into refrigerators. Embedded smart home appliances (referred to as smart home appliances). This kind of household appliance has a friendly and convenient human-machine interface. The single-chip computer controls the basic functions of the household appliance, and also simulates the intelligent activity process of the person. In the control process, the necessary processing is carried out according to various intelligent activities, which greatly improves the quality and performance of the household appliances, produces more excellent control effects, and also enables people to obtain more desirable services.

1 system structure

The system uses the STC89C516RD microcontroller as the control core, and is powered by a 220 V power supply. The current time and the refrigerating compartment, freezer compartment and outdoor temperature collected by the temperature sensor are displayed through the liquid crystal. The time and temperature values ​​of each room can be set by buttons. Due to the integrated infrared remote control function, the user can remotely set the time and temperature of each room through the remote control. The system structure block diagram is shown in Figure 1.


2 system hardware implementation

2.1 Power Module

In the design of the power module, the 220 V AC voltage is stepped down through a 9 V transformer, and then passed through a rectifier bridge circuit to obtain a DC voltage of 12 V after rectification. Since the system requires less power, only 5 V is required. So, use a 7805 regulator to generate a +5 V voltage for the microcontroller and LCD. The power supply circuit is shown in Figure 2.


2.2 Temperature Acquisition Module

The DS18B20 temperature sensor is used to complete the temperature acquisition. The DS18B20 is a one-line digital temperature sensor manufactured by Dallas. It is a new generation of intelligent digital temperature sensor with microprocessor. It integrates temperature sensing, signal conversion and A/D conversion on one chip and is packaged in TO-92. Its temperature measurement range is -55 ~ +125 ° C, programmable 9 to 12-bit conversion accuracy, temperature resolution up to 0.062 5 ° C. The system uses three DS18B20 to separately collect the temperature of the refrigerator, the temperature of the freezer and the room temperature.

2.3 button control module

The keyboard control circuit is composed of four independent buttons connected with the I/O of the single chip microcomputer. It is used to switch the liquid crystal display interface and adjust various parameter values. The key function and the corresponding relationship with the I/O port are as follows:

[ON/OFF] Temperature, time switch button - (P13)

[Mode] selection button - (P12)

[—] Temperature or time minus 1—(P11)

[+] Temperature or time plus 1 - (P10)

2.4 Wireless Control Module

The chipset PT2262-IR and PT2272 are used for encoding and decoding. The PT2262-IR and the infrared transmitting tube form a wireless transmitting part, and emit a 38 kHz modulated signal with button information. The PT2272 and the 38 kHz wireless receiving module LT0038 form a wireless receiving section. The module implements wireless remote control of the switch by transmitting and receiving radio waves. The circuit is easy to implement and cost-effective. The circuits and parameters involved have been tested. The device has small size, low power consumption and low cost. The remote control distance can reach more than 10 m.

2.5 compressor control module

The compressor drive circuit is mainly realized by the control of the relay by the single chip microcomputer. A relay is an "automatic switch" that uses a small current to control a large current, so it plays an automatic adjustment, safety protection, and conversion circuit in the circuit. Since the single-chip microcomputer needs to directly control the compressor, the single-chip microcomputer is powered by +5 V, and the compressor is powered by 220 V voltage, so the relay must be used as an isolation circuit to separate the high and low voltages. The P1.6 port is used to control the relay, which indirectly plays the role of controlling the compressor switch.

2.6 LCD module

Select OCM12864 liquid crystal display, data input/output port 7~14 of OCM12864 liquid crystal display module is connected with P0 port of single chip microcomputer to transmit data or command; read/write selection pin is connected with P2.1, read data when high level, Write data at low level; data/instruction select pin is connected to P2.0. When high level, the data of P0 port is sent to display RAM. When low level, the data of P0 port is sent to the instruction register for execution; The signal terminal E is connected to P2.2, active high, and the falling edge locks the data. The reset signal is connected to P2.5 and is active low. The chip select signal CS1 is connected to P2.3 and is active high. The chip select signal CS2 is connected to P2.4 and is active high. The LCD driving voltage is V0. When applying, add a 10 kΩ adjustable resistor between the LCD driving power supply and the +5 V positive power supply VDD. By adjusting the resistance, the brightness contrast of the LCD display can be changed.

3 system software implementation

The whole software part is written by C51 language, which mainly includes the following four sub-program modules: temperature acquisition module, clock module, liquid crystal display module and keyboard control module. Each subroutine module is separately programmed and debugged, and then each subroutine module is jointly debugged, and finally the program is programmed to be run offline to the ROM of the single chip microcomputer. The main program flow chart is shown in Figure 3.


4 debugging simulation and conclusion

After debugging the simulation, the program is loaded onto the hardware circuit board to run at full speed. The initial interface displays the current date and time. The date and time can be adjusted by pressing the button. When the mode switch key is pressed, the display interface switches to the temperature display mode, and the temperatures of the refrigerator compartment, the freezer compartment, and the outdoor are displayed on the interface. The temperature value can be set by pressing the button. When the actual temperature is greater than the set temperature, the MCU will start the compressor to lower the temperature. At this time, the LED will emit light, indicating that the compressor is working until the actual temperature is equal to the set temperature and the compressor stops working.



references:

[1]. DS18B20 datasheet http://
[2]. TO-92 datasheet http://
[3]. P13 datasheet http://
[4]. P12 datasheet http://
[5]. P11 datasheet http://
[6]. P10 datasheet http://
[7]. PT2272 datasheet http://
[8]. LT0038 datasheet http://
[9]. ROM datasheet http://


:
1 time
Window._bd_share_config = { "common": { "bdSnsKey": {}, "bdText": "", "bdMini": "2", "bdMiniList": false, "bdPic": "", "bdStyle": " 0", "bdSize": "24" }, "share": {}, "image": { "viewList": ["qzone", "tsina", "tqq", "renren", "weixin"], "viewText": "Share to:", "viewSize": "16" }, "selectShare": { "bdContainerClass": null, "bdSelectMiniList": ["qzone", "tsina", "tqq", "renren" , "weixin"] } }; with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share. Baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];

Solar Power

Easy Electronic Technology Co.,Ltd , https://www.pcelectronicgroup.com

This entry was posted in on