Central topic
* Design of a new refrigerator thermostat system based on STC89C516RD microcontroller
Solutions
*Using STC89C516RD MCU as the control core
*Displaying the current time and the temperature of the refrigerator, freezer and outdoor room collected by the temperature sensor through the LCD
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 a 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.
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 tube is used to generate a +5 V voltage for the microcontroller and LCD display. The power circuit is shown in Figure 2.
2.2 Temperature acquisition module
The DS18B20 temperature sensor is used to complete the temperature collection. DS18B20 is a one-line digital temperature sensor produced by Dallas. 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 a single 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 DS18B20s to collect the temperature of the refrigerator, freezer, and room temperature respectively.
2.3 Button control module
The keyboard control circuit is composed of 4 independent buttons connected to the I/O of the microcontroller, which are used to switch the LCD display interface and adjust various parameter values. The button functions and their corresponding relationships with the I/O ports are as follows:
【ON/OFF】Temperature, time switch key——(P13)
[Mode] selection key——(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. PT2262-IR and infrared transmitting tube constitute the wireless transmitting part, which transmits 38 kHz modulated signal 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 display module
Select OCM12864 LCD display. The data input/output port 7 to 14 pins of the OCM12864 LCD display module are connected to the P0 port of the microcontroller to transmit 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 effective and the falling edge locks the data. The reset signal is connected to P2.5, which is effective at a low level. The chip select signal CS1 is connected to P2.3, which is effective at a high level. The chip select signal CS2 is connected to P2.4, which is effective at a high level. 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 degree of brightness and darkness of the LCD display can be changed.
3 System Software Implementation
The entire software is written in C51 language and mainly includes the following four subroutine modules: temperature acquisition module, clock module, LCD display module, and keyboard control module. Each subroutine module is written and debugged separately, and then each subroutine module is debugged together, 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.
4 Debugging Simulation and Conclusion
After debugging and simulating, 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.
Previous article:Microcontroller C51 programming specifications
Next article:Some interesting features of Keil C51
Recommended ReadingLatest update time:2026-04-15 06:55
- Popular Resources
- Popular amplifiers
- Have you encountered any issues related to SPI driving of automotive color screens using Microchip's M0 core microcontroller?
- Causes and Software Solutions for STM32G030 GPIO External Interrupt Errors
- Microchip introduces the SAM9X75, a hybrid microcontroller in an automotive-grade system-in-package (SiP) architecture.
- From Control to System: TI Reshapes the Boundaries of Embedded MCUs with Edge AI
- UWB653 Module User White Paper: Simplifying UWB Ranging, Positioning, and Communication
- Detailed Explanation of Qinheng CH579 Bluetooth OTA Backup and Upgrade Operation Process
- PY32F002B MCU DIY Infrared Sensor Solar Charging Mini Light Design
- TI-82 Calculator Modification Project: A Complete Record of MCU Core Board and Keyboard Design
- The Xunwei RK series development board SDK kernel version has been upgraded from 5.10 to 6.1 LTS.
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Musk: Tesla FSD V14 will outperform human drivers and "feel like it's alive"
- Rumors are spreading and the battle for intelligent driving is heating up. Who is at the center of the storm?
- The first AI car manufacturer to create the world's first AI cockpit
- Industrial machinery anomaly detection
- Design of LCD Display System Based on NiosⅡ+SOPC
- Heating Plate: Thermal Center and Material Shaper of Vacuum Eutectic Furnace
- Is the electromagnetic radiation of electric vehicles harmful to human health?
- Do you know what "car electronic fence" is?
- How to solve the maintenance problems of electric vehicles
- Nvidia today announced the "black technology" of humanoid robots
- How to design the power distribution system for next-generation automotive electronic and electrical architecture?
- Nanochip attended the 2026 Auto 100 Conference: Decoding the Evolution of Intelligent Powertrain Systems, Chips Become a Key "Underlying Capability"
- Nanochip attended the 2026 Auto 100 Conference: Decoding the Evolution of Intelligent Powertrain Systems, Chips Become a Key "Underlying Capability"
- Geely officially launched its i-HEV intelligent hybrid technology, redefining the next generation of hybrid electric vehicles.
- March saw a strong rebound in power battery sales: installed capacity doubled, but a slowdown in growth became more apparent.
- China's first domestically produced GaN magnetic encoding chip for humanoid robot joints released.
- How can autonomous driving systems handle situations where pedestrians suddenly appear out of nowhere?
- Four automotive-grade SiC collaborations have been implemented: already adopted by companies such as Changan and Toyota.
- On the eve of a breakthrough in optical computing: Will it replace GPUs?
- In China, for China 2.0: Infineon Embraces a New Cycle of Automotive Intelligence
- stm32F101 freezes, manual reset is invalid, only power-on reset is possible
- Some problems encountered when using RSL10 and their solutions
- PADs9.5 native Chinese version 3 in 1 simplified version without network label. Please ask the experts who have used 9.5
- Can LM2576 be selected as the chip in the voltage regulated power supply?
- What is the purpose of this circuit connection?
- Organize the FPGA books I collected
- ADUM4190 Isolated Error Amplifier
- CAN module address setting and initialization issues in industrial control
- How to solder plastic parts with a soldering iron
- ALTERA FPGA Lattice Example

Sine wave generator
STC89C516RD-Technical Data







京公网安备 11010802033920号