Go Down

Topic: SHT15 breakout will not measure the theoretical value (Read 3 times) previous topic - next topic

jack100

Aug 09, 2011, 10:59 am Last Edit: Aug 09, 2011, 01:06 pm by jack100 Reason: 1
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




robtillaart

Welcome,

Quote
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
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

jack100

I use the next code for the library SHT1x.cpp
See attachment

Jack

robtillaart


Temperature
Looking 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 <<<<<<<<<

Code: [Select]

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


Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

robtillaart


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


Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

jack100

Hi Rob,

After all the changes, there is no improvement.
Humidity 66.5% instead of 75,5%

Jack

robtillaart

Hi Jack,

did you make the changes to the humidity formulas too?

(code not tested)
Code: [Select]

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);
}
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

jack100

Hi Rob,

Off course, I have changed the humidity formulas too.
But not improvement, strange.

Jack

robtillaart


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?)
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

jack100

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.

robtillaart

Quote
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.

Quote
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..



Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

robtillaart

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 
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

jack100

#12
Aug 10, 2011, 09:11 pm Last Edit: Aug 10, 2011, 09:20 pm by jack100 Reason: 1
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!)

jack100

I contact Sensirion few days ago.
info@sensirion.com

But they react very arrogant. The (maybe) fault is not by Sensirion but by Sparkfun or the consumer!

MarkT

Quote
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!
[ I won't respond to messages, use the forum please ]

Go Up