Dew Point Arduino

what is really dew point ? 

In simple terms, the dew point (dew point temperature or dewpoint) is the temperature at which a given concentration of water vapor in air will form Dew. More specifically it is a measure of atmospheric moisture. It is the temperature to which air must be cooled at constant pressure and water content to reach saturation. A higher dew point indicates more moisture in the air; a dew point greater than 20 °C (68 °F) is considered uncomfortable and greater than 22 °C (72 °F) is considered to be extremely humid. Frost point is the dew point when temperatures are below freezing.

here is my setup using only one dht11 humidity sensor

img_4364

Here is the result using serial monitor

screen-shot-2016-09-26-at-11-34-19-am

Here is the code :

// Example testing sketch for various DHT humidity/temperature sensors
// Written by ladyada, public domain

#include "DHT.h"

#define DHTPIN 2 // what digital pin we're connected to

// Uncomment whatever type you're using!
//#define DHTTYPE DHT11 // DHT 11
#define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321
//#define DHTTYPE DHT21 // DHT 21 (AM2301)

// Connect pin 1 (on the left) of the sensor to +5V
// NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1
// to 3.3V instead of 5V!
// Connect pin 2 of the sensor to whatever your DHTPIN is
// Connect pin 4 (on the right) of the sensor to GROUND
// Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor
DHT dht(DHTPIN, DHTTYPE);

float tC;
float dP;
float dPC;

// Initialize DHT sensor.
// Note that older versions of this library took an optional third parameter to
// tweak the timings for faster processors. This parameter is no longer needed
// as the current DHT reading algorithm adjusts itself to work on faster procs.

void setup() {
 Serial.begin(9600);
 Serial.println("DHTxx test!");

dht.begin();
}
void loop() {
 // Reading temperature or humidity takes about 250 milliseconds!
 // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor)
 float h = dht.readHumidity();
 float t = dht.readTemperature();

// check if returns are valid, if they are NaN (not a number) then something went wrong!
 if (isnan(t) || isnan(h)) {
 Serial.println("Failed to read from DHT");
 } else {
 Serial.print("Humidity: ");
 Serial.print(h);
 Serial.print(" %\t");
 Serial.print("Temperature: ");
 // Serial.print(t);
 // Serial.print(" *C ");
 tC=((t*9)/5)+32;
 Serial.print(tC);
 Serial.print(" *C ");
 Serial.print(" \t");
 
 Serial.print("Dew Point: ");
 // Serial.print(dewPointFast(t, h));
 // Serial.print(" *C ");
 dP=(dewPointFast(t, h));
 dPC=((dP*9)/5)+32;
 Serial.print(dPC);
 Serial.print(" *C");
 Serial.print(" \t");

Serial.print("Heat Index: ");
 Serial.print(heatIndex(tC,h));
 Serial.println(" *C");


 }
}

// delta max = 0.6544 wrt dewPoint()
// 6.9 x faster than dewPoint()
// reference: http://en.wikipedia.org/wiki/Dew_point
double dewPointFast(double celsius, double humidity)
{
 double a = 17.271;
 double b = 237.7;
 double temp = (a * celsius) / (b + celsius) + log(humidity*0.01);
 double Td = (b * temp) / (a - temp);
 return Td;
}

double heatIndex(double tempF, double humidity)
{
 double c1 = -42.38, c2 = 2.049, c3 = 10.14, c4 = -0.2248, c5= -6.838e-3, c6=-5.482e-2, c7=1.228e-3, c8=8.528e-4, c9=-1.99e-6 ;
 double T = tempF;
 double R = humidity;

double A = (( c5 * T) + c2) * T + c1;
 double B = ((c7 * T) + c4) * T + c3;
 double C = ((c9 * T) + c8) * T + c6;

double rv = (C * R + B) * R + A;
 return rv;
}

sources

http://arduinotronics.blogspot.co.id/2013/12/temp-humidity-w-dew-point-calcualtions.html

https://learn.adafruit.com/dht/overview

Leave a comment