Important questions here are how precise and how accurate does your result need to be? (There is a difference between precision and accuracy.)
The formula you give compensates for the non-linearity of the sensor, and it is from the product data sheet, section 4.1:
http://www.sensirion.com/en/pdf/prod...nsor-SHT7x.pdf
Warning: Do not try to use anything like:
("Danger, Will Robinson!")RH=(0-2046800+(36700*(SORH*1000000))-((SORH*1000000)*(SORH*1000000)*1595500/10000
Substitute 2353 (approximately 76% RH) for SOrh in the above formula and you will see why. (I get something like 883 quintillionths of a percent . . . very dry humor, indeed.)
Suggestion:
For the 12-bit data for which it is intended, the formula can be reduced, with some loss of precision, to:
%RH = (SOrh/27) - [(SOrh)(SOrh)/627,000] - 2
Again using 2353 (for 75.79% RH, according to the manufacturer), this gives 76.3; the manufacturer's formula gives 75.5.
The 12-bit output from the sensor ranges from 0 (for 0%) to about 3400 (for 100%). I'm guessing the 8-bit output goes from 0 to about 212, so you may be a lot happier using the 8-bit output. (212 squared is 44,944; the square root of 65,536 is 256. But 2353--for about 76% RH--when squared is over 5.5 million!)
By the way, that is only compensating for non-linearity of the sensor itself; compensation for temperature is given in 4.2. (A 10 degree difference from 25 Celsius amounts to an adjustment of 1.2 percent RH, an increase if more, a decrease if less.)
The manufacturer provides an application note that gives three other ways to calculate the compensated value for non-linearity; the first two methods are much simpler and ideally suited to a microprocessor application. The formulas are given for both 8 and 12 bits:
See section 2 of: http://www.sensirion.com/pdf/product..._Sensors_E.pdf
If an accurate result, precise within a percent or two, plus or minus, is acceptable, you should have no problem. If you need help converting the factors in the tables of sections 2.1 or 2.2, just ask.
Another suggestion: It is easier to divide by a whole number than to multiply by a decimal fraction.





Bookmarks