Design of Intelligent Temperature Monitoring System Based on Single Chip Microcomputer

Publisher:朝霞暮雨Latest update time:2022-04-02 Source: eefocus Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The intelligent temperature detection system realizes intelligent temperature monitoring within the range of 0℃~99℃ through the combination of hardware circuit design and software programming drive. The actual temperature and preset temperature can be displayed in real time through the LCD. When the temperature exceeds the preset range, an alarm will be issued in time, and the alarm sound is realized by electronic music or musical notes.


Preface

The main idea of ​​this design is to use the 51 series single-chip microcomputer, digital temperature sensor DS18B20 and 1602LCD liquid crystal display to form a single-chip control system that realizes temperature detection and display, that is, a digital thermometer. By writing corresponding programs for the single-chip microcomputer, the purpose of being able to detect the surrounding temperature in real time can be achieved. Through the design of this topic, you can be familiar with the working principle and process of the digital thermometer, understand the basic principles and applications of each functional device (single-chip microcomputer, DS18B20, LCD), master the hardware connection and program writing of each part of the circuit, and finally complete the overall design of the digital thermometer. The specific requirements are as follows: 1. According to the design requirements, the AT89C51 single-chip microcomputer is selected as the core device; 2. The temperature detection device uses the DS18B20 digital temperature sensor, which is connected to the serial interface P3.3 pin of the single-chip microcomputer using a single bus connection method; 3. The display circuit uses a 1602LCD liquid crystal to display the temperature value. This type of liquid crystal module can not only display numbers and characters, but also various graphic symbols and a small number of custom symbols. The human-computer interface is friendly, and the operation is more flexible and convenient, making it increasingly becoming the first choice for various instruments and other equipment.


System development process

This design mainly introduces the method of combining a single-chip microcomputer with a digital temperature sensor DS18B20 to realize temperature collection. With the single-chip microcomputer AT89C51 chip as the core, the temperature sensor DS18B20 and the 1602LCD liquid crystal display, a multifunctional single-chip digital thermometer is formed. Its main research content includes two aspects. One is the design of the system hardware part, including the temperature collection circuit and the display circuit; the other is the design of the system software part, using C language to realize temperature collection and display. By using the digital temperature sensor DS18B20 for design, it can meet the requirements of real-time temperature detection. At the same time, through the display function of the 1602LCD, uninterrupted temperature display can be achieved. Its overall design block diagram is as follows:

 

Figure 1: Overall design diagram

Section 1 Introduction to AT89C51

AT89C51 is a low-power, high-performance CMOS 8-bit microcontroller produced by ATMEL Corporation of the United States. It contains 4kbytes of programmable Flash read-only program memory, is compatible with the standard 8051 instruction system and pins, and integrates Flash program memory. It can be programmed online (ISP) or by traditional methods. Therefore, the low-priced AT89C51 microcontroller can be used in many cost-effective occasions and can be flexibly applied to various control fields. It is sufficient for simple temperature measurement systems. The microcontroller AT89C51 has the characteristics of low voltage power supply and small size. Only two of the four ports can meet the design needs of the circuit system. It is very suitable for the design and use of portable handheld products. The system can be powered by two batteries. The pin arrangement of the chip AT89C51 is shown in Figure 2:

 

Figure 2: AT89C51 MCU pin diagram

Section 2 Design of crystal oscillator circuit

The design of the single-chip crystal oscillator circuit is shown in Figure 3. XTAL1 (X1) is the input of the reverse oscillation amplifier and the input of the internal clock working circuit. According to the theory, AT89C51 uses a 12MHz crystal oscillator, but the actual measurement uses 11.0592MHz. Therefore, designers usually use 11.0592MHz. 

 

Figure 3: MCU crystal oscillator circuit

Section 3 Design of Temperature Acquisition Circuit

