Design of temperature and humidity detection system based on AT89S52

Publisher:EternalSmileLatest update time:2016-11-23 Source: eefocusKeywords:AT89S52 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

  introduction

  Temperature and humidity are the main environmental parameters of industrial and agricultural production. It is of great significance to measure them accurately and timely. Using a single-chip microcomputer to control temperature and humidity has the advantages of high temperature and humidity control accuracy, strong functions, small size, low price, simplicity and flexibility, which meets the process requirements very well. This article introduces the intelligent method of temperature and humidity detection and control using the AT89S52 single-chip microcomputer.

  Basic system plan

  This system uses AT89S52 single-chip microcomputer as the control core. The collected humidity analog voltage signal is analyzed and processed through ADC0809. A/D conversion is realized so that the digital tube can display its humidity value. This design can manually set the upper and lower limits of temperature/humidity. If any of them does not meet the set value, that is, the temperature/humidity is too high or too low, the system will issue a voice alarm and the relay will immediately cut off the power supply to achieve system protection.

  2 Hardware System Composition

  (1) Main control module: AT89S52 single-chip microcomputer is used as the controller of the system. Port P1 controls the digital tube to display the temperature and humidity values. Port P2 is connected to ADC0809. The humidity analog voltage is converted into digital quantity for easy processing by the single-chip microcomputer. The keyboard control uses port PO. Among them, PO.0 is the temperature setting, PO.1 is the humidity setting, and PO.2/PO.3 are used to set the upper/lower limit values ​​of temperature and humidity respectively. P0.4 is the connection port of DS18820 temperature sensor. PO.6 is the connection port of ISD1420 voice chip. The principle is shown in Figure 1:

Design of temperature and humidity detection system based on AT89S52 - hjx5548 - hjx5548's blog

  (2) Display module: The system uses dynamic display mode to drive 6 digital tubes, of which 4 digital tubes are used to display temperature values ​​and 2 are used to display the detected humidity values. The input end of 74LSl38 is used to select the bit code. The P1 port of the single-chip microcomputer controls the break code of the digital tube. If the detected temperature and humidity change, the digital tube will change accordingly, playing a real-time display function. The circuit is shown in Figure 2.

Design of temperature and humidity detection system based on AT89S52 - hjx5548 - hjx5548's blog

  (3) Voice broadcast module: It uses voice chip ISD1420, which can complete high-quality sound recording and restoration. The maximum recording time is 20 seconds, and it has segmented recording function. Its operating voltage is in the range of 4.5V to 5.5V, and it uses direct level/edge storage technology, eliminating the need for A/D and D/A conversion. It integrates a large-capacity EEPROM, no longer requires extended memory, and is easy to connect to the microcontroller. The voice broadcast module circuit is shown in Figure 3.

 

 


Design of temperature and humidity detection system based on AT89S52 - hjx5548 - hjx5548's blog

  The S3 key of this circuit is the recording key, the S1 and S2 keys are the play keys, and the A0-A7 are the address selection terminals. Connecting the A0-A7 of ISD1420 directly to the P1 port of the microcontroller can realize the recording address selection function, and then connecting the play key to the P0.6 port to realize the real-time playback function controlled by the microcontroller. The power supply VCCA and VCCD use different power buses for the internal analog and digital circuits, but because the interference of this chip is small, the two can be short-circuited together.

  (4) A/D conversion module: ADC0809 conversion chip is used to realize the conversion from analog quantity to digital quantity. Since there are many types of analog conversion circuits, the A/D converter is selected from the aspects of speed, accuracy and price. It has 8 analog selection switches inside. And the corresponding channel resistance latch decoding circuit, the conversion time is about 128μS, and it is powered by a single power supply.

  (5) Temperature and humidity acquisition module: The temperature sensor uses the intelligent temperature sensor DS18B20 produced by DALLAS Semiconductor. The collected data can be directly sent to the microprocessor without A/D conversion. The measured temperature can be directly read. It only needs 1 interface line to realize two-way communication with the microprocessor; only 1 4.7k pull-up resistor is needed. No other external devices are required. This system uses data line power supply for DS18B20, and the temperature measurement range is -50℃~125℃. Through programming, 9-12-bit digital value reading mode can be realized, and the measurement accuracy is ±0.5. The user can set the upper and lower limits of non-volatile alarm. Because of the single bus mode, multiple DS18B20 can be connected to the control bus to detect the temperature of different parts. The humidity sensor uses HSM-20G. Its principle is that the value increased by 1% for every 0.03V change in humidity. The output voltage value needs to be converted into digital quantity by ADC0809 so that the single chip microcomputer can process it so that the digital tube can display the humidity value. Its operating voltage range is DC voltage 5.0±0.2V, the test accuracy is ±5%RH, the operating current (maximum value) is 2mA, the storage environment humidity range is 0 to 99%RH, the working environment humidity range is 10 to 90% (can reach 100%RH instantly), and the working environment is 0℃~50℃.

   (6) Relay control circuit: Electromagnetic relays have the advantages of simple structure, reliable operation, durability, and low price. They are widely used and are the most typical and commonly used relays. This circuit uses a normally closed relay controlled by a single-chip microcomputer. When the temperature or humidity is abnormal, the relay starts to work and the switch cuts off the power supply, and the small light goes out, thereby protecting the system. The circuit is shown in Figure 4.

