Go Down

Topic: Is this dew point calculation correct using the DHT-11? (Read 88 times) previous topic - next topic

japreja

I converted a spreadsheet dewpoint calculation I found on http://andrew.rsmas.miami.edu/bmcnoldy/Humidity.html to a function, is this correct?  I've seen several much simpler calculation on the forum and would like to know the accuracy of this find.


Requires the inclusion of math.h for the log(x) function.
Code: [Select]

/*
 * Calculates the dewpoint base off of the temperature and relative humidity
 * calculation of Dewpoint as provided on http://andrew.rsmas.miami.edu/bmcnoldy/Humidity.html
 */
float calcDewpoint(float temp, float rh)
{
  //TD: =243.04*(LN(RH/100)+((17.625*T)/(243.04+T)))/(17.625-LN(RH/100)-((17.625*T)/(243.04+T)))
  return 243.04*(log(rh/100)+((17.625*temp)/(243.04+temp)))/(17.625-log(rh/100)-((17.625*temp)/(243.04+temp)));
}


Also why are the other calculations so simple where this calculation seems more complex?

Thanks in advance for your responses.

el_supremo

It looks correct but the easiest way to check is if you write a little test code and feed it some numbers that you can compare with the online calculator.

Pete
Don't send me technical questions via Private Message.

japreja

I just did that and noticied I should clarify that that temp as required by this function must be provided in degrees F and not C.  Can be modified as follows if temp is provided in Celsius.

Code: [Select]

/*
 * Calculates the dewpoint base off of the temperature and relative humidity
 * calculation of Dewpoint as provided on http://andrew.rsmas.miami.edu/bmcnoldy/Humidity.html
 */
float calcDewpoint(float temp, float rh)
{
  float tempf = (temp * 1.8) + 32;
  //TD: =243.04*(LN(RH/100)+((17.625*T)/(243.04+T)))/(17.625-LN(RH/100)-((17.625*T)/(243.04+T)))
  return 243.04*(log(rh/100)+((17.625*tempf)/(243.04+tempf)))/(17.625-log(rh/100)-((17.625*tempf)/(243.04+tempf)));
}

el_supremo

I tried your code and it gave the same result as the online calculator when I gave it the temperature in Celsius
Quote
(• T and TD inputs/outputs to the equations are in Celsius)
Quote
Also why are the other calculations so simple
Which one(s)?

Pete
Don't send me technical questions via Private Message.

japreja


skywatch

I just did that and noticied I should clarify that that temp as required by this function must be provided in degrees F and not C.  Can be modified as follows if temp is provided in Celsius.
Tried this and although it allows degrees C for the conversion, the output is still in degrees F.

You need to take the output and -32 then * 0.5556 to get dew point in C.

Go Up