Working with a LM75B, I2C temperature sensor.
The situation is fairly simple: I read the Temperature data, a 2 byte register. Most of the time, this works fine.
However, when the temperature is around one full degree, the sensor seems to jump up and down a whole degree: that's incidentally the resolution of the first byte of temperature data...
It seems that the register value of the temperature register changes during the read-out of the data!
Now, after some investigating, I acquired the I2C data from the bus. I get these results:
Byte 1 Byte 2 Calculated Temp.
0x1e 0xe0 30.88
0x1e 0xe0 30.88
0x1e 0x00 30.00
0x1f 0x00 31.00
0x1f 0x00 31.00
0x1f 0x00 31.00
0x1f 0xe0 31.88
0x1e 0xe0 30.88
0x1e 0xe0 30.88
0x1e 0xe0 30.88
0x1e 0xe0 30.88
0x1e 0xe0 30.88
0x1e 0xe0 30.88
0x1e 0xe0 30.88
0x1e 0xe0 30.88
0x1e 0x00 30.00
0x1f 0x00 31.00
0x1f 0x00 31.00
The real temperature is about 31'C.
Do you have any idea what is going on here and whether this is as intended?
Above are the first 50 samples of sensor 0x49.
Typical readout:
1. read the 16-bit sensor data twice.
2. if the two high bytes are same, take the second data as new value
else read the 16-bit sensor data again and take that one as new value.
3. end of procedure
Well, my hacky solution for now is to check whether the current value is more than 0.5 deg. C off from the previous value (i.e. in 10ms), if so, I bring the new value back 1.0 deg. C to the previous value.
This solved the problem in all observable situations.
Note that this is a software hack to a hardware issue.
Same problem seen, also new parts from UK stockist show the same error.
Any known fix?
Not practical to do repeated reads in my application.