Design of temperature and humidity detection system based on AT89S52 - hjx5548 - hjx5548's blog

  3. System software design

  The software design of this system adopts assembly language programming. After the temperature/humidity is collected and processed accordingly, the digital tube can display the current temperature and humidity values ​​in real time. The output voltage of humidity collection needs to be converted into digital quantity by ADC0809 before it can be processed by the microcontroller. The voice broadcast only needs to be connected to the I/O port of the microcontroller and its interface line can be programmed to complete. The overall program flow is shown in Figure 5.

Design of temperature and humidity detection system based on AT89S52 - hjx5548 - hjx5548's blog

  4 Conclusion

  The detection system uses the single-chip microcomputer AT89S52 as the core to realize the detection and control of temperature and humidity. It is reliable, simple to operate, high in precision and fast in response. At the same time, the temperature and humidity values ​​after passing through the control system are intuitively displayed through the LED digital tube. When an abnormality occurs, a warning is issued through the alarm device and it is handled in time. It meets the needs of the site and has a wide range of application prospects.


Keywords:AT89S52 Reference address:Design of temperature and humidity detection system based on AT89S52

Previous article:12864 LCD display C language programming example
Next article:Stepper Motor Program

Recommended ReadingLatest update time:2024-11-16 15:37

Introduction to the single chip temperature recording system solution
In practical applications, it is often necessary to monitor temperature signals at a distant location. To this end, a solution integrating a single-chip microcomputer with a digital temperature sensor is designed, which can achieve temperature detection at a lower cost and higher accuracy.
[Microcontroller]
Introduction to the single chip temperature recording system solution
Pulse Parameter Tester Based on AT89S52
There are various pulse signals in power production and other industrial sites. When troubleshooting and analyzing, it is necessary to measure and analyze the relevant parameters of these pulse signals. The pulse parameter tester based on the single-chip microcomputer can measure the pulse width, period, frequency, du
[Microcontroller]
Pulse Parameter Tester Based on AT89S52
Car anti-theft solution based on time trigger mode
      1. Introduction   Currently, the mainstream products in the anti-theft device market are electronic anti-theft devices, which are divided into one-way anti-theft devices and two-way anti-theft devices. Both of these anti-theft devices allow the owner to control the car through a remote control, while the two-wa
[Microcontroller]
Car anti-theft solution based on time trigger mode
Design of digital voltmeter based on ADC0809 and AT89S52 microcontroller
1 Introduction The input voltage to be tested in this design is 8 channels, and the voltage range is 0~5V. The currently widely used AT89S52 is used as the control system, and ADC0809 is used for analog voltage collection and analog-to-digital conversion to collect 8 channels of data and convert The results can be scr
[Microcontroller]
Design of digital voltmeter based on ADC0809 and AT89S52 microcontroller
Design of Multifunctional Digital Control Current Source Based on AT89S52
In modern scientific research and industrial production, digitally controlled DC current sources with high precision and good stability have been widely used. Most of the current sources used in the past were adjusted by potentiometers, and the output current value could not achieve precise stepping. Although some curr
[Microcontroller]
Design of Multifunctional Digital Control Current Source Based on AT89S52
Design of a dual closed-loop speed control system for three-phase asynchronous motors
O Introduction Three-phase AC asynchronous motors are widely used in weapons and equipment, feeding systems, CNC machine tools, flexible manufacturing technology, various automation equipment and other fields due to their simple structure, small size, light weight, low price and convenient maintenance. The perfo
[Microcontroller]
Design of a dual closed-loop speed control system for three-phase asynchronous motors
Design of multi-interval pulse generation circuit based on AT89S52 single chip microcomputer and CPLD
    The single-chip microcomputer has the characteristics of flexible logic control functions, and the complex programmable logic device (CPLD) has the advantages of high integration, good reliability and fast working speed. Based on the advantages of both, a single-head, double-head, and three-head three-way pulse ge
[Microcontroller]
Design of multi-interval pulse generation circuit based on AT89S52 single chip microcomputer and CPLD
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号