Is this dew point calculation correct using the DHT-11?

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.

/*
 * 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.

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

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.

/*
 * 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)));
}

I tried your code and it gave the same result as the online calculator when I gave it the temperature in Celsius

(• T and TD inputs/outputs to the equations are in Celsius)

Also why are the other calculations so simple

Which one(s)?

Pete

el_supremo:
Which one(s)?

https://forum.arduino.cc/index.php?topic=504940.msg3445563#msg3445563

and external sites too:

are just a few, I just used a google search of "arduino dht 11 dewpoint" before posting, some do seem more complex than the one I found on the here on the forums.

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.

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.