HTU21D lower then spectated humidity read

i’m using the htu21d breackout from sparkfun and the adafruit library for it

the values i get are in the area 5 to 7 some times going to -0.5 , but the city humidity today should be around 78%

even considering that it is on a breadboard on the side of my computer(not on its exhaust path) it should not have such a disparity

any idea of what cold be the causing this?

db-export.png

Show us your code!

Are the temperature values correct?

If they are, your sensor may be damaged. I don't know how the sensor reacts to condensing humidity (it seems that your living place has extraordinarily high humidity) but you can try activating the integrated heater to dry the sensor.

here

#include <Adafruit_HTU21DF.h>
#include <Arduino.h>
#include <Ethernet.h>
#include <EthernetClient.h>
#include <HardwareSerial.h>
#include <IPAddress.h>
#include <Print.h>
#include <stdint.h>
#include <WString.h>

//08 00 27 02 DF 9D
const uint8_t mac = {0x00,0x1A,0x64,0x1F,0xDF,0x9F};
const IPAddress ip = IPAddress(192, 168, 25, 241);
const IPAddress ipT = IPAddress(192, 168, 25, 4);
EthernetClient client;

Adafruit_HTU21DF SenseUT = Adafruit_HTU21DF();

void setup()
{
Serial.begin(9600);
Serial.println(“started”);
if(Ethernet.begin(mac) == 0){ //inicia a placa ethernet
Ethernet.begin(mac,ip);
Serial.println(“dhcp fail”);
Serial.println(Ethernet.localIP());
}else {
Serial.println(“dhcp ok”);
Serial.println(Ethernet.localIP());
}

delay(1000);// deleay para a placa ethernet ter tempo de iniciar completamente

SenseUT.begin();// inicia o sensor temperatura e umidade

}

void loop()
{
if (client.connect(ipT, 80) == 1){
float h = SenseUT.readHumidity();
float t = SenseUT.readTemperature();
Serial.print("conected: “);
Serial.print(t);
Serial.print(” “);
Serial.println(h);
client.println(“GET /tcc/save.php?t=” + (String)t + “&h=” + (String)h + " HTTP/1.1”);
client.println("Host: " + (String)ipT + “Connection: close”);
client.println();
client.stop();
}
else {
Serial.println(“error conecting”);
Serial.println(client.getWriteError());
}
delay(10000);
}

and yes the temperatures is about right, is in the case of 29Cº

so i turned on the heater on the htu21d and the valued got locked at "Temperature:32.5C Humidity:-6.0%"
the ambient temperature in here is about 30.5C

Just to check that: The values you posted are from the serial output not what you provided to the web server? If you just posted the web server values please check the serial output and post those values.

The values with the heater on are about what could be expected as the heater puts the sensor to about 1.5°C above the ambient temperature, so the humidity should decrease.

they are from the serial output, i send the values to the serial as well when i send then to the web server, because debug...

It seems that your sensor is damaged. I couldn't find a library for that sensor that checks the CRC byte the sensor provides (unfortunately) but if the temperature values are constantly in a feasible range and just the humidity values are way out I would say the sensor is not working correctly. Is the white cover still in place? Did you store the sensor as suggested in the datasheet?

it is new(just out off the ant-static bag), and it don't have the white cover, the HTU21DF has it, the HTU21D don't

the ting is, if i use the spark-fun library, noting changes, and this library do crc checks, if the crc did not mach the readHumidity function wold return 999

omgalof:
the ting is, if i use the spark-fun library, noting changes, and this library do crc checks, if the crc did not mach the readHumidity function wold return 999

That's correct, the Sparkfun library is by far the best for this family of devices (HTU21D, SHT21, Si7021, all about the same sensor). Did you ever get a 999 or 998 returned with your sensor using this library?

This is from the datasheet of the Si7021:

4.6. Bake/Hydrate Procedure
After exposure to extremes of temperature and/or humidity for prolonged periods, the polymer sensor film can become either very dry or very wet, in each case the result is either high or low relative humidity readings. Under normal operating conditions, the induced error will diminish over time. From a very dry condition, such as after shipment and soldering, the error will diminish over a few days at typical controlled ambient conditions, e.g., 48 hours of 45 ≤ %RH ≤ 55. However, from a very wet condition, recovery may take significantly longer. To accelerate recovery from a wet condition, a bake and hydrate cycle can be implemented. This operation consists of the following steps:

  • Baking the sensor at 125 °C for ≥ 12 hours
  • Hydration at 30 °C in 75% RH for ≥ 10 hours

Following this cycle, the sensor will return to normal operation in typical ambient conditions after a few days.

Maybe your sensor needs this procedure although I would return it to Sparkfun as a fresh sensor shouldn't show such behavior.

no, 999 or 998 never showed up, and how can i send it to spark-fun?
i got it here in Brasil, and it was from a Sellers on mercadolivre.com.br( more or less Brasil version of eBay)

Sorry, no clue how that works in Brasil. Try sending them an email to ask.