At present, in many fields of industrial control , temperature monitoring generally uses a temperature measurement circuit composed of thermistors, and temperature measurement is achieved after A/D and D/A conversion. However, due to the instability of thermistors, temperature measurement is easily affected by external interference and has low accuracy.
DS18B20 digital temperature sensor is a 1-Wire device produced by Dallas, which has the characteristics of simple circuit and small size. Therefore, it is very convenient to use it to form a temperature measurement system with simple circuit. Many such digital temperature sensors can be connected to one communication line.
DS18B20 performance characteristics
1 DS18B20 Features and Pinout
The temperature measurement range of DS18B20 is -55~+125℃; the conversion accuracy is 9~12 digits, and the number of digits to be converted can be determined programmably; the temperature measurement resolution is 0.5℃ for 9-bit accuracy and 0.0625℃ for 12-bit accuracy; the conversion time is 93.75ms for 9-bit accuracy, 187.5ms for 10-bit accuracy and 750ms for 12-bit accuracy; there are internal upper and lower temperature limit alarm settings. DS18B20 adopts TO-92 packaging mode, and its pin function description is shown in Table 1.
2 Internal structure of DS18B20
The internal structure of DS18B20 is shown in the figure. It mainly includes temperature sensor, 64-bit laser ROM single-line single-port, high-speed register for storing intermediate data, upper and lower temperature limits set by the user, trigger storage and control logic, 8-bit cyclic redundancy check code generator, etc.
Single bus technology features
A single bus has only one data line, and the data exchange and control of the system are completed by this line. The host or slave is connected to the data line through an open-drain or tri-state port to allow the device to release the bus when it is not sending data, and let other devices use the bus. All single-bus devices must follow a strict communication protocol to ensure data integrity. The basic communication process is as follows: The host generates a Tx reset pulse by pulling down the single bus for at least 480μs; then the host releases the bus and enters the Rx receiving mode. When the host releases the bus, a rising edge from a low level to a high level will be generated; after the single-bus device detects the rising edge, it will delay 15 to 60μs; the single-bus device generates a response pulse by pulling down the bus for 60 to 240μs; after the host receives the response pulse from the slave, it indicates that a single-bus device is online, and then the host can start to perform ROM commands and function commands on the slave.
Based on DS18B20 high-precision digital temperature sensor
Based on the DS18B20 high-precision digital temperature sensor, the following functions can be completed:
(1) Using AT89S52 single-chip microcomputer and DS18B20 temperature sensor to communicate, control the temperature collection process and perform data communication;
(2) Provide the peripheral circuits for DS18B20, the temperature display LED circuit, and the communication interface circuit between DS18B20 and the microcontroller;
(3) The light-emitting diode is used to indicate the working status of the system, and the DS18B20 temperature sensor has built-in upper and lower temperature limits;
(4) Write a C51 program to complete the microcontroller's temperature data collection process and control the data transmission process with the DS18B20.
system design
1 System Analysis
The basic structure diagram of the high-precision digital thermometer based on the single-chip microcomputer system is shown in Figure 2.
The main functional modules of high-precision digital thermometers are divided into three categories:
Under certain requirements, input control adopts a certain form of control method to realize the conversion of different functions of the thermometer, and the control instructions are transmitted to the microcontroller in a certain way.
The LED digital display microcontroller sends the digital temperature value to the LED display module and controls the LED display module to display in a certain format.
The data acquisition microcontroller completes the storage and reading of data through the read and write operations on DS18B20, thereby realizing the data processing of the storage unit of the microcontroller.
2 Hardware Circuit
According to the control requirements of the system, Intel's 80C52 single-chip microcomputer is selected, which includes data acquisition, data processing, crystal oscillator reset and temperature display circuit of digital temperature sensor.
3. Software Design
The software design based on DS18B20 digital temperature sensor uses C51 to write the program, which mainly completes the measurement temperature value calculation and temperature value display function of DS18B20. It adopts modular design, and the program design includes system initialization, reset program, temperature reading program, temperature conversion program, digital tube display program and delay program. Its overall flow chart is shown in Figure 3.
Conclusion
The digital temperature sensor based on DS18B20 single bus technology has an incomparable application prospect due to its simple circuit, low hardware overhead, low cost and simple software design. It can better solve the shortcomings of traditional temperature measurement devices such as inconvenience in carrying, easy damage and susceptibility to interference, and can be widely used in industrial control.
Previous article:Dormitory intelligent fire and theft alarm system designed with 51 single chip microcomputer
Next article:Design of a portable colorimeter based on a dual-mode USB interface
Recommended ReadingLatest update time:2024-11-15 10:41
- Popular Resources
- Popular amplifiers
- 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)
- Single-chip microcomputer technology and application - electronic circuit design, simulation and production (edited by Zhou Runjing)
- Principles and Applications of Single Chip Microcomputers and C51 Programming (3rd Edition) (Xie Weicheng, Yang Jiaguo)
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
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
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- What is the difference between low inertia and high inertia of servo motors?
- Application Examples of Portable Spectrum Analyzers for Radio Signal Monitoring
- Mentor Online Seminar丨Advanced Application of FPGA Simulation Verification Platform ModelSim
- [Xianji HPM6750 Review] HPM SDK Development Environment Construction and Hello World
- Explanation of state machine switching of terminal devices in TI ZigBee protocol stack
- Doomsday wasteland style Bumblebee
- Y capacitor, how to connect it to get the best effect?
- How to choose the right display technology for IoT devices
- New Qorvo IDP President Discusses the Future of RF, MEMS and Power Technologies
- How to choose the right RF module
- 【Review of SGP40】+ Comprehensive demo