# DEW point using DHT22 sensor

Hi everyone,

I have a simple weather station. It measures the temperature and humidity using DHT22 sensor.
I want to detect fog in my garden. After doing some research I want to use dew point for the detection.
Using DHT22’s values how can I get the dew point? After that how can I use those values to detect whether there is a fog or not?

Thanks

How many hits?

I had a hard time finding a library for the DHT22 that included dew point when I made my weather station. I ended up taking the dew point function from this DHT11 library and inserting it into the DHT22 library that I was using.

You can calculate the dew point with current temperature and humidity (if <100%). That means if the temperature drops below that point, you may start seeing fog, but likely well before that you’ll have dew forming on your plants, which are normally experiencing a lower temperature (close to the ground) then where you will have mounted your sensor station (the normal height for measuring temperature is 1.5 meters above the ground).

You can add this function to calculate the dewpoint:

``````float calcDewpoint(float humi, float temp) {
float k;
k = log(humi/100) + (17.62 * temp) / (243.12 + temp);
return 243.12 * k / (17.62 - k);
}
``````
1 Like

criminalkaoz:
You can add this function to calculate the dewpoint:

``````float calcDewpoint(float humi, float temp) {
``````

float k;
k = log(humi/100) + (17.62 * temp) / (243.12 + temp);
return 243.12 * k / (17.62 - k);
}

In which measurement system?

aarg:
In which measurement system?

ºC and %

criminalkaoz:
ºC and %

See the attachement 