Temperature detection and display design based on 51 single chip microcomputer

Publisher:meirongLatest update time:2011-12-17 Keywords:AT89C52 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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.

[page]

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 functions 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 tasks are 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.

[page]

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.

Keywords:AT89C52 Reference address:Temperature detection and display design based on 51 single chip microcomputer

Previous article:Application of timer/counter in single chip microcomputer to eliminate instantaneous interference
Next article:Design of single chip microcomputer control system for automatic chamfering machine of magnetic tile

Recommended ReadingLatest update time:2024-11-16 21:37

Interface circuit and source code between 51 single chip microcomputer AT89C52 and DS18B20
This article will introduce the temperature measurement system composed of 51 single-chip microcomputer AT89C52 and temperature sensor chip DS18B20, and provide source code for readers' reference. The temperature measurement accuracy reaches 0.1 degrees, and the measured temperature range is between -20 degrees and
[Microcontroller]
Interface circuit and source code between 51 single chip microcomputer AT89C52 and DS18B20
Detailed explanation of AT89C52 control buzzer circuit diagram
  Introduction to buzzer   1. The function of the buzzer The buzzer is an electronic buzzer with an integrated structure. It is powered by DC voltage and is widely used in computers, printers, copiers, alarms, electronic toys, automotive electronic equipment, telephones, timers and other electronics. The product is us
[Microcontroller]
Detailed explanation of AT89C52 control buzzer circuit diagram
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号