5728 views|0 replies

1782

Posts

0

Resources
The OP
 

DS1820 and the Implementation of High-precision Temperature Measurement [Copy link]

In the traditional analog signal long-distance temperature measurement system, it is necessary to solve the technical problems such as lead error compensation, multi-point measurement switching error and amplifier circuit zero drift error in order to achieve a higher measurement accuracy. When we developed a real-time monitoring system for the bearing temperature of a hydro-turbine generator set for a hydropower station, in order to overcome the three problems mentioned above, we adopted a new digital temperature sensor DS1820. On the basis of a detailed analysis of its temperature measurement principle, we proposed a method to improve the measurement accuracy of DS1820, which increased the measurement accuracy of DS1820 from 0.5℃ to more than 0.1℃, and achieved a good temperature measurement effect.

  1 Introduction to DS1820

  DS1820 is a networkable digital temperature sensor produced by DALLAS Semiconductor Company in the United States. It uses the patented on-board (ON-BOARD) technology. All sensor elements and conversion circuits are integrated in an integrated circuit shaped like a triode. Compared with other temperature sensors, DS1820 has the following characteristics:

  (1) Unique single-wire interface mode. When DS1820 is connected to a microprocessor, only one port line is needed to realize two-way communication between the microprocessor and DS1820.

  (2) DS1820 supports multi-point networking function. Multiple DS1820 can be connected in parallel on a single three-wire line to realize multi-point temperature measurement.

  (3) DS1820 does not require any peripheral components during use.

  (4) Temperature range is -55℃~+125℃, and the inherent temperature measurement resolution is 0.5℃.

  (5) The measurement results are transmitted serially in the form of 9-bit digital quantity.

  The internal structure block diagram of DS1820 is shown in Figure 1.





  The temperature measurement principle of DS1820 is shown in Figure 2. The oscillation frequency of the low temperature coefficient crystal oscillator in the figure is little affected by temperature and is used to generate a fixed frequency pulse signal to be sent to counter 1. The oscillation rate of the high temperature coefficient crystal oscillator changes significantly 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℃. Counter 1 counts the pulse signal generated by the low temperature coefficient crystal oscillator by subtraction. When the preset value of counter 1 is reduced to 0, the value of the temperature register will be increased by 1, the preset of counter 1 will be reloaded, and counter 1 will start counting the pulse signal generated by the low temperature coefficient crystal oscillator again. This cycle will continue until counter 2 counts to 0, and the accumulation of the temperature register value will stop. At this time, the value in the temperature register is the measured temperature. The slope accumulator in Figure 2 is used to compensate and correct the nonlinearity in the temperature measurement process, and its output is used to correct the preset value of counter 1.





  Under normal temperature measurement conditions, the temperature measurement resolution of DS1820 is 0.5℃ and is expressed in 9-bit data format, of which the least significant bit (LSB) is compared by the comparator at 0.25℃. When the residual value in counter 1 is converted into temperature and is lower than 0.25℃, the lowest bit (LSB) of the temperature register is cleared. When the residual value in counter 1 is converted into temperature and is higher than 0.25℃, the lowest bit (LSB) of the temperature register is set. For example, the 9-bit data format corresponding to -25.5℃ is as follows:

  2 Ways to improve the temperature measurement accuracy of DS1820

  2.1 Theoretical basis for high-precision temperature measurement of DS1820

  The temperature measurement resolution of DS1820 during normal use is 0.5℃, which is slightly insufficient for the temperature monitoring of the bearing of a hydro-turbine generator set. Based on a detailed analysis of the temperature measurement principle of DS1820, we adopt the method of directly reading the internal temporary register of DS1820 to increase the temperature measurement resolution of DS1820 to 0.1℃~0.01℃.

  The distribution of the internal temporary registers of DS1820 is shown in Table 1. The 7th byte stores the remaining count value of counter 1 when the temperature register stops increasing in value, and the 8th byte stores the count value corresponding to each degree. In this way, we can obtain high-resolution temperature measurement results through the following method. First, use the read temporary register instruction (BEH) provided by DS1820 to read the temperature measurement result with a resolution of 0.5℃, then cut off the least significant bit (LSB) in the measurement result to obtain the integer part of the actual temperature measured, Tinteger, and then use the BEH instruction to read the count residual value Mremainder and the count value per degree Mperdegree of counter 1. Taking into account the relationship that the integer part of the temperature measured by DS1820 has 0.25℃ and 0.75℃ as the carry limit, the actual temperature Tactual can be calculated using the following formula:

  Tactual=(Tinteger-0.25℃)+(Mperdegree-Mremainder)/Mperdegree





  2.2 Comparison of measurement data

  Table 2 compares the temperature measurement data obtained by directly reading the temperature measurement results and by the calculation method. Through comparison, it can be seen that the calculation method is not only feasible in DS1820 temperature measurement, but can also greatly improve the temperature measurement resolution of DS1820.

  3. Precautions for using DS1820

  Although DS1820 has the advantages of simple temperature measurement system, high temperature measurement accuracy, convenient connection, and less occupied port lines, the following issues should be noted in actual application:

  (1) Small hardware overhead requires relatively complex software to compensate. Since serial data transmission is used between DS1820 and microprocessor, the read and write timing must be strictly guaranteed when programming DS1820, otherwise the temperature measurement results will not be read. When using high-level languages such as PL/M and C for system programming, it is best to use assembly language to implement the DS1820 operation part.

  (2) The number of DS1820s hanging on a single bus is not mentioned in the relevant information of DS1820, which easily makes people mistakenly believe that any number of DS1820s can be hung, which is not the case in actual application. When more than 8 DS1820s are hung on a single bus, the bus driver problem of the microprocessor needs to be solved. This should be paid attention to when designing a multi-point temperature measurement system.

  (3) The bus cable connecting DS1820 has a length limit. In the experiment, when the transmission length of ordinary signal cable exceeds 50m, the temperature measurement data read will be wrong. When the bus cable is changed to a twisted pair with shielded cable, the normal communication distance can reach 150m. When a twisted pair with shielded cable with more twists per meter is used, the normal communication distance is further extended. This situation is mainly caused by the distortion of the signal waveform caused by the bus distributed capacitance. Therefore, when designing a long-distance temperature measurement system using DS1820, the bus distributed capacitance and impedance matching issues must be fully considered.

  (4) In the design of the DS1820 temperature measurement program, after sending a temperature conversion command to the DS1820, the program always waits for the return signal of the DS1820. Once a DS1820 has poor contact or is disconnected, when the program reads the DS1820, there will be no return signal and the program will enter an infinite loop. This point should also be given certain attention when performing DS1820 hardware connection and software design.
This post is from Test/Measurement
 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list