Design of temperature and humidity monitoring system based on single chip microcomputer

Publisher:学海星空Latest update time:2011-12-01 Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

0 Introduction
Temperature and humidity monitoring systems are widely used in daily life. For example, in grain depots, machine rooms, archives, special material processing workshops and other places, the temperature and relative humidity of the environment must be strictly controlled to keep them within a certain range. The nitro film production line has special requirements for temperature and humidity, and needs to be equipped with an online temperature and humidity monitoring system. The user sets the temperature and humidity thresholds of the system according to environmental requirements; the system measures and displays the temperature and humidity values ​​of the environment in real time, realizes automatic temperature and humidity control, and has high test accuracy within a wide temperature range. At the same time, it can also alarm according to the alarm threshold set by the user. Once the ambient temperature and humidity exceed the limit, the alarm will be immediately triggered. To this end, we designed a temperature and humidity monitoring and automatic control lifting system based on a single-chip microcomputer with high measurement accuracy, simple structure and use, stable and reliable operation, and has been well received by nitro film production customers.

1 Design scheme
The temperature and humidity monitoring system meets the following requirements:
1) According to the national computer room B-level standard, the temperature is 18-28℃ and the relative humidity is 40%-70%;
2) The user can set the system temperature and humidity alarm value;
3) The USB port is powered and provides temperature and humidity adjustment control signals to achieve automatic control;
4) The detected data can be displayed through the display module.
The hardware design must not only meet the system requirements, but also meet the functional and dimensional requirements.
According to the design requirements, the overall plan of the system is determined. The entire system consists of 6 parts: single-chip microcomputer, temperature and humidity sensor, display module, alarm, temperature and humidity adjustment system and keyboard. The system function schematic diagram is shown in Figure 1. The user pre-enters the temperature and humidity alarm value into the program, which is used as the system threshold. The temperature and humidity sensor monitoring value is transmitted to the single-chip microcomputer. When the single-chip microcomputer compares the monitored value and exceeds the set threshold, it drives the buzzer to alarm and provides a control signal for the temperature and humidity adjustment system to achieve automatic control. The temperature and humidity adjustment system includes a humidification module, a dehumidification module, a heating module and a cooling module.

[page]

2 Hardware Design
The single-chip microcomputer is the control center of the whole system. It commands the peripheral devices to work in coordination to complete specific functions. The hardware implementation adopts modular design. Each module only implements a specific function, and finally the modules are connected together. This design method can reduce the complexity of system design. The schematic diagram of the system circuit is shown in Figure 2. The main hardware design of this system includes power supply circuit, buzzer circuit, crystal oscillator circuit, reset circuit, LCD display circuit and temperature and humidity sensor circuit.
The core device of the control circuit is the AT89S52 single-chip microcomputer produced by Atmel Corporation of the United States, which belongs to the MCS-51 series. AT89S52 is a low-power, high-performance CMOS 8-bit microcontroller with 8K in-system programmable Flash memory. The process used is Atmel's high-density non-volatile memory technology; on-chip Flash allows program memory to be programmable in the system and is also suitable for conventional programmers; on a single chip, it has a smart 8-bit CPU and in-system programmable Flash, making AT89S52 a highly flexible and super-effective solution for many embedded control application systems; low price, reliable performance, and strong anti-interference ability. Therefore, it is widely used in industrial control and embedded systems.


The buzzer circuit, vibration circuit, and reset circuit of the system are shown in Figures 3, 4, and 5. The rated current of the buzzer IB≤30mA, while for the AT89S52 microcontroller, the sink current of the P1 port is 1.6mA and the pull current is 60μA. It can be seen that the buzzer cannot be driven by the P1 port current of the microcontroller alone. A transistor amplifier circuit must be used. In order to make the microcontroller consume less power, a PNP transistor 9012 is used. The crystal oscillator circuit used by AT89S52 uses a passive crystal oscillator of 11.0592MHz, and the fine-tuning capacitor size is 30pF. The display module uses a 1602 character liquid crystal module, which is one of the most widely used LCD screens in industrial control systems. The circuit diagram is shown in Figure 6. The 1602 character liquid crystal module is a dot matrix liquid crystal, which is easy to drive and displays diversified content after encoding. The input module of the system uses a 4×4 matrix keyboard with interrupt scanning, which improves the efficiency of MCU compared to the timing scanning method.

[page]


A total of 6 small modules are designed in this system, among which, except the power supply circuit, all are directly connected to the microcontroller. The specific pin definitions are shown in Table 1.

3 Software Design
The system microcontroller code is written in C language, with Keil uVision2 as the development environment. Functions implemented by the system software:
1) Display temperature and humidity values ​​through LCD;
2) Compare the monitored temperature and humidity values ​​with the alarm setting values, and the buzzer alarm prompts if they exceed the limit;
3) Control the operation of the temperature and humidity adjustment system according to the corresponding temperature and humidity values.
According to the functions of the temperature and humidity monitoring system, the system software flow chart is shown in Figure 8.


