At present, whether in industrial production or scientific research experiments, the equipment for automatic control through temperature measurement is becoming more and more popular, and there are more and more application occasions. The problem that follows is how to measure the accurate temperature to ensure that the automatic control equipment can correctly issue control instructions to control the production process. On the other hand, if the temperature is too high, it may cause damage to some semiconductor components in some equipment. Therefore, the demand for automatic high temperature alarm is also gradually increasing. Based on the above considerations, this paper studies and designs an automatic temperature measurement and alarm system based on a single-chip microcomputer.
1 System Hardware Design
Although there are many varieties of microcontrollers on the market and their functions are increasing, due to cost constraints, 8-bit microcontrollers with excellent performance are still the first choice in industrial detection and control applications.
This system is based on the AT89C51 single-chip microcomputer of ATMEL Company. It converts the output voltage of the temperature sensor into digital form through the analog-to-digital converter AD7812, and then sends the conversion result to the single-chip microcomputer for corresponding processing. The processing result is analyzed through programming, and finally it is decided whether to alarm. The design of each hardware function module is introduced below.
1.1 Temperature sensor design
The temperature sensor is an important component for sensing temperature changes in the external environment. It is the interface between the outside world and this system. It converts changes in the external temperature into changes in voltage, so that the external temperature can be indirectly measured by processing and analyzing the voltage. The temperature sensor used in this system is LM35, which is produced by National Semiconductor Corporation of the United States. At room temperature, it can reach an accuracy of 0.25℃ without additional calibration processing. Its output voltage is linearly related to the Celsius temperature, and this relationship can be expressed as:
or
In the formula, Vo is the output voltage of the sensor, in V, and T is the temperature in the external environment, in °C. Since the highest temperature that LM35 can measure is 150 °C, its maximum output voltage is 1.5 V according to formula (1). In order to match the input of AD7812, the output voltage of the sensor needs to be amplified by about 3.33 times. An integrated operational amplifier can be connected as a common-direction amplifier to achieve the function of voltage amplification. The amplified voltage is about 5 V, which can just match the input of the analog-to-digital conversion part. The circuit design of this part is shown in Figure 1.
Figure 1 Temperature sensor circuit [page]
1.2 A/D conversion design
The output voltage value after the temperature sensor conversion cannot be directly sent to the microcontroller for processing. An A/D conversion device must be added between them. In this article, AD7812 is selected as the A/D converter. AD7812 is a 10-bit 8-channel A/D converter with a serial interface produced by Analog Devices. Compared with the general parallel interface A/D converter, its advantage is that it can save the processor's pin resources. The saved pin resources can further expand the system to make it more powerful. There are 8 analog switches inside the AD7812 that can collect 8 analog signals. Here, you only need to input the amplified sensor output signal to any one of them. For simplicity, the first analog switch is taken as the channel of the input signal. Since the AD7812 has a conversion clock source inside, there is no need to provide an external clock source. The microcontroller only needs to control it through its serial clock input, data output, data input, and conversion input pins. The circuit design of this part is shown in Figure 2.
Figure 2 A/D conversion circuit
1.3 MCU Processor Circuit Design
The AT89C series microcontroller is a low-voltage, cost-effective 8-bit microcontroller. Compared with the MCS-51 microcontroller, it has two major advantages: first, the on-chip memory uses flash memory, making program writing more convenient; second, a smaller chip size is introduced, making the circuit size smaller.
AT89C51 is a high-performance 8-bit microcontroller in this series with 4 KB of programmable and erasable read-only memory and 128 bytes of random access data memory (RAM). It uses ATMEL's high-density non-volatile memory manufacturing technology and is compatible with the industry-standard MCS-51 instruction set and output pins. In short, ATMEL's AT89C51 microcontroller provides a cost-effective implementation solution for embedded control systems.
AT89C51 provides the following standard functions: 4 K bytes of Flash memory, 128 bytes of internal RAM, 32 I/O lines, 2 16-bit timer/counters, 1 5-vector two-level interrupt structure, 1 full-duplex serial communication port, on-chip oscillator and clock circuit. At the same time, AT89C51 can be reduced to 0 Hz static logic operation and supports two software-selectable power-saving working modes. The idle mode stops the CPU from working, but allows the RAM, timer/counter, serial communication port and interrupt system to continue working. The power-down mode saves the contents of the RAM, but the oscillator stops working and prohibits all other components from working until the next hardware reset. In this article, the central processing circuit is shown in Figure 3.
Figure 3 Single chip microcomputer processing circuit [page]
1.4 Abnormal situation alarm circuit design
The function of the alarm circuit is to remind the staff to take measures as soon as possible when an abnormal situation occurs, reduce the danger and avoid catastrophic consequences. Therefore, when designing the alarm circuit, its alarm behavior should be quickly noticed by people so that further corresponding measures can be taken to avoid or reduce the losses caused by the hazards. Modern scientific research has proved that the purpose of alarm can be better achieved by stimulating people's vision and hearing. In addition, flashing lights and intermittent sounds are most likely to attract people's attention. Based on the above considerations, a pulse signal generator composed of integrated gate circuit chips such as 74LS00 and 74LS04 is used in the design to control the intermittent sound and the on and off of the light.
The temperature in the external environment is collected by the temperature sensor, which converts the temperature into a voltage value. The voltage value is matched and sent to the A/D converter. The converted data is sent to the microcontroller for processing. The microcontroller processes according to the compiled program. If the temperature at this time exceeds the threshold set by people based on experience, the microcontroller will make the output of P0.0 and P0.1 high level (about +5 V) through instructions, so that the speaker and the light-emitting diode generate an alarm signal. The circuit design of this part is shown in Figures 4 and 5.
Figure 4 Sound alarm circuit
Figure 5 Light alarm circuit
2 System Software Design
In order to facilitate the modification of the program, the system is designed in a modular way. The system consists of four modules: temperature acquisition, A/D conversion, data processing, and alarm output. Temperature acquisition is completed by the temperature sensor LM35, and A/D conversion and alarm output are controlled by the single-chip microcomputer. The data processing part is completed inside the single-chip microcomputer after the single-chip microcomputer receives the data sent by the A/D converter, and the result will determine whether the alarm output module works.
The working process of the system is: LM35 collects temperature and converts the temperature signal into an electrical signal; A/D conversion converts the linearly amplified analog electrical signal into a digital signal that can be processed by the single-chip microcomputer; the single-chip microcomputer analyzes the sampled temperature value by processing the converted digital signal and sends the analysis result to the alarm output circuit; the alarm output circuit responds accordingly according to the analysis result. The software design flow chart of the system is shown in Figure 6.
Figure 6 System design flow chart
2.1 A/D conversion module
The A/D converter needs to be initialized before starting, otherwise it will affect the subsequent use. According to the connection method in Figure 2, set the P1.4 port of the microcontroller to 1 during initialization, and then the software can start a conversion process. During the conversion process. Since any A/D converter will have a certain conversion time, a certain delay must be set during the conversion, and the delay must be slightly longer than the conversion time of the device. Since the conversion time of AD1812 is about 2.3 μs, the delay can be set to 3 μs in the program to ensure the smooth progress of the conversion process.
2.2 Central Processing Module
The software design of this module mainly includes three parts: the control of the A/D conversion module by the microcontroller, the processing of the data sent by the microcontroller, and the control of the alarm system by the microcontroller.
The control of the A/D module mainly includes writing relevant control words to AD7812 and setting and clearing the pin of P1 port; the data processing part mainly compares the voltage value converted from the external temperature with the preset empirical threshold to decide whether to start the alarm system; the design of the alarm system is to clear or set the P0 port according to the result of data processing to start or stop the alarm circuit.
3 Conclusion
This paper mainly designs an automatic temperature measurement and alarm system. The design of this system is mainly based on the AT89C51 single-chip microcomputer. The central processing unit and the peripheral expansion module are simple in structure, and the cost of the entire system is low. Since LM35 is powered by a single power supply, the system can only work within the range of 5 to 150°C. It can be used as an alarm device at room temperature, especially in some electrical equipment that is sensitive to temperature. It can prevent equipment failures, so it has certain practical value. In the design, the parallel A/D converter AD0809 is not used, but the serial port converter AD7812 is used to save a lot of port resources for the single-chip microcomputer. These resources can be used to expand the LED or LCD display system, and can also be made into a temperature measurement and alarm system to make its functions more complete.
Previous article:Design of Universal Automatic Test System Based on PC104
Next article:Design of a high-speed and integrated data acquisition system
Recommended ReadingLatest update time:2024-11-16 18:08
- Popular Resources
- Popular amplifiers
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- 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
- TI bidirectional DC-DC converter solution
- Senior Electronic Engineer (FPGA) Recruitment
- Should I choose a slow-blow or fast-blow fuse for the power module?
- Join [Micron VIP] and win a 200 yuan JD card!
- [GD32L233C-START Review] 8. TRNG True Random Number Generation
- How to set the grid of PCB more efficiently
- Input Considerations for SAR ADCs
- Enabling BLE in ESP-S3 using micropython
- The LM5118 buck-boost circuit has poor load capacity?
- GD32L233C Review: Unboxing