AT89S51 computer automatic temperature controller
Source: InternetPublisher:MartinFowler Keywords: Temperature controller at89s51 Updated: 2021/01/16
This automatic computer temperature controller can automatically adjust the speed and start and stop of the relevant fans according to the temperature. At the same time, it displays the temperature in various places in turn. It saves energy and reduces noise. It is easy to use and does not occupy system resources.
1. Working principle
The working principle of this device is shown in the figure below. IC2 is the main control chip AT89S51, IC4 is the 8-bit successive approximation A/D conversion chip ADC0809, and RT1~RT4 are thermistors that measure the temperature of the CPU, power supply, chassis, and graphics card respectively. FAN1~FAN4 are fans that control the temperature of the CPU, power supply, chassis, and graphics card respectively. Taking CPU temperature control as an example, when the temperature rises, the resistance of RT1 becomes smaller and the voltage at point A rises. The changed voltage enters the input channel IN0 of ADC0809 as an analog quantity to be converted. After AD conversion and table lookup, it is converted into The temperature value is displayed on the digital tube. The leftmost digit displays "1" (1 represents the CPU, 2 represents the power supply, 3 represents the chassis, and 4 represents the graphics card). The second digit on the left does not display, and the last two digits display the current temperature of the CPU. actual temperature value. The display range is 0~70℃. When the temperature is lower than the set lower temperature limit, the microcontroller sends a control command through the serial port through the 74LS164. Shift output, causing V5 and V9 to cut off, and fan FAN1 stops rotating.
When the temperature is higher than the lower limit and lower than the upper limit, V5 is saturated and V9 is cut off. The 12V power supply is reduced by VD1 and becomes 9V and is added to both ends of FAN1 to make FAN1 run at low speed. When the temperature is higher than the preset upper limit, V5 and V9 are saturated, all 12V voltage is applied to FAN1, and FAN1 runs at full speed to cool down the CPU. Temperature controls are the same everywhere else. During normal operation, the digital tube displays the current temperature values of 4 channels in turn, and the display time of each channel is 8 seconds. AN1~AN3 in the picture are buttons for temperature setting. Press AN1 once during setting. The first digit on the left side of the digital tube displays "1" and the second digit displays "H". The last two digits display the current upper limit temperature setting value of the CPU. Press Move AN2 to set the tens digit of the upper limit value, and press AN3 to set the ones digit of the upper limit value. After setting, press AN1 again, and the CPU upper limit temperature set value is written to 24C02 for permanent storage. At the same time, the digital tube Displays "1L" and the current lower limit temperature setting value of the CPU. After setting the lower limit value in the same way, press AN1 for the third time. The CPU lower limit temperature setting value is written to 24C02, and the digital tube displays "2H". Follow the same method as the current upper limit temperature setting value of the power supply. After setting the upper and lower limits of the power supply, chassis, and graphics card temperature in sequence, click AN1, and the digital tube will display the current temperature values everywhere again in turn.
2. Software design
The program in this article uses modular programming. Taking into account the non-linear shape of the thermistor's resistance change with temperature, the temperature value calculation is implemented using a lookup table. The A/D conversion is programmed using a waiting method. The four channel register addresses are 7FF0H. ~7FF3H, the entire program consists of the main program, temperature judgment program, upper and lower limit setting program, A/D conversion program, table lookup program, binary conversion program, display program, key scanning program, key wait release program, serial It is composed of line sending program, 24C02 reading and writing program, etc. The main RAM allocation on the chip is as follows: 28H stores key codes, 29H stores AN1 key sequences, 34H and 35H are decimal conversion temporary storage units, 40H~43H are display buffers, 49H is 12C addressing byte write storage unit, and 4BH is addressing unit. The address byte read storage unit, 4DH stores the number of transmitted bytes, 4EH is the data sub-address storage unit, 50H~57H respectively store the upper and lower temperature limit settings of the CPU, power supply, chassis, and graphics card. 5AH is the fan operating status temporary storage unit.
3. Installation and debugging
Since the device uses serial EEPROM memory 24C02 to save data, the set values can be saved for a long time and can be run without re-entering data after each boot, which greatly enhances the practicality of the device. When running for the first time after production, the fans may not rotate at all. This is because the 24C02 used is a blank chip. You only need to set the upper and lower temperature limits of each channel according to the above method. The power supply for this unit is 12V and 5V, which can be taken directly from the redundant plug of the host power supply. RT1, RT2, and RT4 can be fixed at the bottom of the grooves of their respective heat sinks with thermal conductive glue. Since the thermistor is located below the fan, in order to make it truly reflect the temperature of the heat sink, it is best to fix it with thermal conductive glue before installing it. Apply a thick layer of super glue or hot melt glue to its surface. RT3 can be fixed at a suitable place in the middle and upper part of the chassis. In actual use, it is generally more appropriate to set the lower limit value to about 25°C and the upper limit value to about 40°C. Since the control instructions use serial output, this device still has a lot of room for expansion. For example, hard disk fans, monitor fans, etc. can be added as needed. In this case, only slight changes to the software are required. Of course, this device can also be used in other places where temperature control is required.
- Digital number selection machine
- Frequency divider that converts 50Hz or 60Hz frequency into 1/60 frequency (CD4040)
- Demonstration device for capacitor charging and discharging process
- Precision unity gain inverting amplifier circuit composed of INA105
- Class A2 single-ended parallel amplifier circuit
- Broadband transconductance operational amplifier and buffer OPA660 common collector (common-C) amplifier circuit
- Typical application circuit of LM4911 for dual-channel amplifier
- 380MHz linear amplifier circuit composed of RF2175
- Triode Single Stage Amplifier
- Common emitter amplifier circuit composed of dual broadband transconductance operational amplifier OPA2662
- Electric oven temperature controller circuit diagram
- Digital display electric heating furnace automatic temperature controller
- Temperature controllable electric blanket temperature controller circuit
- Novel temperature controller circuit
- temperature controller circuit
- heater temperature controller
- Proportional temperature controller circuit
- Thermocouple Set Point Temperature Controller
- simple temperature controller
- Simple temperature controller circuit diagram