ST意法半导体
直播中

于姝斐

7年用户 147经验值
私信 关注
[问答]

LSM303AGR能否用于测量环境温度?

你好,
我正在使用LSM303AGR,加速度计和磁力计,没有任何问题,但现在我想用嵌入式温度传感器进行一些测试,数据表并没有说太多。
首先,请您确认TEMP_CFG_REG_A寄存器的用法吗?

如数据表所示,向其写入0xC0似乎无法启用温度测量,但写入0x80似乎也有效。那么请您澄清数据的解释吗?该值作为二进制补码存储在OUT_TEMP_H中,但是有一个偏移量要考虑吗?
最后,这个嵌入式传感器能否成功用于测量环境温度?我们需要校准每台设备以获得准确的结果吗?

谢谢你的帮助,纪尧姆

#lsm303agr

以上来自于谷歌翻译


以下为原文




Hello,
I'm using the LSM303AGR, accelerometer and magnetomter, without any problems but now I would like to do some tests with the embedded temperature sensor and datasheet doesn't says much about it.
Firstly could you please confirm the usage of the register TEMP_CFG_REG_A ?

Writing 0xC0 to it, as specified by the datasheet doesn't seem to enable temperature measurements, however writing 0x80 seems to work.Then could you please clarify the interpretation of the data ? The value is stored in OUT_TEMP_H as two's complement but is there an offset to account for ?
Finally, could this embedded sensor be successfully used to measure ambiant temperature ? Would we need to calibrate each device to obtain an accurate result ?


Thanks for your help,Guillaume

#lsm303agr

回帖(5)

江松洁

2019-3-12 12:33:06
您是否还将BDU位设置为寄存器
CTRL_REG4?结合0xC0 in
TEMP_CFG_REG对我有用。
OUT_TEMP_L
 和OUT_TEMP_H包含25度C的偏移量。
 
 
在低功耗模式下使用就足够了
OUT_TEMP_H,只有这8位包含tempature。只需添加25并将其视为int8_t。
 
 
在高分辨率和普通模式下,您需要使用整个16位值并向右移动六次(如带符号),因为它将包含左对齐的10位值。然后再加25以获得温度。
我的经验是,这种传感器不能真正用于环境温度,内部温度会受到传感器本身的影响。

以上来自于谷歌翻译


以下为原文




Have you also set BDU bit in register
CTRL_REG4? Combined with 0xC0 in
TEMP_CFG_REG it works for me.



OUT_TEMP_L
and OUT_TEMP_H contain the offset from 25 degress C.




In low-power mode it is enough to use
OUT_TEMP_H, only these 8 bits contain the tempature. Just add 25 and treat it as int8_t.





In high-res and normal mode you need to use whole 16-bit value and shift six times to the right (as signed), as it will contain left-justified 10-bit value. Then again add 25 to get temperature.




My experience is that this sensor cannot really be used for ambient temperature and the internal temperature will affected by the sensor itself.
举报

于姝斐

2019-3-12 12:41:33
你好Rastislav,
非常感谢您的回答,价值观现在有意义。
 
我的坏,写入0xC0
TEMP_CFG_REG确实是正确的,我感到困惑,因为我错过了25°C的偏移量。
 
 
关于高分辨率正常模式(左对齐10位)您是否确认灵敏度为0.25°C /位(与低功耗模式下的1°C /位相比)?
这也意味着OUT_TEMP_H中的数据始终可以读取为度数,与功耗模式无关,这与数据表一致。
谢谢

以上来自于谷歌翻译


以下为原文




Hello Rastislav,
Many thanks for your helpful answer, the values make sense now.

My bad, writing 0xC0 in
TEMP_CFG_REG is indeed correct, I got confused because I was missing the 25°C offset.


About the high-res an normal  mode (10bits left justified) do you confirm that the sensibility is then 0.25°C/digit (compared to 1°C/digit in low power mode) ?  
This also means that data in OUT_TEMP_H can always be read as degrees, irrelevant of the power mode, which is consistent with the datasheet.

Thank you
举报

江松洁

2019-3-12 12:56:09
我只在低功耗模式下使用它,但我的理解是分辨率总是以度为单位,所以你需要两个寄存器。我现在没有传感器。

以上来自于谷歌翻译


以下为原文




I've used it only in low power mode, but my understanding is that the resolution is always in degrees, so you'll need both registers. And I don't have the sensor with me right now.
举报

于姝斐

2019-3-12 13:01:41
好吧,实际上我在低功率和正常模式下做了一些快速测试(温度变化)。
 
这就是我注意到我们总能读取OUT_TEMP_H的方式
 以度为单位(我们获得与电源模式无关的相同结果)。
所以在正常/高分辨率模式下,如果我们读取两个寄存器(我们添加2位数
),敏感度是0.25°C /位。
 
 
鉴于数据表总是只读取OUT_TEMP_H,或许额外的敏感性没有多大意义,即使在我的测试中它似乎是一致的。

以上来自于谷歌翻译


以下为原文




Ok, actually I did some quick tests (temperature variations) in low power and in normal mode.

That's how I noticed that we can always read OUT_TEMP_H
in degrees (we get the same results irrelevant of the power mode).

So in normal/high-res mode, if we read both registers ( we add 2 digits
), sensibility is then 0.25°C/digit.


Given that the datasheet says to always read only OUT_TEMP_H  perhaps the extra sensibility doesn't make much sense, even if in my testing it seemed consistent.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分