The Netherlands
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« on: August 09, 2011, 03:59:02 am » |
Last week I bought a Arduino Duemilanove board and a SHT 15 breakout from Sparkfun. I use the practicalarduino / SHT1x code from Github written by Jonathan Oxor (June 16, 2009). At my job (I work on a technical laboratory) I placed the SHT15 sensor together with another commercial temperature / humidity sensor above a hermetic closed saturated sodium chloride solution. The theoretical value of the humidity of the saturated sodium chloride solution at 20 °C is 75,5%. I measure with the commercial temperature / humidity sensor above the saturated sodium chloride solution an temperature 21,2°C and 75,8% humidity. With the SHT15 breakout I measure above the saturated sodium chloride solution an temperature 21,3°C and 67,1% humidity. Before the measurements I conditioned the SHT15 breakout 20 hour with >75% humidity. Who can help me? Is there maybe a error in the calculation of the humidity in the arduino code SHT1x.cpp? Regards, Jack
|
|
|
|
« Last Edit: August 09, 2011, 06:06:38 am by jack100 »
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 88
Posts: 9392
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #1 on: August 09, 2011, 06:42:08 am » |
Welcome, Is there maybe a error in the calculation of the humidity in the arduino code SHT1x.cpp? Can you post a link to the code of the library? Have you checked the code with the datasheet or other implementations? - http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1207363224- http://www.arduino.cc/playground/Code/Sensirion
|
|
|
|
|
Logged
|
|
|
|
|
The Netherlands
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #2 on: August 09, 2011, 07:09:12 am » |
I use the next code for the library SHT1x.cpp See attachment
Jack
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 88
Posts: 9392
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #3 on: August 09, 2011, 07:55:19 am » |
TemperatureLooking at the formulas they almost agree with the datasheet , - http://www.sensirion.com/en/pdf/product_information/Datasheet-humidity-sensor-SHT1x.pdf - Raw temperature is in 1/100 Celsius with zero == -40C : -40 C equals -40 F That is why the functions/formulas look identical the params D1 in the lib code for Celsius is off with one tenth [table 8], exactly your difference. You need to change the two lines marked <<<<<<<<< float SHT1x::readTemperatureC() { int _val; // Raw value returned from sensor float _temperature; // Temperature derived from raw value
// Conversion coefficients from SHT15 datasheet const float D1 = -40.1; // for 14 Bit @ 5V <<<<<<<<<<<<<<<<<<<<<<< const float D2 = 0.01; // for 14 Bit DEGC
// Fetch raw value _val = readTemperatureRaw();
// Convert raw value to degrees Celsius _temperature = (_val * D2) + D1;
return (_temperature); }
float SHT1x::readTemperatureF() { int _val; // Raw value returned from sensor float _temperature; // Temperature derived from raw value
// Conversion coefficients from SHT15 datasheet const float D1 = -40.2; // for 14 Bit @ 5V <<<<<<<<<<<<<<<<<<<<<<< const float D2 = 0.018; // for 14 Bit DEGF
// Fetch raw value _val = readTemperatureRaw();
// Convert raw value to degrees Fahrenheit _temperature = (_val * D2) + D1;
return (_temperature); }
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 88
Posts: 9392
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #4 on: August 09, 2011, 07:59:59 am » |
Humidity
The formula in The library for humidity is different than in the datasheet , Check chapter 4 and adapt the constants in the function c1,c2,c3 T1, T2 according to Table 6 and 7
succes, Rob
|
|
|
|
|
Logged
|
|
|
|
|
The Netherlands
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #5 on: August 09, 2011, 08:46:16 am » |
Hi Rob,
After all the changes, there is no improvement. Humidity 66.5% instead of 75,5%
Jack
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 88
Posts: 9392
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #6 on: August 09, 2011, 01:24:56 pm » |
Hi Jack, did you make the changes to the humidity formulas too? (code not tested) float SHT1x::readHumidity() { int _val; // Raw humidity value returned from sensor float _linearHumidity; // Humidity with linear correction applied float _correctedHumidity; // Temperature-corrected humidity float _temperature; // Raw temperature value
// Conversion coefficients from SHT15 datasheet const float C1 = -2.0468; // for 12 Bit const float C2 = 0.0367; // for 12 Bit const float C3 = -1.5955E-6; // for 12 Bit const float T1 = 0.01; // for 14 Bit @ 5V const float T2 = 0.00008; // for 14 Bit @ 5V
// Command to send to the SHT1x to request humidity int _gHumidCmd = 0b00000101;
// Fetch the value from the sensor sendCommandSHT(_gHumidCmd, _dataPin, _clockPin); waitForResultSHT(_dataPin); _val = getData16SHT(_dataPin, _clockPin); skipCrcSHT(_dataPin, _clockPin);
// Apply linear conversion to raw value _linearHumidity = C1 + C2 * _val + C3 * _val * _val;
// Get current temperature for humidity correction _temperature = readTemperatureC();
// Correct humidity value for current temperature _correctedHumidity = (_temperature - 25.0 ) * (T1 + T2 * _val) + _linearHumidity;
return (_correctedHumidity); }
|
|
|
|
|
Logged
|
|
|
|
|
The Netherlands
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #7 on: August 09, 2011, 03:11:04 pm » |
Hi Rob,
Off course, I have changed the humidity formulas too. But not improvement, strange.
Jack
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 88
Posts: 9392
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #8 on: August 10, 2011, 06:14:33 am » |
So the humidity is 11% off, Q1: If you test another humidity, is the difference the same (absolute /or relative%) ?
Q2: Can you print the _linearHumidity; ? // return (_linearHumidity);
(question underlying: is the correction formula is right?)
|
|
|
|
|
Logged
|
|
|
|
|
The Netherlands
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #9 on: August 10, 2011, 01:37:10 pm » |
A sort summary.
When I measure the temperature and the humidity above a hermetic closed saturated sodium chloride solution I got the next results: Commercial temperature/humidity sensor (Vaisala) temperature 21.1 °C and humidity 75.8% SHT15 breakout temperature 21.3 °C and humidity 67.1%
When I measure the temperature and the humidity in a thermostatic calibration room of our laboratory I get the next results: Commercial temperature/humidity sensor (Vaisala) temperature 20.0 °C and humidity 53.3% SHT15 breakout temperature 20.1 °C and humidity 53.2%
It seems if the SHT15 above 65-66% humidity saturate.
The correction formula in the SHT1x.cpp and the datasheet of Sensirion is the same, but I don’t know if this formula is right.
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 88
Posts: 9392
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #10 on: August 10, 2011, 01:51:17 pm » |
saturated sodium chloride solution Could it be that the sensor is calibrated for water vapor and that sodium chloride vapor reacts differently? From my physics I recall that the amount of molecules in a gas is constant (P.V)/(n.T) = R. but also that water molecules are smaller than sodium chloride. It seems if the SHT15 above 65-66% humidity saturate. Is it possible for you to check the sensor with above 65% humidity with water iso ? Sorry I can't give a definitive answer..
|
|
|
|
|
Logged
|
|
|
|
|
Netherlands
Offline
Tesla Member
Karma: 88
Posts: 9392
In theory there is no difference between theory and practice, however in practice there are many...
|
 |
