DS18S20温度传感器的高精度测温及校正算法
2014-12-13安凯
安凯
摘 要: 文献[1]中给出一种DS18S20数字式温度传感器测温修正算法,但这种算法还不能充分利用DS18S20寄存器所给出的数据,最大限度地反映温度传感器的测量数值。其次是没有考虑算法给出的温度的校准问题,这里提出一种精确的测温算法,可以无误差地表示传感器给出的温度值,同时还研究了传感器输出值的校准问题,给出了基于最小二乘法的校准公式。在仿真过程中,以高精度的测温仪器为标准,给出了算法的校正公式,结果表明校正公式的误差优于0.01 ℃。
关键词: DS18S20; 测温; 传感器; 校正
中图分类号: TN62?34; TK311 文献标识码: A 文章编号: 1004?373X(2014)23?0097?03
Algorithm of high?precision temperature measurement
and calibration for temperature sensor DS18S20
AN Kai
(Shandong Aerospace Electro?technology Institute, Yantai 264670, China)
Abstract: An algorithm on temperature measurement calibration for the digital temperature sensor DS18S20 is proposed in Reference [1], but it can′t make full use of the data given by DS18S20 registers to represent the temperature value from the sensor exactly. In addition, the algorithm does not pay attention to the calibration of temperature measurement. A accurate algorithm for temperature measurement is presented in this paper, which can derive the temperature values from the DS18S20 sensor. The calibration of temperature output value of DS18S20 is investigated in this paper. The calibration expression based on the least square method is offered. By dint of the measuring instrument with high precision, the calibration expression was developed. The simuliation results indicate that the calibration expression can greatly improve the measurement precision, and its measurement error is less than 0.01℃.
Keywords: DS18S20; temperature measurement; sensor; callibration
0 引 言
目前,测量温度都是采用间接测量的方法,即利用温度传感器的性能随温度而变化的特性,通过测量该性能参数得到被测温度的大小[2]。用以测量温度的特性有材料的热膨胀、电阻、热电动势、导磁率、介电系数、光学特性、弹性等[3]。温度传感器的选用是高精度测温的重要环节。在温度测量时由于被测对象常常远离测试设备,传统的模拟温度传感器与测试设备之间的导线的电阻值随环境温度产生变化,而流过传感器的工作电流在导线电阻上产生的电压将迭加在传感器的输出信号上,成为无法消除的原始误差,这种误差会严重制约温度测量精度[4?7]。此外,多点测量切换和放大电路零点漂移也将严重影响温度测量精度[8]。由于模拟温度传感器存在上述不足,新型温度传感器的研究与应用正从模拟式向数字式方向发展[9?10]。……
