Evaluating Suitability of a DS18B20 Temperature Sensor for Use in an Accurate Air Temperature Distribution Measurement Network

: We analysed literature data and our experimental results to determine why the readings of different temperature sensors might be notably different in air despite being placed in close proximity. We attributed these differences to two factors—unrestricted air movements and differences in the sensors’ response times. After elimination of these factors, the temperature readings of Pt100 and DS18B20 sensors exhibited an excellent agreement which, together with the convenient networking features provided by the DS18B20 sensors, conﬁrmed their suitability for our use case.


Introduction
Temperature sensors are used for a wide variety of industrial, scientific, medical and domestic purposes, and they differ by design and/or operating principles to better suit their given application. The global market size for these sensors was estimated at USD 6.3 billion in 2020 with a projected annual growth of 4.8% to 2027 [1]. For many applications, using a single temperature sensor is sufficient, but sometimes a group of sensors is required to optimise, for example, the design of a refrigerator [2] or room ventilation [3]. We came across the need to develop an accurate air temperature distribution measurement network in order to verify the operation of an ultrasonic oscillating temperature sensor (UOTS) that we are developing to measure aggregate temperatures in dwellings. When selecting a reference sensor, we considered suitability, reliability of readings, convenience for networking and cost of various conventional temperature sensors.

Suitability
Infrared sensors are not directly applicable to air temperature measurement. On the other hand, combinational temperature and humidity (and sometimes pressure) sensors, which are unsuitable for measuring temperatures of solids and liquids, were designed primarily for measurement in air and should be considered alongside temperature-only sensors.

Cost Considerations for Common Contact Temperature Sensors
Resistance temperature detectors (RTDs) are popular in industrial thermometers, which are built using either Pt100 or Pt1000 platinum RTDs. These sensors are expensive and require a separate electronic driver for each RTD as well as dedicated networking. Thermistors are the least expensive on their own but require individual calibration for accurate measurement. Thermocouples are not expensive on their own but require so-called cold junction compensation and feature quite low sensitivity for the resolutive measurement of room temperatures. These drawbacks confine their uses to extreme temperatures only. Integrated circuit temperature sensors, at a medium price point, typically contain appropriate electronic digitising circuitry and provide a standardised interface. A non-exhaustive list of such sensors on Wikipedia mentions 37 sensors from five manufacturers [4], but there are many more manufacturers offering these sensors (Silicon Labs, TE Connectivity and Bosh, among other well-established brands). As different sensors provide various features (for example, combinational sensors are becoming increasingly common) and target different market segments, their price point ranges between USD 0.5 and 10.

Reliability of Air Temperature Measurement
The accuracy of temperature sensors after manufacture is specified by their vendors; variation might range from as low as ±0.25 • C up to ±2 • C [4]. A study on thermistors found that their accuracy deteriorated very little over time [5], and this should hold for both RTDs and integrated circuit temperature sensors that have been manufactured from materials of high purity. However, making room temperature measurements that are accurate to 1 • C could be complicated by the fact that the same thermometer, placed at different heights in the same room, could report temperature differences well in excess of the above-mentioned amount of 1 • C [6]. Moreover, a detailed quantitative experimental study of temperatures at seven different places in a simulated office environment (four different climate modes) showed that placing different commercial thermometers in the same location could result in temperature differences of 1 • C despite the consistent environment. Additionally, the same thermometer's readings could vary by up to 2 • C at different room locations for the same stationary conditions (that the authors refer to as climate modes) [3].
Another important consideration relates to the sensor's response time, i.e., the time it takes sensor readings to reach a certain level when reacting on a step temperature change. For example, a manufacturer of electronic thermometers put four types of sensors in an oven simultaneously, and the recorded data showed a difference between the most and least responsive of up to 25 • C [7]. Differences in readings of similar magnitude were observed by O. Liutyi, who constructed a board equipped with over 60 combinational temperature and humidity sensors, transferred it from a room environment into a freezer and shared the resulting data on his blog (Test 10 v5 board in Freezer [8]). His data show that it took from 6 to 10 min for different sensors to reach a reading of −15 • C from the initial reading of over 25 • C, and the difference between sensors' readings could be up to 15 • C.
Two other notable studies that recorded readings from different sensors placed in close proximity reported differences of up to 2 • C [9,10]. Much better agreement among readings was observed by experimenters who placed the sensors in a confined space, either in a cardboard box [11], in a glass jar with a cap [12] or simply under a plastic bottle cap [13].

Sensor Networking
The networking of sensors with analogue output, such as thermistors, thermocouples and some integrated circuit sensors, is complicated by the need to provide electronics for signal conditioning and filtering, analogue-to-digital conversion and a standardised interface close to each sensor. There are some off-the-shelf solutions available, but they typically cost hundreds of dollars. Integrated circuits have all these circuits built in and thus seem preferable.
An air temperature distribution measurement network requires many sensors with the same part number to ensure that all of the readings correspond. Unfortunately, most integrated circuit temperature sensors feature an interface that is most convenient for a single data sink, such as a microcontroller. In particular, inter-integrated circuit (IIC or I2C) sensors are supplied with the same bus address, which mandates the use of additional I2C multiplexers if more than one sensor is used. Serial peripheral interface (SPI) sensors require at least four wires for a single sensor; this number is either increased by one wire for each additional sensor (chip select wire) or the communication speed is reduced by the factor equal to the number of the sensors used (daisy chain configuration). We are aware of only two sensors that allow the connection of several sensors to the same bus. The I2C-enabled MCP9808 allows the use of up to eight sensors on the same bus, and restrictions on the multiple DS18B20 on the same bus relate primarily to the wire lengths and not their number. These parts should be considered if ease of sensor wiring is a primary concern.
Other important networking considerations should include, but are not limited to, the sensor's measurement time, which limits the rate at which the measured temperature can be sampled, and the data communication rate (the faster, the better). For example, each sensor of the 68 on O. Liutyi's network could be sampled only every 16-17 s to allow readings of all the other sensors [8]. This may not be fast enough for some use cases. Finally, it might be important to start the temperature conversion at exactly the same time for all the networked sensors, even if reading the conversion results takes considerable time; this feature seems to be available only for the DS18B20 sensors.

Apparent Temperature
It is important to note that the measured temperature value could differ from humanfelt temperature (also known as apparent temperature), as the latter is subjective to wind chill, humidity (heat index) and presence of direct sunlight (wet bulb globe temperature).

Reporter's Liability
Sensor manufacturers do not like comparisons of their products with those of their competitors, as only one product comes out on top. To avoid their displeasure (or even potential legal issues), either any references to particular products are removed from the experiment's description (e.g., branding of thermometers in photographs [3]), products from only one manufacturer are compared [7], or the data are presented with the details of how they were obtained but without a definitive judgement [9,10,12,13]. The latter approach was taken for this study, allowing the reader to draw their own conclusion according to their use case.
In this paper, we report the results of two sets of experiments. These were conducted with two uncalibrated temperature sensors and without the use of a reference thermometer. One experiment involved recording the readings of the Pt100 RTD and the DS18B20 integrated circuit sensor to cloud storage for several months. The Pt100 RTD was selected due to its proliferation in industry, whilst the DS18B20 was selected due to its advantages for networking and our prior positive experiences with them [14]. The other experiment utilised two I2C combinational sensors (BMP280 and AHT20) that were attached to an unbranded board that provided good thermal contact between them.

Simultaneous Temperature Measurement Using Pt100 and DS18B20 Air-Gapped Sensors
We used an experimental setup, relevant firmware and cloud storage procedures that are detailed elsewhere [15]. Both sensors were placed at the bottom of a 170 mm × 95 mm × 110 mm (length × width × height) cardboard box and covered by air bubble packaging. The box was kept on the ground floor, away from the window and direct sunlight. From time to time, the sensors were moved closer to each other and/or covered by an additional layer in order to make their readings be in better agreement. Figure 1 presents the experimental readings, which were collected approximately every 18 s for about three months, along with the calculated differences.
Eng. Proc. 2021, 10, 56 4 of 7 for our liking. This changed for the better when the sensors were placed inside the same plastic bag on 22 July 2021. The subsequent readings showed excellent agreement with an average bias of only 0.05 °C and most scatter within ±0.08 °C. The final part of this experiment gave us confidence in the accuracy of the DS18B20 sensors for measuring at least quasi-stationary air temperatures. This, coupled with their convenience for networking, determined their selection for our use case (verification of UOTSs).

Simultaneous Air Temperature Measurement Using AHT20 and BMP280 Sensors Mounted on the Same Board
We used the sensor board along with Seeeduino Xiao Arduino-compatible microcontroller module [16], which was attached to an expansion board with an OLED display, real-time clock and SD card.
The first set of experiments was conducted by placing the setup on a computer table that was manned until around 22:00, after which the room was vacated until the next morning. On the first occasion, the setup's operation was unchanged, but on the second, the sensor board was placed inside a plastic tube and covered by air bubble packaging material when the room was vacated. The recorded readings, along with the calculated difference and relevant photographs, are presented in Figure 2.  Despite the measures taken to ensure that the sensors responded to the same air temperature, both a notable bias of up to 0.5 • C and scatter of up to ±0.2 • C were observed for over two months. These results were concerning, as we expected the sensor readings to be biased but to generally follow each other, as occurred in our experiments with DS18B20 sensors in water [14]. However, we were unable to identify a single bias for the recorded dataset and the resulting scatter, although within the DS18B20 specifications was too high for our liking. This changed for the better when the sensors were placed inside the same plastic bag on 22 July 2021. The subsequent readings showed excellent agreement with an average bias of only 0.05 • C and most scatter within ±0.08 • C. The final part of this experiment gave us confidence in the accuracy of the DS18B20 sensors for measuring at least quasi-stationary air temperatures. This, coupled with their convenience for networking, determined their selection for our use case (verification of UOTSs).