DALLAS' latest single-wire digital temperature sensor DS18B20 is a new type of "one-wire device" with a smaller size, more suitable for a variety of occasions, wider applicable voltage and more economical. DALLAS Semiconductor's digital temperature sensor DS18B20 is the world's first temperature sensor that supports the "one-wire bus" interface. The temperature measurement range is -55 to +125 degrees Celsius, and it can be programmed to 9 to 12 bits of conversion accuracy. The temperature measurement resolution can reach 0.0625 degrees Celsius. The resolution setting parameters and the alarm temperature set by the user are stored in the EEPROM and are still saved after power failure. The measured temperature is serially output in the form of a 16-bit digital quantity with symbol extension; its working power supply can be introduced at the remote end or generated by parasitic power supply; multiple DS18B20 can be connected in parallel to 3 or 2 lines, and the CPU only needs one port line to communicate with many DS18B20s, occupying fewer ports of the microprocessor, which can save a lot of leads and logic circuits. Therefore, it is used to form a temperature measurement system with simple lines. On one communication line, many such digital thermometers can be hung, which is very convenient. The temperature acquisition circuit of this design is shown in Figure 4.

 

Figure 4: Temperature acquisition circuit diagram

Section 5 Design of Temperature Display Circuit

The display is often used as the simplest output device of the single-chip microcomputer to display the operation results and operation status of the single-chip microcomputer. Commonly used displays are mainly LED and LCD, which have the advantages of low power consumption, low cost, simple circuit, long life, etc., and are widely used in occasions where the single-chip microcomputer displays digital quantities. LCD display is used in the design. Liquid crystal display (LCD) has the characteristics of low power consumption, small size, light weight and low power consumption. The dot matrix character liquid crystal display integrates the LCD controller, dot matrix driver, and character memory on a printed circuit board to form an easy-to-use liquid crystal module. This type of liquid crystal module can not only display numbers and characters, but also various graphic symbols and a small number of custom symbols, and can realize the functions of scrolling the screen up and down, left and right, and flashing text. The human-computer interface is friendly, and the operation is more flexible and convenient, making it increasingly the first choice for various instruments and other equipment. Figure 5 is the display circuit diagram of this design.

 

Figure 5: Display circuit diagram

Section 6 Application Software Introduction

This design mainly uses Proteus simulation software and Keil compilation software.

This design mainly uses Proteus simulation software and Keil compiler software 4.1.1 Introduction to Proteus 

Proteus software is an EDA tool software published by Labcenter electronics in the UK. It not only has the simulation function of other EDA tool software, but also can simulate single-chip microcomputers and peripheral devices. It is currently the best tool for simulating single-chip microcomputers and peripheral devices. Although it has just started to be promoted in China, it has been favored by single-chip microcomputer enthusiasts, teachers engaged in single-chip microcomputer teaching, and scientific and technological workers dedicated to single-chip microcomputer development and application. Proteus is a world-renowned EDA tool (simulation software). From principle layout, code debugging to single-chip microcomputer and peripheral circuit collaborative simulation, one-click switching to PCB design, it truly realizes the complete design from concept to product. It is currently the only design platform in the world that combines circuit simulation software, PCB design software and virtual model simulation software. Its processor models support 8051, HC11, PIC10/12/16/18/24/30/DsPIC33, AVR, ARM, 8086HE MSP430, etc. In 2010, Cortex and DSP series processors will be added, and other series processor models will continue to be added. In terms of compilation, it also supports multiple compilers such as IAR, Keil and MPLAB.


Keil C51 is a 51 series compatible microcontroller C language software development system produced by Keil Software in the United States. Compared with assembly language, C language has obvious advantages in function, structure, readability and maintainability, so it is easy to learn and use. Keil provides a complete development solution including C compiler, macro assembly, connector, library management and a powerful simulation debugger, and combines these parts through an integrated development environment (uVision). Running Keil software requires WIN98, NT, WIN2000, WINXP and other operating systems. If you use C language programming, then Keil is almost your only choice. Even if you do not use C language but only use assembly language programming, its convenient and easy-to-use integrated environment and powerful software simulation debugging tools will make you get twice the result with half the effort.


System test status

When entering the test, the switch is not closed, and the system defaults to displaying the currently collected temperature on the 1602 LCD. When the temperature changes, the system collects the temperature of the DS18B20 in real time and displays it. When the collected temperature exceeds the upper or lower limit set by the system, the system automatically alarms, the switch is closed, and the upper and lower limits of the alarm temperature are displayed. The comprehensive simulation diagram is shown in Figure 6:

[1] [2]
Reference address:Design of Intelligent Temperature Monitoring System Based on Single Chip Microcomputer

Previous article:Design of LCD1602 electronic clock based on single chip microcomputer
Next article:Design of electronic clock based on single chip microcomputer

Latest Microcontroller Articles
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号