When developing a new project ThinIce, we had to choose temperature sensor Arduino. The technical specifications required us to use 4 temperature sensors to control the temperature of Peltier elements, sides with low and high temperature. The temperature threshold setting should have been no worse than ±0.5°C and the measuring range - from +5°C to +60°C.
For the analysis, we took best temperature sensors for Arduino.
Below we provide a compared Arduino sensors list:
To use arduino temperature sensor for project we also made a table with comparative characteristics
|Sensor||Measurement range, °C||Resolution, °C||Interface||Price, $|
|AD7415||-40 to +85||±0.5||I2C||2.5|
|ADT7310TRZ||-55 to +150||±0.5||SPI||3|
|DS18D20||-55 to +125||±0.5||1-Wire||1|
|DS75S||-55 to +125||±0.5||I2C||2|
|DHT11||0 to +50||±1||1-Wire||1.5|
|LMT01LPG||-50 to +150||±0.5||PCI||2.5|
|LM75||-55 to +125||±0.5||I2C||1|
Most temperature sensors have I2C interface that allows connecting up to 128 devices to the bus, which is very convenient in terms of long distance data delivery. The interface consists of two main wires:
SCL - clock signal from the main device;
SDA - bidirectional data signal.
For the normal operation of the I2C-connected devices, it is necessary to power them. For this, Vdd and GND signals are used.
To ensure the device-address separation on the I2C bus, the devices themselves provide the possibility to specify the address using one of the pins. For example, in the AD7415 temperature sensor circuit, the AS pin is used for this.
Possible options for establishing address space of a circuit:
|AS pin||I2C Address|
In total, there can be 3 possible options for address space implementation for temperature sensors, which is clearly not enough according to the initial technical requirements set.
According to the specification sheet for the ATMEGA324 controller, there is only one I2C interface located at the PC4 and PC5 pins. The use of two I2C
Alternatively, we considered to use DS75S as temperature sensor for Arduino. This thermal sensor chip has three pins for address space configuration. As a result we get 23 (or 8) possible address combinations.
The resolution of this sensor equals to ±0.5°C, but if you look at the datasheet, you’ll find that Thermometer Error TERR has the max value of ±3°C across the entire measurement range. For example: despite the sensor’s half-degree accuracy and due to the temperature error parameter TERR of ±3°C, when sensor shows +12.5°C, the real value can be anywhere from +9.5°C to +15.5°C. Such measurement accuracy is unacceptable for our Arduino project.
In the meantime, the LM75 temperature sensor is the counterpart to the previous one having close or similar parameters. The resolution of this sensor is ±0.5°C, measurement accuracy - ±2°C.
ADT7310 Arduino temperature sensor with the SPI interface. SPI is a popular interface used for high-speed data transmission within Master/Slave architecture. To implement the data exchange through the SPI interface, following signals are used:
- MISO or SOMI - Master In, Slave Out. Is used to transfer data from the slave device to the master device;
- MOSI or SIMO - Master Out, Slave In. Is used to transfer data from the master device to the slave device;
- SCLK or SCK - Serial Clock signal. Is used to transmit a clock signal to slave devices;
- CS or SS – Chip Select/Slave Select.
And two additional power cords: Vdd and GND.
Thus, according to the schematic above, we need to route the bus to the temperature sensors using 7 service wires and 2 power wires - 9 conductors in total. At the same time, we need to add 4 pins to the busy SPI Arduino interface to implement switching between four temperature sensors. That makes a total of seven pins on Arduino to be used for the temperature reading.
Communication between devices connected to the 1-Wire bus is carried over a single wire. Each device on the bus has its unique 64-bit serial number. In view of this, we can easily attach needed number of temperature sensors (4, in our case). At the same time, this sensor can be moved forward on a long distance (dozens of meters). There is also a version of a sensor with sealed-case for the measurement of the water temperature - Waterproof DS18B20.
DS18D20 temperature sensor parameters according to the datasheet:
- Accuracy: ±0.5°C across the whole measurement range;
- Resolution: 0.0625°C (12-bit conversion).
Another 1-Wire sensor on our list is DHT11. Along with temperature measuring, this sensor can measure humidity and is often used in conjunction with a humidity sensor for Arduino.
Compared with the DS18D20 in terms of connectivity, this sensor cannot boast any built-in logic which can help to realize address space. Thus, to connect 4 sensors to Arduino we need to use 4 DATA wires, one per each sensor.
DHT11 temperature sensor parameters:
- Accuracy: ±2°C;
- Resolution: 1°C.
As we see, resolution and accuracy clearly are beyond the technical requirements set for this project.
There is one more temperature sensor with an interesting connection method that uses Pulse Count Interface (PCI) - LMT01.
According to the datasheet its parameters are as follows: - Accuracy: ±0.5°C across the entire measuring range; - Resolution: not worse than 0.06°C. To connect temperature sensor to Arduino only 2 GPIO ports of the controller are required.
An important feature of this sensor is small temperature resistance between the sensor housing and the measured environment. Since we need to get measurements (temperature) on the cold and warm sides of the Peltier element with an accuracy of ±0.5°C at least, structural peculiarities of this sensor are very important.
Of all the abovementioned sensors, DHT11 has the largest temperature resistance since the sensor itself is embodied in plastic body and is more suitable for measuring air flows temperature rather than contact measurements. All other sensors have casing type TO-92, WSON, SOP, μSOP, SOIC or SOT-23 types, which provide a larger contact area to the studied surface and low thermal resistance.
Results of this study we compiled into the following table:
|Sensor||Measurement range, °C||Accuracy, °C||Resolution, °C||Data interface||Price, $||Thermal resistance|
|AD7415||-40 to +85||±0.5||±0.5||I2C||2.5||low|
|ADT7310TRZ||-55 to +150||±3||±0.5||SPI||3||low|
|DS18D20||-55 to +125||±0.5||±0.5||1-Wire||1||low|
|DS75S||-55 to +125||±3||±0.5||I2C||2||low|
|DHT11||0 to +50||±2||±1||1-Wire||1.5||high|
|LMT01LPG||-50 to +150||±0.5||±0.5||PCI||2.5||low|
|LM75||-55 to +125||±2||±0.5||I2C||1||low|
With a view to reduce mass production costs, number of GPIOs used, we have chosen the DS18D20 remote temperature sensor, that satisfies our requirements for temperature measurement accuracy and error limits. Also, this sensor has low cost. Thanks to a good accuracy, small measurement error, and the waterproof case, this sensor will be used as a cheap body temperature sensor in the future.
Even using a single DATA wire for each temperature sensor, we have only 4 GPIOs involved. This is important since other GPIO ports we need to use for control keys, buttons, service inputs, battery voltage measurement, LCD monitor and Bluetooth connections. 1-Wire interface can be rewired programmatically without much effort on any GPIO.
So, to sum everything above mentioned up, here is a complete list of all great features of DS18D20.
- Price: the component cost does not exceed $ 1 in any stores, it has one of the lowest prices among other temperature sensors.
- Distribution: this is a very popular sensor, it can be bought in any electronic components store.
- Measurement accuracy: The temperature sensor DS18D20 has a measurement accuracy of ± 0.5 ° C and a resolution of ± 0.5 ° C with the ability to have a resolution of 12 bits at a resolution of ± 0.0625 ° C.
- Easy-to-use: the usage of a 1-Wire bus makes it easy to connect microcontrollers to both a single sensor and a bunch of sensors. In fact, any controller can be connected to this temperature sensor and a bunch of sensors as well. In case of a change in the design, temperature sensor can be easily moved to other GPIO pins with minor changes to code or hardware.
- Temperature range : the wide temperature range covers the entire range for a comfortable human temperature range from -50 ° C to + 50 ° C and even has a wider range from -55 ° C to + 125 ° C.
- Energy saving: the current consumption in the active mode does not exceed 1.5 mA and in the low power mode consumption is lower than 1 uA, which allows using these sensors in battery-powered devices.