I'm trying to read the humidity value from the HDC1008. I have it hooked up to a USB to I2C converter that lets me send commands to the device.
- The default value of the config register (address 0x02) on boot is 0x1000. If I read the value back, it appears to be correct.
- I write the pointer value to the device to (0x00 for temperature).
- Then I read back 4 bytes from the device, and I get something like 0x61F817BC
- This means the temperature value is 0x61F8 = (25080 decimal)
- The humidity value is 0x17BC = (6076 decimal).
- According to my calculations (in decimal), the temperature seems accurate (25080 / (2^16)) * 165 - 40 = 23.14 C, which is what my office is.
But here is where my problem happens. Calculating the relative humidity, I get (6076/ (2^16)) * 100 = 9.27 %. My hygrometer in my office says it is 28 % humidity.
The same issue seems to happen if I change the config register to do one measurement at a time, read the humidity value alone, etc. I've also tried using multiple different HDC1008, and they all seem to be right around 10% humidity (when it should be closer to 30).
I seem to think that the values are being read correctly, because the last two bits are always zero (since it is a 14 bit measurement). But If I change the config register to do an 8-bit humidity measurement it is weird because I expect the lowest byte to just be 0, but I only get the lowest 6 bits to be 0.
Does anyone know if I am doing something wrong? Either calculations or I2C commands?