2017-05-12 03:04 AM
Hello. I have a problem with humidity measurement. Despite the proper value of temperature, te humidity is always over 100%. I'm using the official ST software. I'm wondering if it is a hardware problem ?
The initialization is as following:
...
HTS221_Init_st cfg_struct;
cfg_struct.avg_h = HTS221_AVGH_4; cfg_struct.avg_t = HTS221_AVGT_2; cfg_struct.odr = HTS221_ODR_1HZ; cfg_struct.bdu_status = HTS221_ENABLE; cfg_struct.heater_status = HTS221_DISABLE; cfg_struct.irq_level = HTS221_LOW_LVL; cfg_struct.irq_output_type = HTS221_PUSHPULL; cfg_struct.irq_enable = HTS221_DISABLE;HTS221_Get_DeviceID(&deviceID);
HTS221_Set_InitConfig(&cfg_struct);/* it is activation function in fact !!! */
HTS221_DeActivate();while (true)
{ HTS221_Get_Measurement(&humidity, &temperature);... some delay and read data
}
#humid #hts221 #humidity #sensor2017-05-17 02:05 AM
Hello,
it is easier to help if you paste the device's register contents.
We can quickly rule out a faulty device.
David
2017-05-17 04:18 AM
If the following register contents will be sufficient ?
AV_CONF (10h)
CTRL_REG1 (20h)
CTRL_REG2 (21h)
CTRL_REG3 (22h)
2017-05-17 04:21 AM
To be able to count the output, output values + calibration values are needed.
Please paste the content of all the registers below:
2017-05-17 12:46 PM
2017-05-17 01:12 PM
I2C analyzer's log when writting 0x20 register:
2017-05-17 02:01 PM
According to the formula provided in
http://www.st.com/resource/en/technical_note/dm00208001.pdf
is and your H_OUT value is the humidity 143,3 % rH.I believe H_OUT = 0x8000 is some default value to be overwritten by a first measurement (I have seen the same with other sensors).
Make sure your sensor is switched to active mode from power-down mode. The only thing to turn it on is to write a correct value to CTRL_REG1 (20h).
Can you trace your code to the point where the constants in the struct are combined (ORed) together and what value is written to that register?
Or even better, can you see what is written to that register by connecting a bus analyzer?
2017-05-18 02:58 AM
The configuration also seems to be OK, active mode, BDU and 1 Hz output data rate.
Does the the H_OUT remain the same even after a few seconds and samples measured? Do you see the same behaviour with temperature measurement?
2017-05-18 03:10 AM
I will check it as soon as possible, but there is no problem with temperature measurement.
2017-05-18 05:55 AM
Interesting... Do you have any other sensor to test?
If the value doesn't change at all, I would be suspicious about ESD / soldering damage. The fact is, that the material for measuring humidity is exposed and can be damaged easier than the rest.
Honestly, I am running out of ideas.