Design and simulation of digital thermometer based on PIC microcontroller

Publisher:老实巴交的大叔Latest update time:2014-09-05 Source: eefocusKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
0 Introduction

Temperature detection and control are often used in daily life. Traditional temperature measuring elements include thermocouples and thermal resistors. Thermocouples and thermal resistors generally measure voltage. When converting to the corresponding temperature, more hardware support is required. The hardware circuit is very complex, the software debugging is also complex, and the production cost is high. Moreover, the measured temperature accuracy is not as high as that of mature temperature sensors.

This paper designs a digital thermometer based on PIC microcontroller, directly uses the digital temperature sensor DS18B20, and uses the microcontroller to control 18B20 to measure the temperature. The display part can use LCD1602, and the microcontroller can directly drive LCD1602 to display the temperature. The hardware is relatively simple and stable. DS18B20 uses single bus technology, which is easy to expand, and has the advantages of fast conversion speed, high conversion accuracy, and the temperature can be directly read and displayed by the microcontroller.

1. Design goals and ideas

This paper adopts the USART asynchronous communication mode of PIC16F877, which can be widely used in communication between microcontrollers and PCs, and between microcontrollers. The USART interface consists of two pins, RC6 and RC7. RC6 is used to send data, and RC7 is used to receive data.

When the microcontroller needs to send data through USART, it only needs to send the data to the data buffer register TXERG, and then the system will automatically send the content of the TXREG register to the transmit shift register TSR. Then the system will send it out from high to low through the RC6 pin according to the set baud rate pulse signal. When the system loads the content of the TXERG register into TSR, it will automatically set the interrupt send flag TXIF, and decide whether to enter the interrupt according to the program. When the microcontroller needs to receive data through USART, the data is sent to the receive shift register RSR in sequence through the RC7 pin. When a stop bit is received, the shift register RSR automatically sends the received 8-bit data to the receive data buffer RCREG. After the receive data buffer RCREG receives a stable data, the receive interrupt flag RCIF will be automatically set, and decide whether to enter the interrupt according to the program.

2. Principle structure diagram

This paper uses PIC16F877 and DS18B20 sensor to design a thermometer, which includes the main controller part, temperature display part, sensor test part and button design part.

The principle circuit diagram of the thermometer based on PIC16F877 is shown in Figure 1.

 



Among them, S1 of the power supply part is the reset button. It opens when it is pressed and then automatically closes. At the moment of opening and closing, the power supply voltage of each chip in the whole circuit is reduced from 5V to 0V and then increased to 5V, thereby achieving the purpose of reset. The input capacitor C2 is generally not connected, but when the integrated voltage regulator is far away from the rectification and filtering circuit, a 0.33μf capacitor should be connected. Its function is to improve the ripple and suppress the transient overvoltage of the input, ensuring that the voltage difference between the input and output of the 78L05 does not exceed the allowable value. The output capacitor C3 generally does not use a large-capacity electrolytic capacitor. As long as a 0.1μf capacitor is connected, the transient response of the load can be improved. However, in order to reduce the output ripple voltage, a large-capacity electrolytic capacitor C4 connected in parallel at the output end will achieve better results. However, this will lead to a disadvantage: once the input of 78L05 is short-circuited, the charge stored on the large capacitor at the output will be discharged through the emitter and base of the integrated regulator's internal circuit adjustment tube. Since the large-capacity capacitor releases a large amount of energy, it will damage the integrated regulator's internal adjustment tube, causing the circuit to fail to work. To prevent this, a diode is connected between the input and output of 78L05, which provides a shunt path for the discharge of the charge on C4 and protects the integrated regulator. The

serial port receiving temperature function flow chart is shown in Figure 2.

 

3. Protues simulation debugging

In order to debug and verify the correctness and rationality of the above circuit schematic, this paper uses Protues software simulation to debug the waveform.

In the process of simulation debugging, the DS18B20 temperature measurement module, LCD1602 display module, PIC microcontroller USART module communication, etc. were simulated and tested respectively. After each part is tested correctly, the overall circuit is tested. Figure 3 shows the simulation debugging and testing of the temperature measurement part in this paper.

 



From the simulation results of Protues, the digital temperature measurement circuit designed in this paper takes PIC16F877 microcontroller as the core of the working processor, connects DS18B20 and LCD1602, processes digital signals with the microcontroller, and then sends them to the display for display. After repeated simulation debugging and testing, it is verified that it is convenient to use and the results are simple and easy to read.

IV. Conclusion

This paper uses PIC16F877 microcontroller and DS18B20 sensor to design a digital temperature measurement circuit, which mainly includes several parts such as main controller, temperature display, sensor test and button design. On the basis of theoretical design, Protues software is used to simulate, debug and test it. At the same time, if its functions are expanded on the basis of this article, such as multi-point temperature measurement, temperature alarm, etc., it only needs to adjust the PIC microcontroller program. In this way, the temperature measurement system designed in this paper has the advantages of simple circuit and convenient maintenance, as well as good expansion compatibility, accurate and easy reading, which can meet the general basic requirements of thermometers in daily life.

Keywords:MCU Reference address:Design and simulation of digital thermometer based on PIC microcontroller

Previous article:Design of contactless RFID reader/writer system
Next article:Resistance and capacitance measuring instrument based on single chip microcomputer

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

Power-off protection of microcontroller memory information
  In a computer system, whether using dynamic RAM or static RAM, its biggest disadvantage is that the information stored in it will disappear after the power is turned off. Even a momentary power outage will cause all the information stored to be lost. If the computer is in the process of running, its original data and
[Microcontroller]
Power-off protection of microcontroller memory information
MCU_C language function_interrupt function (interrupt service routine)
      Before we start writing the interrupt function, let's review the interrupt system of the microcontroller.       We will not explain the meaning of interrupt here (students who have studied microcomputer principles and interface technology, even if they have not studied single-chip microcomputers, should know it)
[Microcontroller]
Microcontroller C51 memory type and storage mode
  Microcontrollers are an integrated circuit chip that uses very large-scale integrated circuit technology to combine a central processing unit (CPU) with data processing capabilities, random access memory (RAM), read-only memory (ROM), various I/O ports, interrupt systems, and timers. /Counter and other functions int
[Microcontroller]
Microcontroller C51 memory type and storage mode
[MCU framework][BSP layer][nrf51822][nrf51422][nrf51802][bsp_led] LED configuration and use
LED This article will introduce NRF51 and how to light up an LED. Download the official manual: https://infocenter.nordicsemi.com/pdf/nRF51802_PS_v1.2.pdf https://infocenter.nordicsemi.com/pdf/nRF51822_PS_v3.4.pdf https://infocenter.nordicsemi.com/pdf/nRF51422_PS_v3.3.pdf /*****************************************
[Microcontroller]
Nuvoton N76E003+GPRS MCU reset troubleshooting notes
Application Scenario The GPRS module uses AIR202/AIR208, and the power supply solution is JW5033; The single chip microcomputer uses Nuvoton N76E003, dual serial ports, 18K flash, and the power supply shares a 5V input power supply with the GPRS DCDC, namely JW5033. Problem Description When GPRS is connected to th
[Microcontroller]
Nuvoton N76E003+GPRS MCU reset troubleshooting notes
Design of LED digital display tube control by AT90S8515 single chip microcomputer
1. Circuit The attached figure is a schematic diagram of the circuit for controlling digital display by AT90S8515 (only the circuit for the interface with the digital tube is drawn in the figure, and the rest of the wiring is omitted). The PBO~PB7 of the single-chip microcomputer is connected to the a~h pins of the LE
[Microcontroller]
Design of LED digital display tube control by AT90S8515 single chip microcomputer
Digital temperature sensor DS18B20 data
The digital temperature sensor DS1820 from Dallas Semiconductor in the United States is the world's first temperature sensor that supports the "one-wire bus" interface. It uses the patented on-board (ON-BOARD) technology. All sensor elements and conversion circuits are integrated in an integrated circuit shaped like a
[Microcontroller]
Digital temperature sensor DS18B20 data
With regulation in place, automakers are forced to cut production. When will the shortage of automotive chips end?
"Chip shortage" is not a reason for "chip speculation". With the order from the national regulatory authorities, the rampant speculation has come to an end, and IC workers who have been "suffering for a long time" finally have a weapon to seek justice. Due to multiple factors such as the industry off-season and policy
[Embedded]
With regulation in place, automakers are forced to cut production. When will the shortage of automotive chips end?
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号