Due to the continuous development of high-tech, the miniaturization and digitization of instruments have been realized. In the 1990s, high-precision, high-performance, and multi-functional instruments and meters have adopted microprocessor devices. As a development trend and significant sign of various new technologies, new methods, and new products in the field of industrial control and automation, intelligence is one of the current and future development trends of automation technology. This paper uses the AT89C52 single-chip microcomputer to develop a keyboard, LCD display, and multi-channel temperature detection to realize temperature collection, text display, and graphic display of temperature. Experiments have proved that the system developed using AT89C52 has reliable performance, low cost, flexible and simple software design, rich hardware interface functions, good scalability, and strong versatility.
1. Component selection
1.1 Selection of core chip
The AT89C52 microcontroller is inexpensive and has a rich input and output port, which does not require additional expansion and simplifies the peripheral circuit. It has 256 B internal RAM, 8 kB internal ROM, and a large program storage space to prevent insufficient storage space due to too many fonts. In addition, the early development requires multiple writes and erases, and the 89C52 can complete 1,000 writes/erases, so it meets the requirements.
1.2 Selection of analog-to-digital conversion chip
ADC0809 is an 8-bit A/D conversion chip of successive approximation type. It is powered by a single +5 V power supply. It has an 8-way analog multiplexer with stored functions. It can convert 8 0-5 V input analog voltage signals in time-sharing mode. It takes about 100 μs to complete a conversion. The address decoding and latch circuit in the chip decodes the three address signals of the microcontroller to generate eight analog channels. The output has a TTL three-state latch buffer, which can be directly connected to the data line of the microcontroller.
1.3 Temperature sensor selection
There are many types of temperature sensors. The quartz temperature sensors such as AD590 currently available have high stability, accuracy, good linearity, and strong anti-interference ability. The single-bus digital temperature sensor DS18B20 directly generates a temperature digital signal without the need for A/D conversion. Its accuracy and stability are quite high, but the application range of these sensors is not wide, which is not conducive to the expansion of other functions in the future. Therefore, this time, the platinum thermal resistance temperature sensor T/PI/HT of TREND Company is used. The operating voltage of the sensor is 24 V, the output current is 4-20 mA, and the external 250 Ω precision resistor is used for A/D conversion when extracting the voltage. The input voltage of ADC0809 is in the range of 1-5 V, and the corresponding measurement temperature range is -10-+160℃.
2 Design and Application of AT89C52
2.1 Hardware Design
According to the functional requirements of the design instrument, this design should complete the following functions:
(1) Digital measurement, display and alarm device;
(2) Display the temperature value and dynamic curve of the specified position;
(3) Collect and process multi-channel analog data;
(4) Scaling of temperature value font.
The system structure diagram is shown in Figure 1.
2.2 Software Design
Use C language to design single-chip computer programs, and adopt structured programming ideas: use the "top-down" method in the overall design, and use modular programming in program design. Divide the overall task into subtasks, and subtasks into subtasks, layer by layer, and each subroutine completes its specified function and clarifies the input and output. Connecting these programs together will form an overall flow chart. Modular programming, each module has a complete structure and independent program segments. For example, the LCD module writes control instructions, writes display data, and clears the screen; engineering quantity conversion in data processing, mean filtering, etc. These programs can be called and modified at will, making the entire program structure clear, flexible in combination, and easy to maintain and debug.
2.2.1 Main flow chart
The main flow chart is shown in Figure 2. It mainly includes the program initialization part, and the main task is to initialize the LCD screen, initialize the status of each port of the single-chip microcomputer and set the initial threshold value. The detection position is the first path; after pressing the OK key, the system starts to work, and displays the temperature of the first path position and the main page of its dynamic display diagram; when the Set key is pressed, the LCD screen displays a selection interface, where you can choose to set the detection position and the detection position threshold; you can select through the up and down keys, and when the arrow on the selection interface points to the setting position, press OK to enter the position setting. After setting, press OK to return; directly press the OK key again to display the enlarged temperature font.
2.2.2 Temperature measurement flow chart and curve display process
When starting ADC0809, it is necessary to look up the table and select different channel address tables according to the different detection positions to be started; set the conversion time of ADC0809, use delay waiting, and then read its conversion data; derive the conversion formula according to the range of the temperature sensor; for the convenience of display, it is necessary to separate the digits into hundreds, tens, units, tenths and percentiles; establish a digital word model table of 0 to 9, and take the model for display. The temperature display and curve display flow charts are shown in Figure 3 and Figure 4 respectively.
2.2.3 Threshold Setting Flowchart
The threshold temperature ft is an external variable and is valid throughout the entire program. Each time the "up" key is pressed, ft=ft+1, and when the "down" key is pressed, ft=ft-1. The setting of the detection position is similar. The threshold setting flow chart is shown in Figure 5.
3 Conclusion
This paper designs and studies the application of AT89c52 single-chip microcomputer in intelligent temperature detection. The system can also be easily connected to other analog sensors, and has good functional expansibility. The LCD module displays and keyboard operations set system parameters, and the human-computer interaction interface is good. The detection data is accurate and reliable, with good linearity, which reduces the system cost and enhances the versatility of the system. The software design uses C language, which has good portability, rigorous structure, fast development speed, greatly reduces the time of software development, and has certain practical value.
Previous article:Design of an External Nerve Stimulator Based on AT89C52
Next article:Design of Remote Power Supply Monitoring System Based on AT89S52
Recommended ReadingLatest update time:2024-11-16 17:47
- 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)
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
- Transistor static operating point
- The History of DSP and Why No One Mentions DSP Anymore
- RISC-V MCU IDE MRS (MounRiver Studio) development: Add standard math library reference
- A brief introduction to the timer A function of the 430 microcontroller
- [Social Recruitment] Capital Securities Recruitment [Semiconductor Researcher]
- [Lazy self-care fish tank control system] PRINTF output in RTT mode under Keil environment
- This week's highlights
- PIC118F
- [MM32 eMiniBoard Review] Part 3: UART Test and Analysis
- Resistance and capacitance thinking map