Pages: [1]   Go Down
Author Topic: SHT15 humid & temp readings climb over time, h  (Read 3069 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 46
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I bought a Sensitron SHT15 temp & humidity sensor from Sparkfun and noticed that it's temp and humidity readings would rise over time, regardless of the conditions surrounding the sensor.

I thought the problem was a faulty sensor so I picked up a SHT75 which is the same sensor but on a breakout board and experienced the same problems.

Armed with two sensors I set up a series of tests in rH controlled environments and I am not pleased with the results.

For my tests I used a nice Xikar digital cigar hygrometer as a control, 65% rH calibrated silica beads, and for round two of testing, a 75.5% rH Boveda humidpak for hygrometer calibration (http://www.humidipak.com/technology/HowItWorks.aspx) in a ziploc bag.

Here's the set-up with the silica beads (2/3 lbs in a 1gallon ziploc)


I began testing after the bag had stabilized for 8 hours.  As you can see the cigar hygrometer is perfect at 65% rH.

First I used Glacial Wander's code: http://www.glacialwanderer.com/hobbyrobotics/?p=5

And pressed 'h' to measure humidity approximately every 3 seconds and included 1 't' for temp. at the bottom for reference.  Here are my results:
Glacial Wanderer every 3 seconds
Code:

Humidity is:2033.0000000000000000  66.7638549804
Humidity is:2031.0000000000000000  66.7056121826
Humidity is:2029.0000000000000000  66.6473464965
Humidity is:2029.0000000000000000  66.6473464965
Humidity is:2030.0000000000000000  66.6764831542
Humidity is:2030.0000000000000000  66.6764831542
Humidity is:2031.0000000000000000  66.7056121826
Humidity is:2031.0000000000000000  66.7056121826
Humidity is:2031.0000000000000000  66.7056121826
Humidity is:2031.0000000000000000  66.7056121826
Humidity is:2032.0000000000000000  66.7347335815
Humidity is:2032.0000000000000000  66.7347335815
Humidity is:2033.0000000000000000  66.7638549804
Humidity is:2033.0000000000000000  66.7638549804
Humidity is:2033.0000000000000000  66.7638549804
Humidity is:2034.0000000000000000  66.7929611206
Humidity is:2034.0000000000000000  66.7929611206
Humidity is:2034.0000000000000000  66.7929611206
Humidity is:2034.0000000000000000  66.7929611206
Humidity is:2034.0000000000000000  66.7929611206
Humidity is:2034.0000000000000000  66.7929611206
Humidity is:2034.0000000000000000  66.7929611206
Humidity is:2034.0000000000000000  66.7929611206
Humidity is:2035.0000000000000000  66.8220748901
Humidity is:2035.0000000000000000  66.8220748901
Humidity is:2036.0000000000000000  66.8511734008
Humidity is:2036.0000000000000000  66.8511734008
Humidity is:2036.0000000000000000  66.8511734008
Humidity is:2036.0000000000000000  66.8511734008
Humidity is:2036.0000000000000000  66.8511734008
Humidity is:2036.0000000000000000  66.8511734008
Humidity is:2036.0000000000000000  66.8511734008
Humidity is:2036.0000000000000000  66.8511734008
Humidity is:2036.0000000000000000  66.8511734008
Humidity is:2036.0000000000000000  66.8511734008
Humidity is:2037.0000000000000000  66.8802642822
Temp is:6190.0000000000000000  71.4199981689
Humidity is:2047.0000000000000000  67.1709213256
Humidity is:2047.0000000000000000  67.1709213256
Humidity is:2048.0000000000000000  67.1999511718
Humidity is:2047.0000000000000000  67.1709213256
Humidity is:2047.0000000000000000  67.1709213256
Humidity is:2047.0000000000000000  67.1709213256
Humidity is:2048.0000000000000000  67.1999511718
Humidity is:2047.0000000000000000  67.1709213256
Humidity is:2048.0000000000000000  67.1999511718
Humidity is:2050.0000000000000000  67.2580032348
Humidity is:2051.0000000000000000  67.2870178222
Humidity is:2051.0000000000000000  67.2870178222

Notice that when the humidity does increase, it's by approximately 0.0291.  Very strange.

In the 5 minutes it took me to copy and paste the values and compose this post the rH has increased to 67.6058349609%.  Keep in mind this is a 65% environment which has been stabilized for over 8 hours.  The other hygro has maintained a rock solid 65%.


Next, using the same 65% rH test environment I uploaded the ReadSHT1xValues.pde and library from here: http://github.com/practicalarduino/SHT1x

Making no changes to the test environment at all, I got these results approx. 10 minutes after using Glacial Wanderer's code:

Code:

Starting up
Temperature: 21.7799987792C / 71.2039947509F. Humidity: 71.27%
Temperature: 21.7700004577C / 71.2399978637F. Humidity: 71.24%
Temperature: 21.8199996948C / 71.2759933471F. Humidity: 71.18%
Temperature: 21.8099975585C / 71.3299942016F. Humidity: 71.16%
Temperature: 21.8699989318C / 71.4199981689F. Humidity: 71.13%
Temperature: 21.8199996948C / 71.3479919433F. Humidity: 71.12%
Temperature: 21.8599967956C / 71.3479919433F. Humidity: 71.10%
Temperature: 21.8699989318C / 71.4199981689F. Humidity: 71.07%
Temperature: 21.9099998474C / 71.4379959106F. Humidity: 71.04%
Temperature: 21.8699989318C / 71.4019927978F. Humidity: 71.04%
Temperature: 21.8599967956C / 71.4379959106F. Humidity: 70.98%
Temperature: 21.8999977111C / 71.4739913940F. Humidity: 71.01%
Temperature: 21.8799972534C / 71.4019927978F. Humidity: 70.97%
Temperature: 21.8699989318C / 71.4019927978F. Humidity: 70.94%
Temperature: 21.8799972534C / 71.4379959106F. Humidity: 70.98%
Temperature: 21.8799972534C / 71.4559936523F. Humidity: 70.98%
Temperature: 21.9199981689C / 71.5279922485F. Humidity: 70.99%
Temperature: 21.8999977111C / 71.4559936523F. Humidity: 70.98%
Temperature: 21.8699989318C / 71.3839950561F. Humidity: 70.98%
Temperature: 21.9199981689C / 71.4919967651F. Humidity: 70.99%
Temperature: 21.9399986267C / 71.5279922485F. Humidity: 70.95%
Temperature: 21.8999977111C / 71.4559936523F. Humidity: 70.95%
Temperature: 21.9300003051C / 71.5279922485F. Humidity: 70.93%
Temperature: 21.9499969482C / 71.5459976196F. Humidity: 70.93%
Temperature: 21.9399986267C / 71.5279922485F. Humidity: 70.96%
Temperature: 21.8999977111C / 71.4739913940F. Humidity: 70.93%
Temperature: 21.9499969482C / 71.5639953613F. Humidity: 70.93%
Temperature: 21.9599990844C / 71.5999984741F. Humidity: 70.97%
Temperature: 21.9799995422C / 71.5999984741F. Humidity: 70.97%
Temperature: 22.0299987792C / 71.5999984741F. Humidity: 70.94%
Temperature: 22.0000000000C / 71.6719970703F. Humidity: 70.94%
Temperature: 22.0000000000C / 71.6719970703F. Humidity: 70.90%
Temperature: 21.9799995422C / 71.6359939575F. Humidity: 70.88%
Temperature: 21.9699974060C / 71.5999984741F. Humidity: 70.87%
Temperature: 21.9899978637C / 71.5999984741F. Humidity: 70.87%
Temperature: 21.9799995422C / 71.5639953613F. Humidity: 70.87%
Temperature: 22.0000000000C / 71.6359939575F. Humidity: 70.87%
Temperature: 22.0000000000C / 71.6359939575F. Humidity: 70.88%
Temperature: 22.0000000000C / 71.6359939575F. Humidity: 70.87%
Temperature: 22.0000000000C / 71.6179962158F. Humidity: 70.88%
Temperature: 21.9899978637C / 71.5999984741F. Humidity: 70.84%
Temperature: 21.9599990844C / 71.6179962158F. Humidity: 70.84%
Temperature: 22.0200004577C / 71.6719970703F. Humidity: 70.85%
Temperature: 21.9899978637C / 71.5819931030F. Humidity: 70.84%
Temperature: 21.9899978637C / 71.6539916992F. Humidity: 70.84%
Temperature: 22.0000000000C / 71.6359939575F. Humidity: 70.88%
Temperature: 21.9899978637C / 71.6179962158F. Humidity: 70.88%
Temperature: 21.9899978637C / 71.6359939575F. Humidity: 70.91%
Temperature: 22.0299987792C / 71.7079925537F. Humidity: 70.91%
Temperature: 21.9699974060C / 71.6179962158F. Humidity: 70.91%
Temperature: 21.9899978637C / 71.5999984741F. Humidity: 70.87%
Temperature: 22.0000000000C / 71.6719970703F. Humidity: 70.87%
Temperature: 22.0099983215C / 71.6539916992F. Humidity: 70.88%
Temperature: 21.9799995422C / 71.6359939575F. Humidity: 70.88%
Temperature: 22.0299987792C / 71.6539916992F. Humidity: 70.90%
Temperature: 22.0399971008C / 71.6719970703F. Humidity: 70.88%

Not changes were made to the environment yet the results are very different.

This is the 75% rh test environment:


Here the store was the same.

The accuracy of the sensor matters to me because I am using it to control a humidifier to maintain a desired humidity.  I'd be happy to subtract whatever the error differential is from the humidity reading to get something accurate, but I can't discern a pattern here.  After many days of running the 75% test it peaked at about 81.5% and held relatively constant there.


Can someone please help me figure out what's going on here?  The code I'm using is unmodified and from the generally accepted source.  I can reproduce these strange results with two different sensors so I don't think they're faulty.  This is very frustrating because the problem is much more than the sensors are off by a percentage or two -- overtime that error increases so the value it's return is really useless.

Thanks,
Jacob

« Last Edit: June 26, 2010, 07:25:51 pm by .jacob » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 46
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Richard,

In my actual application conditions are only sampled every 1.5 hours and even then it creeps significantly.  After 2 days it's off by +5-7%.

It is annoying that the $20 cigar hygro is steady for months on end whereas the $35 and $40 sensors wander significantly after just a few hours.  I don't know to who that would be acceptable.  The datasheet claims the sensor is calibrated and +-1.8% accurate.  That is all I expect.  I don't think I'm asking for much here...

« Last Edit: June 26, 2010, 08:54:01 pm by .jacob » Logged

North Yorkshire, UK
Offline Offline
Faraday Member
**
Karma: 104
Posts: 5531
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Not that this would be the greatest way to have it but if you attach the power to an arduino digital pin so you can turn it on and off. Then only turn it on when you take a reading. Presumably the humidity readings would then be correct.

Obviously this is not a great solution to the issue with the sensors but maybe it will allow you to use these sensors.

Mowcius
Logged

Sussex UK / CT USA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1028
Forums forever
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So refreshing to see a carefully reseached question... and thank you Richard for "...trying to measure high-tide with a micrometer. "!

I have been monitoring atmospheric "humdity" for years with...

http://www.hobby-boards.com/catalog/product_info.php?products_id=46

... units, which are built around HIH-4021 humidity sensors.

And I know there's something I don't understand about the definition of "humidity".

The reading from the sensor rises and falls dramatically when the ambient temperature rises and falls. Now... this is okay, for my needs... I mostly want to watch the humidity in a room which is kept to a fairly steady temperature, and I don't need the resolution of the original poster... but it leads me to wonder if temperature is the "culprit" in his scenario.

Perhaps if the tests were re-run in sealed containers with a small fan running in them to ensure no "micro climates", different results would arise?

Turning the sensors on an off seems too much like hard work to me. Better(?) to leave them on, let them stabilize, and simply compensate for any "error" (offset?)?

Encouraging to read that the sensors DO stablize, even in tests to date. Perhaps the sensor element absorbs moisture, takes a while to "dry" to the ambient conditions? A bit worrying if that's the "answer", given that one would hope the sensor would be responsive... perhaps the output swings in step with the environment, but, after a change, the final settling onto "exactly" the right reading takes time? Subject for further tests in that "sealed environment with a fan"... but now we need a way to inject a tiny bit of water after reaching the first stable state!
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 46
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So can we assume you are powering it correctly, and otherwise following all the data sheet recommendations?  Did you plot temp vs. humidity readings to see if there is any drift correlation clue?

The datasheet recommends powering the sensor with 3.3v, however, when I use 3.3v the readings are utterly wrong.  With a 5v power source the readings are much closer.

I'm working on a series of graphs plotting temp and humidity over time for each sensor code.  I will post those shortly when they are finished.

Quote
Did you check the SparkFun online discussion forum?  It says there are 34 messages about SHT15.

I did check the SF forums, nothing there was relevant to the accuracy issues I am experiencing.
« Last Edit: June 27, 2010, 05:48:02 pm by .jacob » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 46
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

A search for "SHT15" yields 357 results on this website versus 34 on SFE.  It would seem obvious to me that this is the knowledge base.

I have reached out to SFE Support and presented my findings and they believe I have a faulty sensor.  However, since buying a SHT75 to test the 15 against and being able to reproduce the exact same results on each, I don't think the sensor is the issue.

The Xikar is not able to Tweet the readings every 1.5 hours and control a humidifier based on humidity conditions like an Arduino is.

Jacob
« Last Edit: June 27, 2010, 09:31:31 pm by .jacob » Logged

Cumming, GA
Offline Offline
Edison Member
*
Karma: 20
Posts: 1663
Ultimate DIY: Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset



The sensor has an internal heater... make sure you haven't turned it on.

« Last Edit: June 27, 2010, 09:47:17 pm by pwillard » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 46
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've read that the heater raises ambient temp readings 5-10* C.  My temp does wander a bit, but never that high against ambient.

In any event, how do I ensure the heater is off?  Here is the library I am using:
http://github.com/practicalarduino/SHT1x

In the other test code I'm using, http://ragingreality.blogspot.com/2008/01/ardunio-and-sht15.html, he says the heater is not activated.

Thank you,
jacob
« Last Edit: June 27, 2010, 10:08:52 pm by .jacob » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 46
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is the first of my graphs.



This was generated over approximately 6.5 hours with readings sampled every 30 seconds.  It is the same 65% rH environment shown in the first post.

Temperature tracked quite accurately to ambient and the humidity is ~5% higher than it should be.

Here is the slightly modified version of Glacial's code I used:

Code:
// Maurice Ribble
// 4-3-2008
// http://www.glacialwanderer.com/hobbyrobotics

// This code tests the SHT15 on the Arduino board.
// This app assumes your data pin is pin 10 and your your clock pin is pin 11.
// To run this app just attach HyperTerminal (or similar serial communications tool)
// to your Arduino board at 9600 bits per second.  I also needed te set the
// flow control to none or I couldn't send commands to my Arduino board via HyperTerminal.
// Then press the 't' key to take a temperature reading or the 'h' key to take a
// humidity reading.

// These are commands we need to send to HSHT15 to control it
int gTempCmd  = 0b00000011;
int gHumidCmd = 0b00000101;
  
int shiftIn(int dataPin, int clockPin, int numBits)
{
   int ret = 0;
   int i;

   for (i=0; i<numBits; ++i)
   {
      digitalWrite(clockPin, HIGH);
      delay(10);  // I don't know why I need this, but without it I don't get my 8 lsb of temp
      ret = ret*2 + digitalRead(dataPin);
      digitalWrite(clockPin, LOW);
   }

   return(ret);
}

void sendCommandSHT(int command, int dataPin, int clockPin)
{
  int ack;

  // Transmission Start
  pinMode(dataPin, OUTPUT);
  pinMode(clockPin, OUTPUT);
  digitalWrite(dataPin, HIGH);
  digitalWrite(clockPin, HIGH);
  digitalWrite(dataPin, LOW);
  digitalWrite(clockPin, LOW);
  digitalWrite(clockPin, HIGH);
  digitalWrite(dataPin, HIGH);
  digitalWrite(clockPin, LOW);
          
  // The command (3 msb are address and must be 000, and last 5 bits are command)
  shiftOut(dataPin, clockPin, MSBFIRST, command);

  // Verify we get the coorect ack
  digitalWrite(clockPin, HIGH);
  pinMode(dataPin, INPUT);
  ack = digitalRead(dataPin);
  if (ack != LOW)
    Serial.println("Ack Error 0");
  digitalWrite(clockPin, LOW);
  ack = digitalRead(dataPin);
  if (ack != HIGH)
     Serial.println("Ack Error 1");
}

void waitForResultSHT(int dataPin)
{
  int i;
  int ack;
  
  pinMode(dataPin, INPUT);
  
  for(i= 0; i < 100; ++i)
  {
    delay(10);
    ack = digitalRead(dataPin);

    if (ack == LOW)
      break;
  }
  
  if (ack == HIGH)
    Serial.println("Ack Error 2");
}

int getData16SHT(int dataPin, int clockPin)
{
  int val;
  
  // Get the most significant bits
  pinMode(dataPin, INPUT);
  pinMode(clockPin, OUTPUT);
  val = shiftIn(dataPin, clockPin, 8);
  val *= 256;

  // Send the required ack
  pinMode(dataPin, OUTPUT);
  digitalWrite(dataPin, HIGH);
  digitalWrite(dataPin, LOW);
  digitalWrite(clockPin, HIGH);
  digitalWrite(clockPin, LOW);
          
  // Get the lest significant bits
  pinMode(dataPin, INPUT);
  val |= shiftIn(dataPin, clockPin, 8);

  return val;
}

void skipCrcSHT(int dataPin, int clockPin)
{
  // Skip acknowledge to end trans (no CRC)
  pinMode(dataPin, OUTPUT);
  pinMode(clockPin, OUTPUT);

  digitalWrite(dataPin, HIGH);
  digitalWrite(clockPin, HIGH);
  digitalWrite(clockPin, LOW);
}

void setup()
{
   Serial.begin(9600); // open serial
}

void loop()
{
  int theDataPin  = 7;
  int theClockPin = 6;
  char cmd = 0;
  int ack;
  
      
           float val;
           float temp;
  
          
           sendCommandSHT(gTempCmd, theDataPin, theClockPin);
           waitForResultSHT(theDataPin);
           val = getData16SHT(theDataPin, theClockPin);
           skipCrcSHT(theDataPin, theClockPin);

           temp = -40.0 + 0.018 * (float)val;
           Serial.print(temp, DEC);        

           float humid;
          
           sendCommandSHT(gHumidCmd, theDataPin, theClockPin);
           waitForResultSHT(theDataPin);
           val = getData16SHT(theDataPin, theClockPin);
           skipCrcSHT(theDataPin, theClockPin);
          
           humid = -4.0 + 0.0405 * val + -0.0000028 * val * val;
           Serial.print("|");
           Serial.println(humid, DEC);

    delay(30000);
}


I've now begin the same process using the example code here: http://github.com/practicalarduino/SHT1x and in the same environment also sampling ever 30 seconds.

It's interesting to note that in switching the second code, the temperature dropped immediately to 71.7* F and the humidity climbed to 73.5%.  The only change I made between the first test and beginning the second was uploading new code.  Very strange.

Jacob
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 46
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Upon further investigation it looks to me that Sensitron has updated the sensors recently to v4 models and also updated the corresponding coefficients used to interpret the sensor's raw signal.  I believe both Glacial Wanderer's and the Github code both use v3 or older coefficients which explains the problem readings I'm getting.

In my first revision of the Github code I've brought down the humidity readings 5%.  It's still not perfect yet, but it's much closer.

I'm waiting to hear back from Sensirion to find out what version my sensors are.
« Last Edit: June 28, 2010, 02:24:04 am by .jacob » Logged

Sussex UK / CT USA
Offline Offline
Edison Member
*
Karma: 0
Posts: 1028
Forums forever
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That inverse relationship between tture and "humidity" is EXACTLY the sort of thing I was talking about in my earlier post. The Wikipedia article about the different sorts of "humidity" may be helpful...

http://en.wikipedia.org/wiki/Humidity

Warm air can "hold" more water than cold air. The Sensitron may be reporting "humidity" as the % to which the air... at the current tture... is saturated. So, in a sealed system, with no change in volume of air, no change in number of water molecules, will be "less humid" at higher temperatures.
Logged

Plano, TX
Offline Offline
Full Member
***
Karma: 0
Posts: 101
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Quote
The datasheet recommends powering the sensor with 3.3v, however, when I use 3.3v the readings are utterly wrong
That seems to me like a major clue.  If the chip doesn't operate as specified, then something is fundamentally wrong.
The sensor is spec'd to operate from 2.4V to 5.5V but I'd expect the intention is to operate both ends of the interface (ie, Arduino and the sensor) at the same voltage since the I/O pins are spec'd relative to Vdd.  The spec does recommend 3.3V for best accuracy but it sounds like that's because 3.3V is used when the sensor is calibrated.  The spec includes different temperature formula coefficients for various voltages - there is about a 0.5 C difference between 3.3V and 5V.

Quote
I'm waiting to hear back from Sensirion to find out what version my sensors are
The spec says V3 sensors are labeled with numeric codes while the V4 sensors have alpha-numeric codes.  I've included the V4 coefficients in an update to the "Sensirion" library on the Playground page if you want to give that a try.  It seems to work well with my sensor but I don't have the calibration tools you have used to validate performance.  I'd love to hear your results if you get a chance to try that library.

Carl

Logged

Pages: [1]   Go Up
Jump to: