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.
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
- Popular Resources
- Popular amplifiers
- Wireless Sensor Network Technology and Applications (Edited by Mou Si, Yin Hong, and Su Xing)
- Modern Electronic Technology Training Course (Edited by Yao Youfeng)
- Modern arc welding power supply and its control
- Small AC Servo Motor Control Circuit Design (by Masaru Ishijima; translated by Xue Liang and Zhu Jianjun, by Masaru Ishijima, Xue Liang, and Zhu Jianjun)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- [Zero-knowledge ESP8266 tutorial] Advanced 3 SSDP Simple Service Discovery Protocol
- DC 48V60V72V85V to 5V2A 12V2A switching power supply circuit
- SST25 series memory architecture issues
- Working conditions of three states of circuit
- EEWORLD University Hall----2022 Digi-Key KOL Series: Teensy - 1GHz MCU
- DSP28 fir low-pass filter design source code
- ZigBee wireless communication--BasicRF wireless point-to-point communication
- EEWORLD University Hall----TI Precision Labs?-? ADC: 7.1 SAR ADC power regulation
- Mbed Developer Survey 2020
- C28x Filter Library User Experience