TEMPERATURE SENSORs - Which Sensor Is the Most Accurate
by Fil_caste in Circuits > Sensors
82 Views, 1 Favorites, 0 Comments
TEMPERATURE SENSORs - Which Sensor Is the Most Accurate
This exercise was created to detect which sensor for environment temperature within the Ky-001 or DS18B20, the Ky-013, the Ky-015 or DHT11 and the Ky-028 is the most responsive to measuring a variation in temperature. The data collected is sent via Wi-Fi to the Blynk platform from which you can turn the board on and off and view temperatures and to google sheet to save data and graphs for analysis. An aluminium conduit was used to make the measurements so as to reach an closed environment in which to heat and therefore have a reading from the sensors at approximate conditions as possible.
Supplies
- ESP32 CP2104 IoT Microcontroller (Aliexpress → 0,99 €) | (Amazon → 8,99 €)
- DC Power Shield ESP32 (Aliexpress → 0,99 €) | (Amazon → 7,90 €)
- Ky-001 - DS18B20 (Aliexpress → 0,27 €) | (Amazon → 10,78 €)
- Ky-013 (Aliexpress → 0,48 € )| (Amazon → 5,80 €)
- Ky-015 - DHT11 (Aliexpress → 0,65 €) | (Amazon → 7,99 €)
- Ky028 (Aliexpress → 0,45 €) | (Amazon → 4,74 €)
- Relay Module (Aliexpress → 0,33 €) | (Amazon → 7,99 €)
- Breadboard (Aliexpress → 0,99 €) | (Amazon → 6,79 €)
- Computer Fan (Aliexpress → 1,42 €) | (Amazon → 38,93 €)
- CPU Internal Heatsink (Aliexpress → 5,70 €) | (Amazon → 5,16 €)
- External Heatsink (Aliexpress → 0,99 €) | (Amazon → 9,99 €)
- Peltier Cell (Aliexpress → 9,31 €) | (Amazon → 13,82 €)
- Spring Clamp (Aliexpress → 5,37 €) | (Amazon → 19,99 €)
- M4 Screws (Aliexpress → 0,89 €) | (Amazon → 11,99 €)
- CPU Thermal Paste (Aliexpress → 0,99 €) | (Amazon → 5,38 €)
- Jumper Wire (Aliexpress → 0,99 €) | (Amazon → 8,99 €)
- Thermal Insulation (Aliexpress → 0,99 €) | (Amazon → 10,97 €)
- Aluminium electrical duct 45°
- 24V Power Supply
Tools Used
- Screwdriver Drill
- Screwdriver
- Wrench
- Drill Bits
Components of Temperature Sensors
This project is a system that once turned on is completely autonomous in reading data. It consists of 4 main components:
- Peltier cell and Fan: heat the air inside the aluminium duct to have variable data
- Controller: read data from sensors and communicate it by Wi-Fi
- Temperature sensors: measure temperature variation
- Power Supply: power the controller and Peltier cell
Sensor and Controller Selection
The controller has two essential tasks:
- Measuring the temperature read by the sensors:
Each sensor measures temperature analogously or digitally, the controller's task is to transform the voltage value read into a temperature value
- Send the data to Blynk and Google Sheets:
Once it has read the data from the sensors and transformed this value into a temperature value it must send it via Wi-Fi to the Blynk platform and Google Sheet
The sensors that have been used are Ky-001 or DS18B20, Ky-013, Ky-015 or DHT11, and Ky-028.
- Ky-001 or DS18B20: uses the single-bus function via the i2c protocol, which allows up to 64 sensors to be connected on the same cable, reducing the number of cables needed.
- Ky-013: uses the Steinhart-Hart equation to convert the thermistor resistance value to a temperature value. Being very inexpensive sensors, the problem was encountered that the thermistor was soldered backwards and therefore the pins did not match with the label printed on the board. This module consists of a NTC thermistor, a 10 kΩ resistor.
- Ky-015 or DHT11: is a commonly used Temperature and humidity sensor that comes with a dedicated NTC to measure temperature and an 8-bit microcontroller to output the values of temperature and humidity as serial data.
- Ky-028: again we used the Steinhart-Hart equation because this sensor has the same thermistor as the Ky-013. This module has both digital and analog outputs, there’s a potentiometer to adjust the detection threshold on the digital interface.
How the Project Works?
The heart of the design is the aluminium wireway on which the Peltier cell is fixed. To optimise the operation of the cell, two heat sinks were mounted, one on the outside to disperse the cold air and one on the inside, which with the addition of a fan serves to better dissipate the heat produced throughout the wireway. The sensor, cell, and fan connection cables were routed out of the wireway by taking advantage of the holes already present for attaching the wireway plugs, one of the four bolts was removed, and the cables were routed in its place.
Once the whole thing is turned on it takes some time before the sensors detect a change in temperature this is because the cell has its own hysteresis cycle and also has to heat all the volume of air inside the duct which acts as a thermal flywheel distributing the heat more evenly throughout the cell and thus obtaining measurements with the same conditions.
The code of the project is provided in the documentation. Pay ATTENTION to change the variables in the photo with yours.
Use this link for connect Google Sheet and Blynk to ESP32 and changes the variables as indicated before:
Downloads
Sensors Testing
Testing of each sensor individually was done to verify its proper operation.
- Ky-001 - DS18B20: Initially with this sensor there were problems with reading in the data because the sensor was damaged. Therefore, a new sensor was purchased and soldered onto the board in place of the old one.
- Ky-013: this sensor had a problem because the thermistor was soldered backwards and therefore the pins printed on the board did not match with reality. In order to figure out the correct connection to use, we had to analyse the internal circuit and then derive the formula for the resistance value of the thermistor using the equations at the mesh.
- Ky-015 - DHT11: the dedicated arduino library was used for this sensor in order to simplify the listing.
- Ky-028: for this sensor after consulting the datasheet and searching the internet for the circuit, it was decided to use the Steinhart-Hart formula being that it has the same thermistor as the Ky-013. The main problem was finding the value of resistance R1 which was assumed to be 100 kOhm, but as can be seen later from the graphs it is probably wrong since the read values are discordant from the average of the other three sensors.
Before making the final connection with all the sensors, a schematic was created using the Fritzing software. After that, the sensors were connected in reality, and the previously mentioned code was uploaded.
Box Design
The aluminium channel was also modelled in 3D using Autodesk Fusion360, all the pieces were created using the application, including the fan that we imported from TraceParts.
Data Logging
Data was saved via a Blynk switch. Thanks to this switch, the ESP32 sent data to both Blynk and Google Sheets (previously connected to the script). From this data, we generated graphs that illustrate the trends of the four sensors over time.
Data Analysis
To conduct the most accurate data analysis possible, it's important to consider that the Peltier cell has its own hysteresis cycle. This means there is a delay from the moment it receives voltage to when it starts heating up. Additionally, it's important to account for the large mass of air inside the channel, which acts as a thermal flywheel. This helps distribute the heat as evenly as possible within the channel, given that we have environmental sensors. On one hand, this thermal flywheel ensures more uniform heating of the air inside the channel, thanks to the use of a fan. On the other hand, it requires more time to heat the internal environment of the channel. First, the Peltier cell needs to heat up, which in turn heats the heat sink, and then, through air exchange via a fan, it heats the entire volume of air inside the channel where the sensors are placed.
During the heating phase, it is observed that the Ky-015 - DHT11 responds slightly slower, while the values of the other three sensors increase in a similar manner. The Ky-028 has the noisiest signal, meaning it has the greatest fluctuations in measurement, and it deviates the most from the other values. It can be noted that the Ky-013 exhibits a pattern similar to the Ky-028 but with less fluctuation and a temperature reading more akin to the others. This is because both sensors use the same thermistor.
During the cooling phase, the Ky-013 and Ky-028 continue to have highly fluctuating patterns, while the Ky-001 and Ky-015 exhibit better responses.
The delay in both the heating and cooling phases of the DHT11 might be due to the sensor's casing, which creates a barrier to thermal exchange between the air inside the casing and the air outside. Additionally, temperature is a slowly varying phenomenon.
Conclusion
The Ky-015 and Ky-001 sensors exhibit very similar behavior with cleaner curves, while the Ky-013 and Ky-028 sensors show more outliers and would require more filtering. If you look at the curves without considering the temperatures, you can notice that all four curves are fairly superimposable by applying a delta to each curve.
By calculating the temperature variation in both the heating and cooling phases, it becomes evident that the Ky-028 and Ky-013 exhibit the greatest measurement dispersion. The Ky-001 and Ky-015 have a more linear measurement variation, although the Ky-015 responds slightly more slowly compared to the Ky-001.
The issue with the Ky-028 curve is likely related to the calculation of the equivalent series resistance, which is probably incorrect due to the lack of accurate values in the sensor's datasheet. As a result, it was approximated by analyzing the circuit.
In conclusion, the best sensor with the cleanest curve is the blue one, the Ky-001.