Ds18b20 working principle and temperature measurement principle
Keywords: DS18B20, temperature sensor
DS18B20 is a new intelligent temperature sensor newly developed by DALLAS Semiconductor Company after DS1820. Compared with the traditional thermistor, he can directly read the measured temperature and can realize 9 to 12 digits of digital value reading by simple programming according to actual requirements. The 9-bit and 12-bit digital quantities can be completed in 93.75 ms and 750 ms, respectively. And the information read from the DS18B20 or the information written to the DS18B20 requires only one line (single line interface) to read and write. The temperature conversion power is derived from the data bus, and the bus itself can also supply power to the attached DS18B20 without additional power. Therefore, using the DS18B20 makes the system structure simpler and more reliable. He has greatly improved the temperature measurement accuracy, conversion time, transmission distance, resolution and other aspects of the DS1820, bringing more convenient use and more satisfactory results to the user.
Main features of the DS18B20
1) The adaptive voltage range is 3.0V to 5.5V, which can be powered by the data line in the parasitic power mode.
2) Only one line is required between the DS18B20 and the microprocessor for two-way communication.
3) Support multi-point networking function, multiple DS18B20 can be connected in parallel on the only three lines to achieve multi-point temperature measurement.
4) No external components are required, and all sensing elements and conversion circuits are integrated in a circuit such as a triode.
5) The temperature range is -55 ° C ~ +125 ° C, the accuracy is ± 0.5 ° C at -10 ° C ~ +85 ° C.
6) Programmable resolution is 9 to 12 bits, and the corresponding resolvable temperatures are 0.5 ° C, 0.25 ° C, 0.125 ° C and 0.0625 ° C, respectively, enabling high-precision temperature measurement.
7) At 9-bit resolution, the temperature can be converted to a number of up to 93.75ms, and the temperature value can be converted to a number of up to 750ms at 12-bit resolution.
8) Directly output digital temperature signal, serially transmitted to the CPU by one-line bus, and can transmit CRC check code, which has strong anti-interference and error correction capability.
9) When the polarity of the power supply is reversed, the chip will not burn out due to heat, but it will not work properly.
The DS18B20 follows a single bus protocol. Each temperature measurement must have four processes: initialization, transfer of ROM commands, transfer of RAM commands, and data exchange.
Ds18b20 working principle introduction
The read and write timing and temperature measurement principle of the DS18B20 is the same as that of the DS1820, except that the number of bits of the obtained temperature value varies with resolution, and the delay time during temperature conversion is reduced from 2s to 750ms. The DS18B20 temperature measurement principle is shown in Figure 3. In the figure, the oscillation frequency of the low temperature coefficient crystal oscillator is little affected by the temperature, and a pulse signal for generating a fixed frequency is sent to the counter 1. The high temperature coefficient crystal oscillator changes its oscillation rate with temperature, and the generated signal is used as the pulse input of counter 2.
Counter 1 and the temperature register are preset to a base value corresponding to -55 °C. The counter 1 counts down the pulse signal generated by the low temperature coefficient crystal oscillator. When the preset value of counter 1 is reduced to 0, the value of the temperature register will be incremented by 1, the preset of counter 1 will be reloaded, and counter 1 will restart counting the pulse signal generated by the low temperature coefficient crystal oscillator. This cycle until the counter 2 counts to 0, the accumulation of the temperature register value is stopped, and the value in the temperature register is the measured temperature. The slope accumulator is used to compensate and correct the nonlinearity in the temperature measurement process, and its output is used to correct the preset value of the counter 1.
figure 2
The turn-on time of the count gate is determined by the high temperature coefficient oscillator. Before each measurement, the base number corresponding to -55 °C is first placed in the subtraction counter 1 and the temperature register. The subtraction counter 1 and temperature register are preset to a base value corresponding to -55 °C.
The subtraction counter 1 performs a subtraction counting on the pulse signal generated by the low temperature coefficient crystal oscillator. When the preset value of the subtraction counter 1 is reduced to 0, the value of the temperature register will be incremented by 1, and the preset of the subtraction counter 1 will be reloaded. The subtraction counter 1 restarts counting the pulse signals generated by the low temperature coefficient crystal oscillator. This cycle is repeated until the subtraction counter 2 counts to 0, the accumulation of the temperature register value is stopped, and the value in the temperature register is the measured temperature.
The slope accumulator in Figure 2 is used to compensate and correct for nonlinearities in the temperature measurement process. Its output is used to correct the preset value of the subtraction counter. As long as the counting gate is still not closed, the above process is repeated until the temperature register value reaches the measured temperature value. This is the temperature measurement principle of the DS18B20.
In addition, since the DS18B20 single-line communication function is completed in a time-sharing manner, he has a strict time slot concept, so the read and write timing is very important. The system's various operations on the DS18B20 must be performed in accordance with the protocol. The operating agreement is: Initialize DS18B20 (send reset pulse) → send ROM function command → send memory operation command → process data. The timing diagram for various operations is the same as the DS1820.
DS18B20 is a new intelligent temperature sensor newly developed by DALLAS Semiconductor Company after DS1820. Compared with the traditional thermistor, he can directly read the measured temperature and can realize 9 to 12 digits of digital value reading by simple programming according to actual requirements. The 9-bit and 12-bit digital quantities can be completed in 93.75 ms and 750 ms, respectively. And the information read from the DS18B20 or the information written to the DS18B20 requires only one line (single line interface) to read and write. The temperature conversion power is derived from the data bus, and the bus itself can also supply power to the attached DS18B20 without additional power. Therefore, using the DS18B20 makes the system structure simpler and more reliable. He has greatly improved the temperature measurement accuracy, conversion time, transmission distance, resolution and other aspects of the DS1820, bringing more convenient use and more satisfactory results to the user.
Main features of the DS18B20
1) The adaptive voltage range is 3.0V to 5.5V, which can be powered by the data line in the parasitic power mode.
2) Only one line is required between the DS18B20 and the microprocessor for two-way communication.
3) Support multi-point networking function, multiple DS18B20 can be connected in parallel on the only three lines to achieve multi-point temperature measurement.
4) No external components are required, and all sensing elements and conversion circuits are integrated in a circuit such as a triode.
5) The temperature range is -55 ° C ~ +125 ° C, the accuracy is ± 0.5 ° C at -10 ° C ~ +85 ° C.
6) Programmable resolution is 9 to 12 bits, and the corresponding resolvable temperatures are 0.5 ° C, 0.25 ° C, 0.125 ° C and 0.0625 ° C, respectively, enabling high-precision temperature measurement.
7) At 9-bit resolution, the temperature can be converted to a number of up to 93.75ms, and the temperature value can be converted to a number of up to 750ms at 12-bit resolution.
8) Directly output digital temperature signal, serially transmitted to the CPU by one-line bus, and can transmit CRC check code, which has strong anti-interference and error correction capability.
9) When the polarity of the power supply is reversed, the chip will not burn out due to heat, but it will not work properly.
The DS18B20 follows a single bus protocol. Each temperature measurement must have four processes: initialization, transfer of ROM commands, transfer of RAM commands, and data exchange.
Ds18b20 working principle introduction
The read and write timing and temperature measurement principle of the DS18B20 is the same as that of the DS1820, except that the number of bits of the obtained temperature value varies with resolution, and the delay time during temperature conversion is reduced from 2s to 750ms. The DS18B20 temperature measurement principle is shown in Figure 3. In the figure, the oscillation frequency of the low temperature coefficient crystal oscillator is little affected by the temperature, and a pulse signal for generating a fixed frequency is sent to the counter 1. The high temperature coefficient crystal oscillator changes its oscillation rate with temperature, and the generated signal is used as the pulse input of counter 2.
Counter 1 and the temperature register are preset to a base value corresponding to -55 °C. The counter 1 counts down the pulse signal generated by the low temperature coefficient crystal oscillator. When the preset value of counter 1 is reduced to 0, the value of the temperature register will be incremented by 1, the preset of counter 1 will be reloaded, and counter 1 will restart counting the pulse signal generated by the low temperature coefficient crystal oscillator. This cycle until the counter 2 counts to 0, the accumulation of the temperature register value is stopped, and the value in the temperature register is the measured temperature. The slope accumulator is used to compensate and correct the nonlinearity in the temperature measurement process, and its output is used to correct the preset value of the counter 1.
figure 2
Ds18b20 temperature measurement principle
The temperature measurement principle of DS18B20 is shown in Figure 2. The oscillation frequency of the low temperature coefficient crystal oscillator in the figure is little affected by temperature. A pulse signal for generating a fixed frequency is supplied to the subtraction counter 1. The high temperature coefficient crystal oscillator changes its oscillation frequency with temperature, and the generated signal is used as the pulse input of the subtraction counter 2. The counting gate is also hidden in the figure. When the counting gate is open, the DS18B20 counts the clock pulses generated by the low temperature coefficient oscillator to complete the temperature measurement.The turn-on time of the count gate is determined by the high temperature coefficient oscillator. Before each measurement, the base number corresponding to -55 °C is first placed in the subtraction counter 1 and the temperature register. The subtraction counter 1 and temperature register are preset to a base value corresponding to -55 °C.
The subtraction counter 1 performs a subtraction counting on the pulse signal generated by the low temperature coefficient crystal oscillator. When the preset value of the subtraction counter 1 is reduced to 0, the value of the temperature register will be incremented by 1, and the preset of the subtraction counter 1 will be reloaded. The subtraction counter 1 restarts counting the pulse signals generated by the low temperature coefficient crystal oscillator. This cycle is repeated until the subtraction counter 2 counts to 0, the accumulation of the temperature register value is stopped, and the value in the temperature register is the measured temperature.
The slope accumulator in Figure 2 is used to compensate and correct for nonlinearities in the temperature measurement process. Its output is used to correct the preset value of the subtraction counter. As long as the counting gate is still not closed, the above process is repeated until the temperature register value reaches the measured temperature value. This is the temperature measurement principle of the DS18B20.
In addition, since the DS18B20 single-line communication function is completed in a time-sharing manner, he has a strict time slot concept, so the read and write timing is very important. The system's various operations on the DS18B20 must be performed in accordance with the protocol. The operating agreement is: Initialize DS18B20 (send reset pulse) → send ROM function command → send memory operation command → process data. The timing diagram for various operations is the same as the DS1820.