Utilizing an array of DHT-11 sensors to test relative temperature and humidity accuracy
Created Janurary 2021I recently needed a temperature and humidity sensors for a project and purchased a few DHT-11 sensors. After seeing readouts I was skeptical to test the accuracy of these sensors. I decided to wire a few of them up to an Arduino Nano and take some comparative data.
The materials list is short and sweet.
Items | |
---|---|
DHT-11 Sensors (3x) | Arduino Nano |
Breadboard | Assorted jumper wires |
My method for recording data was to collect 200 data points over a period of 200 seconds (i.e. measure from each sensor every second). This should give a general sense of what the temperature should be, I took a picture of my thermostat's readout for comparison (a little more than 70°F).
A top-down view of the breadboard wiring.
After importing necessary libraries, I defined the pins and sensor type, instantiated the sensors, and correlated the pinMode's.
The main loop consists of reading the temperature and humidity from each sensor, confirming the data is not NAN (not a number), and printing the results. I decided to print the data to the serial monitor in a CSV format so I could later copy and paste into a CSV file and import it into Excel.
Overall I was not expecting these sensors to be super accurate because they're marketed towards hobbyists. Through these test results, one can conclude that sensor 1 and 2 show closer values for temperature, but senors 1 and 3 show closer values for humidity. Sensor 1 is very far off the actual temperature and sensor 2 gives low values for humidity.
If I were to conduct a more comprehensive test on DHT-11 sensors, I would take more data-points across a larger array of sensors. Although this test was merely out of curiosity and not completely comprehensive, it confirmed my suspicion of suboptimal values.
View the raw data here.