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.
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
- Popular Resources
- Popular amplifiers
- Analysis and Implementation of MAC Protocol for Wireless Sensor Networks (by Yang Zhijun, Xie Xianjie, and Ding Hongwei)
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Introduction to Internet of Things Engineering 2nd Edition (Gongyi Wu)
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- How to improve the fast transient response of switching power supplies?
- [Raspberry Pi Pico Review] CCSDK and fuzix system of Raspberry Pi Pico
- The role of adding inductance between STM32F103 power supplies
- Today I saw an electromagnetic pulse protector, and I will test its specific parameters for you.
- [TI recommended course] #Amplifier design in test and measurement#
- AD9958
- Why are multiple register access instructions needed?
- [Synopsys IP Resources] Using 1.6T Ethernet to meet growing bandwidth demands
- Design of Internet Radio Based on RSIC-V RVB2601 (4)
- MicroPython Firmware Development Tutorial