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 , 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]
(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]
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.
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.
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.
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
- Popular Resources
- Popular amplifiers
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- Principles and Applications of Single Chip Microcomputers 3rd Edition (Zhang Yigang)
- Principles and Applications of Single Chip Microcomputers and C51 Programming (3rd Edition) (Xie Weicheng, Yang Jiaguo)
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
- Analysis of the working principles of seven triode collector DC circuits 2
- Circuit
- TMS320F28035 call jump instruction problem
- Sliding resistor for LM358 comparator
- TE pressure sensor: underwater robots from 0 to 1000, how to avoid mass production pitfalls
- OHM Graphical Introduction to Electronics
- Detailed explanation of the design of RFID-based smart hotel system
- 【Qinheng Trial】Streamlined mobile phone system design #1
- A newbie asks a question about the STC15 interrupt function
- MSP432P401R LaunchPad download program prompts not supported