A new intelligent refrigerator thermostat based on STC89C516RD microcontroller

Publisher:程序界的行者Latest update time:2013-02-06 Source: dzscKeywords:STC89C516RD Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    As the requirements for refrigerators in terms of energy saving, environmental protection, and comfort continue to increase, more and more intelligent control technologies are introduced into refrigerators. Embedded intelligent home appliances are also referred to as intelligent home appliances. In this type of home appliance, the human-machine interface is friendly and convenient. The basic functions of the home appliance are controlled by a single-chip microcomputer, while also simulating the process of human intelligent activities. In the control process, various intelligent activities are combined for necessary processing, which greatly improves the quality and performance of home appliances, produces better control effects, and enables people to get more ideal services.

1 System Structure
    The system uses STC89C516RD microcontroller as the control core and is powered by 220 V power supply. It displays the current time and the temperature of the refrigerator, freezer and outdoor room collected by the temperature sensor through the LCD. The time and the temperature of each room can be set by buttons. Since the system integrates infrared remote control function, users can also remotely set the time and temperature of each room through the remote control. The system structure block diagram is shown in Figure 1.

a.JPG

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 rectified through a rectifier bridge circuit to obtain a 12 V DC voltage. Since the system does not require high power supply and only needs 5 V, a 7805 voltage regulator is used to generate a +5 V voltage for the microcontroller and LCD. The power circuit is shown in Figure 2.

2.2 The temperature acquisition module
    uses DS18B20 temperature sensor to complete temperature acquisition. DS18B20 is a one-line digital temperature sensor produced by Dallas Company. It belongs to the new generation of intelligent digital temperature sensor adapted to microprocessors. It integrates temperature sensing, signal conversion, and A/D conversion on one chip. It uses TO-92 package. Its temperature measurement range is -55~+125℃, and it can be programmed to 9~12-bit conversion accuracy. The temperature measurement resolution can reach 0.0625℃. This system uses three DS18B20 to collect the temperature of the refrigerator, freezer and room temperature respectively. [page]
2.3 Key control module The
    keyboard control circuit is composed of 4 independent keys connected to the I/O of the single-chip computer, which are used to switch the LCD display interface and adjust the parameter values. The key functions and the corresponding relationship with the I/O port are as follows:
    [ON/OFF] Temperature, time switching key - (P13)
    [Mode] selection key - (P12)
    [-] Temperature or time minus 1 - (P11)
    [+] Temperature or time plus 1 - (P10)
2.4 The wireless control module
    uses the chipset PT2262-IR and PT2272 for encoding and decoding. PT2262-IR and infrared transmitting tube constitute the wireless transmitting part, which transmits 38 kHz modulated signals with key information. PT2272 and 38 kHz wireless receiving module LT0038 constitute the wireless receiving part. The module realizes wireless remote control of the switch by transmitting and receiving radio waves. The circuit is easy to implement and has high cost performance. The circuits and parameters involved have been tested. The device has small size, low power consumption, low cost, and 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. The relay is an "automatic switch" that uses a smaller current to control a larger current, so it plays the role of automatic adjustment, safety protection, and conversion circuit in the circuit. Since the compressor needs to be directly controlled by a single chip microcomputer, the single chip microcomputer is powered by +5 V, and the compressor is powered by 220 V voltage, so a relay must be used as an isolation circuit to separate the high and low voltages. Use the P1.6 port to control the relay, thereby indirectly controlling the compressor switch.
2.6 LCD module
    selects OCM12864 LCD. The data input/output port 7 to 14 of the OCM12864 LCD module is connected to the P0 port of the single-chip computer for transmitting data or instructions. The read/write selection pin is connected to P2.1. When the level is high, the data is read, and when the level is low, the data is written. The data/instruction selection pin is connected to P2.0. When the level is high, the data of the P0 port is sent to the display RAM, and when the level is low, the data of the P0 port is sent to the instruction register for execution. The read/write enable signal terminal E is connected to P2.2. The high level is valid, and the falling edge locks the data. The reset signal is connected to P2.5, and the low level is valid. The chip select signal CS1 is connected to P2.3, and the high level is valid. The chip select signal CS2 is connected to P2.4, and the high level is valid. The LCD drive voltage is V0. When applied, a 10 kΩ adjustable resistor is added between the LCD drive power supply and the +5 V positive power supply VDD. By adjusting the resistor, the brightness and darkness contrast of the LCD display can be changed.

3 System Software Implementation
    The entire software part is written in C51 language, mainly including the following 4 subroutine modules: temperature acquisition module, clock module, LCD display module, keyboard control module. Each subroutine module is written and debugged separately, and then each subroutine module is debugged jointly, and finally the program is burned into the ROM of the microcontroller and run offline. The main program flow chart is shown in Figure 3.

b.JPG

4 Debugging simulation and conclusion
    After debugging simulation, the program is loaded onto the hardware circuit board and runs at full speed. The initial interface displays the current date and time, which can be adjusted by pressing the buttons. After pressing the mode switch button, the display interface switches to the temperature display mode, and the temperature of the refrigerator, freezer and outdoor is displayed on the interface. The temperature value can be set by pressing the buttons. When the actual temperature is greater than the set temperature, the microcontroller will start the compressor to lower the temperature. At this time, the LED lights up, indicating that the compressor is working, until the actual temperature is equal to the set temperature, the compressor stops working.

Keywords:STC89C516RD Reference address:A new intelligent refrigerator thermostat based on STC89C516RD microcontroller

Previous article:Learn 51 MCU with me (VI): MCU external interrupt and infrared remote control decoding
Next article:Design of a wireless calling system based on single chip microcomputer

Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号