Design of Temperature and Humidity Detection System Based on AT89S52

Publisher:CaptivatingEyesLatest update time:2012-07-07 Source: 21ic Keywords: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 ADC 0809. 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 Pl 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:

(2) Display module: The system uses dynamic display to drive 6 digital tubes to work AT89S52 microcontroller , 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 microcontroller 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. [page]

Display Module

(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. [page]

Voice broadcast module

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: Temperature sensor Using 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 required. 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 method, 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 humidity value increases by 1% for every 0.03V change. Its output voltage value needs to be converted into digital value by ADC0809 so that the single chip microcomputer can process it and let the digital tube display the humidity value. Its working voltage range is 直流电\'); companyAdEvent.show(this,\'companyAdDiv\',[5,18])"> DC voltage 5.0±0.2V, and the test accuracy is 5%RH. The working 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℃. [page]

(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.

Relay control circuit

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 the humidity collection needs to be converted into digital quantity by ADC 0809 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 is programmed to complete. The overall program flow is shown in Figure 5.

Overall program flow

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:Precision measurement of belt speed based on photoelectric mouse sensor and its control system
Next article:Receiving and forwarding infrared remote control signals

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

Design of voice broadcast recorder based on ISD4004 voice chip and AT89S52 single chip microcomputer
introduction This article introduces a design of a voice broadcast recorder based on voice storage and automatic playback system. The design is centered on ISD4004 voice chip and AT89S52 microcontroller , which realizes voice storage and automatic playback well. 1 Hardware Desig
[Microcontroller]
Design of voice broadcast recorder based on ISD4004 voice chip and AT89S52 single chip microcomputer
LED dot matrix electronic display production
  0Introduction   LED display is a new type of information display media that has developed rapidly in the world since the late 1980s. It is a flat display screen composed of dot matrix modules or pixel units using light-emitting diodes. With the characteristics of high reliability, strong environmental adaptability
[Microcontroller]
LED dot matrix electronic display production
Design of a New Multi-rate Single-phase Watt-hour Meter Based on AT89S52 Single-chip Microcomputer
  As the demand for electricity increases, the phenomenon of uneven electricity consumption in different time periods is becoming more and more serious. In order to reasonably regulate the power load and save energy, power companies have begun to encourage the use of multi-rate electricity meters. Traditional multi-ra
[Microcontroller]
Design of a New Multi-rate Single-phase Watt-hour Meter Based on AT89S52 Single-chip Microcomputer
Design of multi-channel data acquisition system based on ADC0809 and 51 single chip microcomputer
Abstract: This paper presents a design method for realizing multi-channel data acquisition and communication control using 8051 single-chip microcomputer as the core. This method converts the collected data from analog to digital quantity through the universal ADC0809 analog-to-digital conversion of 8-channel measur
[Industrial Control]
Design of multi-channel data acquisition system based on ADC0809 and 51 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号