A Simple Method For Calibration of Temperature Sensor DS18B20 Waterproof in Oil Bath Based On Arduino Data Acquisition System

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

A simple method for calibration of

temperature sensor DS18B20 waterproof in


oil bath based on Arduino data acquisition
system
Cite as: AIP Conference Proceedings 2062, 020006 (2019); https://doi.org/10.1063/1.5086553
Published Online: 25 January 2019

R. A. Koestoer, Y. A. Saleh, I. Roihan, et al.

ARTICLES YOU MAY BE INTERESTED IN

A simple calibration methods of relative humidity sensor DHT22 for tropical climates based on
Arduino data acquisition system
AIP Conference Proceedings 2062, 020009 (2019); https://doi.org/10.1063/1.5086556

Analysis of temperature stabilization in grashof incubator with environment variations based


on Indonesian national standard (SNI)
AIP Conference Proceedings 2062, 020003 (2019); https://doi.org/10.1063/1.5086550

Numerical investigation of temperature distribution in a water cooling tank under natural


convection
AIP Conference Proceedings 2062, 020010 (2019); https://doi.org/10.1063/1.5086557

AIP Conference Proceedings 2062, 020006 (2019); https://doi.org/10.1063/1.5086553 2062, 020006

© 2019 Author(s).
A Simple Method for Calibration of Temperature Sensor
DS18B20 Waterproof in Oil Bath Based on Arduino Data
Acquisition System
R. A. Koestoera), Y.A. Saleh, I. Roihan, Harinaldi

Heat Transfer Laboratory, Department of Mechanical Engineering, Faculty of Engineering, Universitas Indonesia
Kampus Baru – UI, Depok, 16424, Indonesia

Corresponding author: a)[email protected]

Abstract. The combination between DS18B20 Waterproof temperature sensor and Arduino has been recently used as a
data acquisition (DAQ) system on a temperature measurement for its user-friendly and relatively affordable price.
Arduino can be a valid data acquisition device if the sensor is perfectly calibrated. This research proposed a calibration
method for a temperature sensor DS18H20 Waterproof based on Arduino Uno using a thermometer calibrator ASTM
117C which value could be traced by a calibration medium of oil in an open surface bath. The election of oil as the
medium is aimed to reduce its conditional instability so that the calibration could be done. There are 12 arranged
DS18B20 waterproof sensors that will be calibrated alongside the ASTM 117C calibrator so that all the measurement
points have the exact identical conditions. Such a system was done for having the small deviation characteristics between
the oil temperature measured on the DS18B20 Waterproof sensor to the ASTM 117C mercury thermometer. The small
deviation characteristics that presented as a linear equation is obtained by using a linear regression method. Calibration
was done by using the ambient temperature as the energy to calibrate the sensors. The movement of ambient temperature
will cause temperature slowly movement response on the medium (oil) and resulted a measurement points. DS18B20
waterproof sensors resulted a mean error of ± 3.00 % before calibration begun. Meanwhile after the calibration using the
proposed method, the DS18B20 sensor has a smaller mean error of ± 0.85 %, so that obtained a more accurate sensor and
it can be used for testing of Grashof Portable Incubator made by University of Indonesia.

INTRODUCTION

Temperature is one of the main parameters in a baby incubator. In this research, the author made data acquisition
system for temperature measurements based on Arduino combined with DS18B20 Waterproof temperature sensors.
Arduino has good reliability, robustness, stable connection, low price and can be used as a system control from
various levels of system complexity [1]. Arduino can be a valid acquisition data device if the sensor is properly
calibrated [2]. Researchers have used a combination of DS18B20 Waterproof sensors with Arduino because of their
easy use and relatively inexpensive device prices. Nevertheless, not many know the effect of the error level
generated by the sensor. In case of measurements with small measurement range, the error value will have a
significant effect, such as on a baby incubator that has a working range 3Ԩ- 4Ԩ. Therefore, calibration method is
proposed to calibrate the DS18B20 Waterproof sensor using oil bath with ASTM 117C thermometer calibrator that
has better accuracy and precision. This calibration method aims to reduce error level of DS18B20 Waterproof sensor
by using oil bath as a calibration medium compared to ASTM 117C thermometer. With the results of calibration, a
sensor that has better accuracy can be obtained. therefore it can create a cheap data acquisition with a trustworthy
error value [3].

The 10th International Meeting of Advances in Thermofluids (IMAT 2018)


AIP Conf. Proc. 2062, 020006-1–020006-8; https://doi.org/10.1063/1.5086553
Published by AIP Publishing. 978-0-7354-1790-8/$30.00

020006-1
METHODOLOGY

Materials
DS18B20 Waterproof sensor operates in range of temperature -55 °C to +125 °C with ± 0.5 °C error at -10 °C to
+ 85 °C and has an 0.0625 °C acurracy [4]. Linear scale of voltage and temperature of the sensor is +10.0mV/° C
[5]. While ASTM 117C thermometer that used as a calibrator has 23.9oC - 30.1oC measurement range with a 0.01
O
C accuracy. Data retrieval is carried out in two different places in order to maximize the measurement range of
ASTM 117C considered as true value. First research site`s in Depok, West Java, the measured oil conditions were
25 ° C-30 °C., then data collection is carried out in Lembang, Bandung which has a lower ambient temperature in
order to reach the lowest temperature ASTM 117C. After data collection, oil conditions were found in all ASTM
117C measurement ranges. Data collection time in this research can be done at any time and not limited to weather
conditions. Changes on temperature movements of this environment will affect oil temperature and obtain
measurement points.

Calibration Tool
In this research, the author conducted 3 main stages of research, namely stage of making a calibration tool,
calibration process, and analyzing calibration results. First, the author makes a research apparatus to collect data.
The calibration tool is arranged as follows:

Bath

Oil

FIGURE 1. Calibration Tool with millimeters unit


The experiment uses Arduino Uno with a maximum of 12 digital input pins that can be utilized with 12
DS18B20 Waterproof sensors at same time. The sensors were immersed in 4 liter volume oil bath together with a
ASTM117C mercury thermometer. Oil media selection aims to reduce the instability of the calibration media
conditions, therefore calibration can be done [6]. The sensors were arranged in a circle and thermometer is in the
center of sensors arrangement so that they were at a parallel depth and measure same conditions.

Calibration Process
The measured data is the temperature of DS18B20 Waterproof sensor automatically carried out by Arduino
instead of ASTM 117C and environmental temperature were carried out manually. Date and time of data retrieval
also need to be noted therefore data collection has the same measurement conditions. The error values between the
sensor and the calibrator will be obtained from those data. Error characteristic was expressed by linear equation

020006-2
obtained from regression. After that, the regression line equation is analyzed by showing the uncertainty parameters
such as deviation, confidence interval and coefficient of determination [7]. These parameters serve to express and
assess whether the calibration method can be accepted scientifically.

Analyze Calibration Result


Regression line equation then used to find calibration equation using the inverse principle. Calibration equation
then entered into Arduino program for calibrating DS18B20 Waterproof sensor reading closed to ASTM 117C
temperature that we trust as true value. To prove whether the calibration equation can be used, data is retrieved again
with a new calibration program. After that, analyze the error between sensors, % error between grouped sensor and
thermometer, and the regression parameters before and after calibration.

RESULTS

Data Before Calibration


FIGURE 2 is a graph of oil temperatures from ASTM 117C Thermometers, 12 DS18B20 Waterproof sensors
and ambient temperatures before calibration has done. This data is a group of several data collection times. The
range of oil temperature data obtained is from 23.9 ° C to 30.1 ° C meet the ASTM 117C working range. In
FIGURE 2 can be shown the temperature data of the environment range is 20 °C-31 ° C. Environmental
temperature movements will affect oil temperature and obtain measurement points. Movement from ambient
temperature is fluctuating and cannot be controlled. While the movement of oil temperature gives a slow and more
stable (non-fluctuating ) response not following environmental temperature movements. So that calibration can be
carried out under these conditions. This was corresponded with the aim of selection oil as calibration media to
reduce the instability. Then from FIGURE 2 can be analyzed the rhythm of the rise and fall measured temperature
movement were same for each DS18B20 Waterproof sensor to ASTM 117C thermometer. Therefore there is no
dviant pattern between sensors at measured point.

FIGURE 2. Temperature Measured Before Calibration

Measured temperatures of DS18B20 Waterproof sensors were not same each other even though those just been
purchased and have the same specifications and manufacturer. Difference in temperature readings from those 12
sensors will then be combined to find measurement deviations that represent DS18B20 Waterproof sensor in
general. Of all measurements that have been made, there is 0.31 ° C - 0.82 ° C measurement deviations between

020006-3
sensors. In addition, from FIGURE 2 can be analyzed that measured temperature between sensor and thermometer
also have a difference or error. Error value shown by RMS error in percent (%) is the percentage of the root of the
average square of the difference in the value of the temperature measurement by the DS18B20 sensor and ASTM
117C. The value of RMS error before calibration is 3.00% and will be compared with the value RMS error after
calibration.

Determined Error Characteristic Line


From the data obtained, then made temperature graph (o C) sensor DS18B20 Waterproof vs. temperature (o C)
thermometer ASTM 117C to compare the performance of the two measuring devices as in FIGURE 3. Then obtain
deviation equation from DS18B20 Waterproof sensor to ASTM 117C thermometer. Deviation equation obtained is
linear line equation from regression. Linear regression selected because there are no specific physical phenomena
that will be observed from variables x and y but only the performance comparison between two measuring
instruments. Another reason is ASTM 117C thermometer as a calibrator is a mercury thermometer that has linear
characteristics
From FIGURE 3, regression line equation is T DS18B20 = 1.0519TASTM - 2.155. This equation represents the
deviation characteristic of DS18B20 Waterproof sensor against calibrator that is ASTM 117C thermometer. From
the regression model, determination coefficient (R2) value of 0.989 close to 1. R2 value obtained means that 98.9%
of regression lines of this model are considered suitable to explain the deviation characteristics [8]. This regression
equation only applies to the ASTM 117C temperature range of 23.9 oC - 30.1oC. The deviation has zero and
sensitivity drift against ASTM117C temperature line or TDS18B20 = TASTM. Regression line equation needs to be
carried out further analyzes because it has uncertainty, so that regression equation can be assessed and scientifically
accountable. The following is a table of regression equations before calibration.

FIGURE 3. Linear Regression

Uncertainty on Regression Line


The uncertainty of regression line were deviations and confidence intervals on the gradient (m), intersection (b),
regression lines, predictive intervals and the coefficient of determination. From TABLE 1. the percentage deviation
of all these parameters have value below the 5% deviation, so that the calibration equation can be used and can be
accounted for applications in the engineering field.

020006-4
TABLE 1. Regression Parameters

After obtaining and assessing the regression equation which is the equation of the DS18B20 Waterproof sensor
deviation characteristics to ASTM 117C thermometer, then regression equation was used to get calibration
equation9. Calibration equation to modify the output value of the DS18B20 Waterproof sensor using the inverse
principle. This will process the output value read by sensors before it is displayed on the computer, so that
temperature can close to the value thermometer which is trusted as true value or TDS18B20 = TASTM. After that
calibration equation written on the program and uploaded to Arduino then performing calibration command.
Furthermore collecting data to assess the success of calibration method.

Data After Calibration

FIGURE 4. TDS18B20 and TASTM data after calibration

020006-5
Figure 4. is measurement of data after calibration then will be compared to the deviation value and error before
calibration carried out. From data retrieval before and after calibration can be compared the deviation between 12
sensors. Deviation between each sensors before calibration has a range of 0.31 ° C - 0.82 ° C. While after calibration
this is reduced to 0.23 ° C- 0.42 ° C. From these results can be analyzed that the range of temperature measurement
spread by the sensor is tighter, so that it can be concluded that a more precise sensor is obtained. Deviation between
the sensors also decreases up to 0.23 ° C which means that the sensor measurements are more accurate or close to
the true value. Therefore, calibration can get a more precise and accurate sensor.

Error Comparison Analysis

FIGURE 5. TDS18B20 and TASTM data after calibration


Figure 5. is a % error graph of DS18B20 Waterproof sensor against ASTM 117C before and after calibration.
Before the calibration, % RMS error is 3.00% with a range of %error -1.24 up to -4.77%. While after calibration is
done % RMS error is 0.85% with a range of %error -0.80% up to 1.98%. From this results a range of %error
between the sensor and calibrator is closer or in other words the measurement is getting more precise. In addition,
%RMS error was reduced from 3.00% to 0.85% after calibration, so that a more accurate measurement was
obtained. From the %error analysis between sensor and ASTM it can be concluded that the proposed calibration
method is successful to get a more precise and accurate sensor. Apart from these results, from visual graph it can be
analyzed that the sensors are more precise and accurate because % error after calibration is very tight and get closer
to 0% or the value of ASTM 117C.

Regression Parameters Comparison Analysis


After comparing the error or deviation between each sensors and sensors with ASTM 117C then the value of the
regression parameters before and after calibration is performed comparative analysis. Regression is done to look for
the deviation characteristics of the DS18B20 Waterproof sensor against ASTM 117C before calibration and after
calibration. This is to show whether the measurement process can be scientifically accounted for and show
regression model before and after calibration represents all the population of sensor deviation characteristics. . The
results of the calculation and comparison of regression parameters are shown in TABLE 2.

020006-6
TABLE 2. Regression Parameters Comparison

For the determination coefficient of linear regression model from the two processes of measuring data before and
after calibration close to a value of 1 is considered suitable to be able to explain the deviation characteristics of
DS18B20 Waterproof sensor to thermometer ASTM117C. Therefore, the two characteristics of the data that is
before calibration and after calibration can be used and then compared.
From TABLE 2 standard error estimation (sy,x) decreases, standard error estimation is a value that shows the
distribution of taken data from regression line. So that, it can be said that sensors to be more precise because data
distribution is closer to the regression line. Data distribution value after calibration drops by 48.25% from before.
The downfall %deviation value of all parameters indicates that DS18B120 sensor after calibration has a better level
of precision compared to before calibration carried out.

CONCLUSION
This research aims to determine the deviation characteristics of DS18B20 Waterproof sensor to ASTM 117C
thermometer with the proposed method. This method can be used to calibrate the sensor. From the results obtained
characteristics of DS18B20 Waterproof Deviation generally is TDS18B20 = 1.0519ASTM - 2.155. Characteristic
equations are considered acceptable because the deviation of all regression parameters are below 5%. The proposed
calibration method can reduce the RMS error between sensor and thermometer from 3.00% down to 0.85% after
calibrating and reducing the error range between DS18B20 Waterproof sensors from 0.31 ° C - 0.82 ° C down to
0.23 ° C - 0.42 ° C. This calibration method with arduino-based can produce sensors with increased accuracy and
precision. so that obtained a more accurate sensor to be used in testing of Grashof Portable Incubator made by
University of Indonesia.

ACKNOWLEDGEMENTS
This work is supported by Hibah PITTA 2018 funded by DRPM Universitas Indonesia No.
233/UN2.R3.1/PPM.00/2018.

020006-7
REFERENCE

1. M. Matijevic and V. Cvjetkovic, "Overview of architectures with Arduino boards as building blocks for data
acquisition and control systems," in 2016 13th International Conference on Remote Engineering and Virtual
Instrumentation (REV), 2016.
2. A. D'Ausilio, Arduino: A low-cost multipurpose lab equipment, vol. 44, 2012, pp. 305-313.
3. M. A. P. Pertijs, A. L. Aita, K. A. A. Makinwa and J. H. Huijsing, "Low-Cost Calibration Techniques for
Smart Temperature Sensors," IEEE Sensors Journal, vol. 10, no. 6, pp. 1098-1105, 2010.
4. Maxim Integrated, "DS18B20 Data Sheet," 2015. [Online]. Available:
https://datasheets.maximintegrated.com/en/ds/DS18B20.pdf. [Accessed 22 June 2018].
5. J. Egwaile, O. Omoioifo, O. Odia and O. Okosun, "Development of a real time blood pressure, temperature.,"
International Journal of Physical, pp. 225-232., 2016.
6. M. G. Ali, "A Simple Method for the Calibration of an Open Surface Water Bath," IOP Conference Series:
Materials Science and Engineering, vol. 51, no. 1, p. 012015, 2013.
7. D. C. Montgomery, E. A. Peck and G. G. Vining, Introduction to Linear Regression Analysis, John Wiley &
Sons, 2012, p. 645.
8. N. J. D. Nagelkerke, "A Note on a General Definition of the Coefficient of Determination," Biometrika, vol.
78, no. 3, pp. 691-692, 1991.
9. V. Barwick, "Preparation of Calibration Curves (A Guide to Best Practice)," 2003.

020006-8

You might also like