« Reply #11 on: August 10, 2011, 02:03:25 pm » |
From the datasheet: 1.3 Storage Conditions and Handling Instructions It is of great importance to understand that a humidity sensor is not a normal electronic component and needs to be handled with care. Chemical vapors at high concentration in combination with long exposure times may offset the sensor reading. think it is time to question HQ info@sensirion.com
|
|
|
|
|
Logged
|
|
|
|
|
The Netherlands
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #12 on: August 10, 2011, 02:11:58 pm » |
At my job we have 3 commercial Vaisala temperature/humidity sensors. Every year we calibrated these sensors with a saturated sodium chloride solution (75.5% humidity) and a saturated lithium chloride solution (11.3%). Allways we measure for the sensors humidity 74.5 – 76.5% with a saturated sodium chloride solution. This method works perfect. Commercial calibration laboratory works on the same maner.
I am afraid that Sensirion not calibrate each sensor (they say yes). The support of this company is very bad (arrogant!)
|
|
|
|
« Last Edit: August 10, 2011, 02:20:46 pm by jack100 »
|
Logged
|
|
|
|
|
The Netherlands
Offline
Newbie
Karma: 0
Posts: 24
|
 |
« Reply #13 on: August 10, 2011, 02:17:35 pm » |
I contact Sensirion few days ago. info@sensirion.comBut they react very arrogant. The (maybe) fault is not by Sensirion but by Sparkfun or the consumer!
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Tesla Member
Karma: 71
Posts: 6603
Arduino rocks
|
 |
« Reply #14 on: August 11, 2011, 01:54:00 pm » |
Could it be that the sensor is calibrated for water vapor and that sodium chloride vapor reacts differently? From my physics I recall that the amount of molecules in a gas is constant (P.V)/(n.T) = R. but also that water molecules are smaller than sodium chloride.
sodium chloride vapor?? At 1000 degrees maybe! The saturated salt solution is used to provide a repeatable partitioning of the moisture between the air and the salt, so you can calibrate humidity sensors. The sodium and chloride ions are bound to dozens of water molecules each and won't evaporate at any measurable rate, only the individual water molecules can do that. In the saturated solution the water molecules are bound to the salt ions and evaporate less easily than pure water, hence the relative humidity being less than 100%. Clearly the SHT15 sensor isn't conforming to its datasheet? If its performing repeatably then you've calibrated it!
|
|
|
|
|
Logged
|
|
|
|
|
|