Full width home advertisement

Arduino project

Raspberry project

Post Page Advertisement [Top]

From the date I got DHT22 humidity sensor, I always doubt about its accuracy.
As datasheet statement, DHT22 accuracy is +/- 2%RH, but it might be varied depend on each sensor.
To test DHT22, we have to make standard humidity environment, and we have to know humidity of that environment.
A seal box is perfectly to create standard humidity environment.
Hardware need for testing:
1. DHT22
2. Arduino Pro Mini
3. Hygrometer
4. Sodium Chloride NaCl
5. Silica Moisture absorber
6. Seal box, clay, small bowl
1. DHT22 sensor
2. Arduino Pro Mini

3. Hygrometer
5. Silica moisture absorber

Step 1. Reading value DHT22 from Arduino Pro Mini
How to read the value? Please visit this link for reading value

Step 2. Make 1st calibration point by Sodium Chloride
An saturation Sodium Chloride (NaCl) in water will create standard 75%RH. So we will put a lot of NaCl into small bowl, and pour some water above top of NaCl.
Put NaCl bowl, DHT22 into box, seal it with clay. Keep it there about 6 hours. Why need about 6 hours? In order to keep environment stable. Furthermore, mechanical type Hygrometer reacting very slow.
In my case, hygrometer reads 75%, but DHT22 reads 56.4% (unlucky for me when got not accurate sensor)

Step 3. Make 2nd calibration point by Silica Moisture absorber
Silica Moisture absorber will decrease humidity of nearby environment. We also put bowl of Silica Moisture absorber, DHT22 into box, keep it in 6 hours (it take so many time to test this sensor!)
Again, hygrometer reads 49.5% but DHT22 reading is 29.1%

Step 4. Make a curve
Microsoft Excel will help to make calibration curve. Make a drawing as following, display equation chart, we will got calibration factor.
This case, calibration factor is 0.9341 and 22.319

Step 5. Update calibration curve into Arduino code
#include <DHT.h>;

#define DHT_PIN 7           // Output of DHT22 to pin 7 Arduino
#define DHT_TYPE DHT22      // DHT22 (AM2302)
DHT dht(DHT_PIN, DHT_TYPE); // Initialize DHT sensor for Arduino 16MHz

int chk;
float hum;  //Stores humidity value
float temp; //Stores temperature value

void setup()

void loop()
    //Read value of Humidity and Temperature
    hum = dht.readHumidity();
    temp= dht.readTemperature();

    hum = hum*0.9341 + 22.319; //calibration
    //Print out value of Humidity and Temperature
    Serial.print("Humidity is: ");
    Serial.print("% --- Temp is: ");
    delay(5000); //Delay 2 sec.
Step 6. Test accuracy again
Make a test again with saturation NaCl and Silica Moisture absorber.
Fortunately, the reading is now 49.5% for Silica, and 77.15% for NaCl (quite good for humid sensor!)

No comments:

Post a Comment

Bottom Ad [Post Page]