PDA

View Full Version : I want to calculate relative humidity to absolute humidity. result in g/kg



mathyknaapen
- 28th November 2013, 22:40
Hi,

with the formula Av = (Rv * 1325,3 * 10^(7,5892 * T / (T+240,71)))/(T+273,15)

it should be possible to calculate the absolute humidity.

RV = relative humidity
T = temperature in degrees.

As you see, lots of huge numbers, comma's and even an exponentiation

Is a wizkid out there how knows to calculate this in PBP3? I'm using a PIC16F1936

Many thanks

pedja089
- 28th November 2013, 23:43
It's not to hard to do that...
Create lookup table in flash memory for this
1325,3 * 10^(7,5892 * T / (T+240,71))
for range you need, and step 1-10 degrees, depending on accuracy. Scale it to get most of byte, or word range. Then use interpolation to get more precise result.
Then just multiply Rv and value from lookup table. After that divide with absolute temp.
That way I have done this calculation http://www.picbasic.co.uk/forum/showthread.php?t=18483