The working sequence of the temperature and humidity sensor SHT11 to complete a measurement is generally: set the sensor resolution → send the "start transmission" command → send the measurement command → read the output measurement value → convert the output measurement value into a physical quantity. The SHT10 data acquisition program flow chart is shown in Figure 9:

[page]
In order to improve the measurement accuracy of the relative temperature of the system, the nonlinearity of the humidity sensor is compensated to obtain accurate data, and the output value is corrected using formula (1):
Where: SORH represents the relative humidity output value of the sensor (approximately in the range of 90 to 3400), c1, c2, and c3 are humidity conversion coefficients, and the specific values ​​are shown in Table 2. The humidity sensor has basically no dependence on voltage.


For temperature measurement, the temperature sensor developed by PTAT, which uses bandgap materials proportional to absolute temperature, has excellent linearity. The digital output is converted into a temperature value using formula (2):


Implement part of the temperature and humidity compensation function program:

4 Conclusion
The temperature and humidity monitoring system designed in this paper is connected to the nitro film thickness detection system developed by us. After customer testing and use, within the normal temperature range, the value read by the system is consistent with the reading of the mercury thermometer, meeting the requirements of temperature test error ±0.1℃ and relative humidity test error ±3%. When the production temperature and humidity exceed a certain value, the system reading is correct, the alarm indicator lights up, and the temperature and humidity monitoring and automatic control of lifting and lowering are realized. Practice has proved that the system has a simple circuit, stable operation, high integration, convenient debugging, high test accuracy, and ensures the product quality and qualified rate of the nitro film production line, and has certain practical value.

Keywords:MCU Reference address:Design of temperature and humidity monitoring system based on single chip microcomputer

Previous article:Portable pulse signal parameter tester based on single chip microcomputer
Next article:51 MCU I/O port simulation serial communication implementation method

Recommended ReadingLatest update time:2024-11-17 00:38

MCU 4x4 matrix keyboard scanning program
    The inversion method is used to determine the key coordinates, that is, the row number and column number are used to obtain the key code.     After writing it, I found a problem with Proteus: when using such an if (P10xf0!=0xf0) statement directly, it cannot be called out. When an intermediate variable is used fo
[Microcontroller]
51 MCU Assembly Learning Routine (3) - Timer Interrupt
3.ASM3_Timer: Timer 0 controls LED flashing /** ****************************************************************************** * @file Timer.asm * @author Alex——Xiaobai * @version V1.0 * @date 2019.9.1 * @brief Timer controls LED on and off *****************************************************************************
[Microcontroller]
51 MCU Assembly Learning Routine (3) - Timer Interrupt
51 single chip matrix keyboard detection source code (key digital tube displays 0-F)
Download the schematic used in this program:  click here  , the microcontroller chip used is stc89c52; just find the corresponding part. This is the circuit diagram of the entire microcontroller development board. Ignore the others. Download hex file and its project file: http://www.51hei.com/f/juzhen.rar The followin
[Microcontroller]
Apple supplier releases digital sensor system for future Apple Watch
Apple supplier Rockley Photonics today unveiled an advanced digital sensor system that will likely appear in the Apple Watch to enable a host of new health-tracking features. The company today unveiled a complete “wrist clinic” digital health sensor system that enables wearables to monitor multiple biometrics, inclu
[Mobile phone portable]
Design of semiconductor laser power supply control system based on 51 single chip microcomputer
Semiconductor lasers (LDs) are small in size, light in weight, high in conversion efficiency, energy-saving, and can be directly modulated. Based on its multiple advantages, it has been increasingly widely used in scientific research, industry, military, medical and other fields, and its driving power supply has al
[Microcontroller]
Design of semiconductor laser power supply control system based on 51 single chip microcomputer
MCU PWM program and simulation waveform
        //******************************** //51 MCU PWM waveform generation program //Author: Zeng Xianyang //Website: http://hi.baidu.com/zxymcu //******************************** #include #define  uchar  unsigned  char #define  uint  unsigned  int uint  a,b,c,f; uchar  d,e;   s
[Microcontroller]
Design of digital adjustable high-efficiency switching voltage-stabilized power supply based on 51 single-chip microcomputer control
In order to study the advantages of combining analog PWM with digital circuits, this paper designs and implements a high-efficiency switching voltage-regulated power supply with adjustable output controlled by a 51 single-chip microcomputer. Through theoretical analysis, a DC-DC converter based on the BOOST boost ci
[Power Management]
Design of digital adjustable high-efficiency switching voltage-stabilized power supply based on 51 single-chip microcomputer control
How non-contact temperature sensors measure internal temperature
Non-contact temperature sensor, also known as infrared temperature sensor, is a sensor that determines the temperature of an object by measuring the infrared radiation emitted from the surface of the object. It has the advantages of non-contact, fast, accurate and safe, and is widely used in industry, medical treatm
[Test Measurement]
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号