2014-08-29 02:28 AM
I have using HTS221 , and I have get the value from HTS221 via I2C.
The value is like the following:Read HTS221 CTRL_REG1: 0x20 value is 0x81Read HTS221 CTRL_REG2: 0x21 value is 0x0Read HTS221 CTRL_REG3: 0x22 value is 0x0Read HTS221 STATUS_REG: 0x27 value is 0x0Read HTS221 HUMIDITY_OUT_L: 0x28 value is 0xAARead HTS221 HUMIDITY_OUT_H: 0x29 value is 0x10Read HTS221 TEMP_OUT_L: 0x2a value is 0xB5Read HTS221 TEMP_OUT_H: 0x2b value is 0x0Read HTS221 T0_degC_x8: 0x32 value is 0xBFRead HTS221 T0_degC_x8: 0x33 value is 0xBFRead HTS221 T1/T0 msb: 0x35 value is 0x4Read HTS221 T0_OUT-3C: 0x3C value is 0x0Read HTS221 T0_OUT-3D: 0x3D value is 0x0Read HTS221 T1_OUT-3E: 0x3E value is 0x0Read HTS221 T1_OUT-3F: 0x3F value is 0x0It seems the data of the temperature and the Humidity is like the following:Read HTS221 HUMIDITY_OUT_L: 0x28 value is 0xAARead HTS221 HUMIDITY_OUT_H: 0x29 value is 0x10Read HTS221 TEMP_OUT_L: 0x2a value is 0xB5Read HTS221 TEMP_OUT_H: 0x2b value is 0x0And it give some example in data sheet like the following:Step 1: Temperature conversion from ADC_OUT (LSB) to �CStep 1: Linear interpolation (example)Table 20. Step 1: Linear interpolation to convert LSB to �CConclusion: current temperature is 15 �C.Input Temperature LSB (ADC) Output Temperature (DegC) T0_OUT = 300 (T0 msb U T0_degC_x8) = 80�C => 80/8 = 10.0 �C T_OUT = 400 T_degC_x8 =120 [interp.] =>T_degC=120/8 = 15.0 �C T1_OUT = 500 (T0 msb U T0_degC_x8) = 160�C => 160/8 = 20.0 �CBut I still inderstand how to covert the above data of the temperature and the Humidity toactual temperature and Humidity ?
Does someone can teach me ?Thank in advance. #hts221 #temperature-sensor2015-09-21 11:23 PM
Hi martin,
Read the values of the following register listed below,T_OUT T0_T1_MSB T0_degC_x8 T1_degC_x8 temp_T0_degC temp_T1_degC temp0_out temp1_out After getting all this values just put in below formula and get temp.T_DegC = (temp_T0_degC + (temp_out - temp0_out) * (temp_T1_degC - temp_T0_degC) / (temp1_out - temp0_out));