Simultaneous Air Temperature Measurement Using AHT20 and BMP280 Sensors Mounted on the Same Board
We used the sensor board along with Seeeduino Xiao Arduino-compatible microcontroller module [16], which was attached to an expansion board with an OLED display, real-time clock and SD card.
The first set of experiments was conducted by placing the setup on a computer table that was manned until around 22:00, after which the room was vacated until the next morning. On the first occasion, the setup's operation was unchanged, but on the second, the sensor board was placed inside a plastic tube and covered by air bubble packaging material when the room was vacated. The recorded readings, along with the calculated difference and relevant photographs, are presented in The results show that one of the sensors gave consistently higher readings, with the variable bias in the region of 1.25 • C (a similar bias was observed by some other experimenters [11,12]). The nearby presence of a human and a working computer led to spontaneous fluctuations of up to 1 • C that were not observed at night, when fluctuations were within 0.1 • C. These were reduced further when the sensor board was placed in a plastic container. Figure 2. real-time clock and SD card.
The first set of experiments was conducted by placing the setup on a computer table that was manned until around 22:00, after which the room was vacated until the next morning. On the first occasion, the setup's operation was unchanged, but on the second, the sensor board was placed inside a plastic tube and covered by air bubble packaging material when the room was vacated. The recorded readings, along with the calculated difference and relevant photographs, are presented in Figure 2.  The second experiment was conducted by placing the board on a windowsill, where it caught occasional sunrays through the garden bushes. The sunrays, when present, heated up the board rather quickly and reduced the above-mentioned bias down to 0.7 • C at times, as shown in Figure 3. The results show that one of the sensors gave consistently higher readings, with the variable bias in the region of 1.25 °C (a similar bias was observed by some other experimenters [11,12]). The nearby presence of a human and a working computer led to spontaneous fluctuations of up to 1 °C that were not observed at night, when fluctuations were within 0.1°C. These were reduced further when the sensor board was placed in a plastic container.
The second experiment was conducted by placing the board on a windowsill, where it caught occasional sunrays through the garden bushes. The sunrays, when present, heated up the board rather quickly and reduced the above-mentioned bias down to 0.7 °C at times, as shown in Figure 3. We assume that this reduction was due to the faster response time of the sensor with lower readings-the other sensor readings simply lagged behind.
For the third experiment, the setup was placed inside a long cardboard box in which air movements were severely restricted. Under these conditions, the recordings of both sensors changed very little (±0.1 °C) over the course of 80 min and rigorously followed each other. The calculated bias was very stable with a scatter of around ±0.02 °C (Figure 4). These results show that in the absence of air movements and with a quasi-stationary temperature, good thermal contact between different temperature sensors and bias correction, the sensors can produce nearly the same readings. Similar agreement among three different temperature sensors' readings was obtained in a confined chamber with forced air circulation. Application of the best fit linear regression resulted in relative squared residual (R 2 ) values in excess of 0.999 for the 25-75 °C temperature interval [17]. We assume that this reduction was due to the faster response time of the sensor with lower readings-the other sensor readings simply lagged behind.
For the third experiment, the setup was placed inside a long cardboard box in which air movements were severely restricted. Under these conditions, the recordings of both sensors changed very little (±0.1 • C) over the course of 80 min and rigorously followed each other. The calculated bias was very stable with a scatter of around ±0.02 • C (Figure 4). The results show that one of the sensors gave consistently higher readings, with the variable bias in the region of 1.25 °C (a similar bias was observed by some other experimenters [11,12]). The nearby presence of a human and a working computer led to spontaneous fluctuations of up to 1 °C that were not observed at night, when fluctuations were within 0.1°C. These were reduced further when the sensor board was placed in a plastic container.
The second experiment was conducted by placing the board on a windowsill, where it caught occasional sunrays through the garden bushes. The sunrays, when present, heated up the board rather quickly and reduced the above-mentioned bias down to 0.7 °C at times, as shown in Figure 3. We assume that this reduction was due to the faster response time of the sensor with lower readings-the other sensor readings simply lagged behind.
For the third experiment, the setup was placed inside a long cardboard box in which air movements were severely restricted. Under these conditions, the recordings of both sensors changed very little (±0.1 °C) over the course of 80 min and rigorously followed each other. The calculated bias was very stable with a scatter of around ±0.02 °C (Figure 4). These results show that in the absence of air movements and with a quasi-stationary temperature, good thermal contact between different temperature sensors and bias correction, the sensors can produce nearly the same readings. Similar agreement among three different temperature sensors' readings was obtained in a confined chamber with forced air circulation. Application of the best fit linear regression resulted in relative squared residual (R 2 ) values in excess of 0.999 for the 25-75 °C temperature interval [17]. These results show that in the absence of air movements and with a quasi-stationary temperature, good thermal contact between different temperature sensors and bias correc-tion, the sensors can produce nearly the same readings. Similar agreement among three different temperature sensors' readings was obtained in a confined chamber with forced air circulation. Application of the best fit linear regression resulted in relative squared residual (R 2 ) values in excess of 0.999 for the 25-75 • C temperature interval [17].

Conclusions
The results reported in the literature and in this paper led to the following conclusions for air temperature measurement: • Absolute accuracy might be tricky to achieve, but relative measurements can be quite consistent if the sensors are placed inside a common enclosure with a limited air volume. Under these conditions, the readings of different sensors might stay much closer than can be expected from the relevant manufacturers' specifications; the biases among sensors, if present, can be eliminated with the subsequent processing.

•
If the air movements are not restricted, even closely placed sensors can report notably different data. • Substantial differences in sensor readings can be observed if the temperature changes quickly. This occurs due to the differences in the sensors' response times.

•
The advantages of the DS18B20 for temperature field measurement include using only three wires for a large number of sensors and the availability of the "start of measurements" broadcast command.
Author Contributions: A.E. and A.N.K. contributed to this paper equally. All authors have read and agreed to the published version of the manuscript.