Open juniskane opened 9 years ago
This must be a remnant from the LSM9DS0 or some other sensor. The sensitivity should be 16/LSB as in the data sheet.
I didn't pay much attention to this since I have a 24-bit pressure/temperature sensor on the board.
I agree with sensitivity 16/LSB based on my own measurements (comparison with temperature output of pressure sensor on same board and with ambient temperature at startup) . At least for the LSM9DS1 on my SenseHat module, the offset is rather 27.5 than 25.0
I use the following in my code
static float conv_temp(int16_t raw_temp) { return raw_temp / LSM9DS1_TEMP_SCALE + LSM9DS1_TEMP_BIAS; }
The nominal temperature sensor response is supposed to be 25 degrees Celsius when the counts are zero, but there is some variation and ST's guidance is to calibrate with external standard for accuracy as you have done. The intent of the temperature sensor is to keep track of the (gyro) die temperature and compensate if necessary. It is not intended as an environmental sensor.
-----Original Message----- From: Helmut Schmidt [mailto:notifications@github.com] Sent: February 5, 2016 12:44 PM To: kriswiner/LSM9DS1 Cc: Kris Winer Subject: Re: [LSM9DS1] temperature conversion (#3)
I agree with sensitivity 16/LSB based on my own measurements (comparison with temperature output of pressure sensor on same board and with ambient temperature at startup) . At least for the LSM9DS1 on my SenseHat module, the offset is rather 27.5 than 25.0
I use the following in my code
static float conv_temp(int16_t raw_temp) { return raw_temp / LSM9DS1_TEMP_SCALE + LSM9DS1_TEMP_BIAS; }
Reply to this email directly or view it on GitHub https://github.com/kriswiner/LSM9DS1/issues/3#issuecomment-180548286 . https://github.com/notifications/beacon/AGY1qua-7WDS6VNTQGs5VsEGo-WH47y-ks5 phQD6gaJpZM4DXuVE.gif
The line:
temperature = ((float) tempCount/256. + 25.0); // Gyro chip temperature in degrees Centigrade
only gives you (incorrect) temperatures from narrow range +17 to +33 ⁰C (because chip temp output registers are 12-bits only: -2048...+2047)
Where did you get the 256 value? For ThingSee device I'm using a different divisor (when converting to integer in hundredths of ⁰C):
For some other ST parts, the datasheets don't even bother to quote the sensitivity or even the zero point!