On Tue, Apr 20, 2021 at 11:26 PM Dmitry Osipenko <digetx@xxxxxxxxx> wrote: > I found a non-kernel example > which uses a similar equation [1], but in a different form. The main > difference is that the Arduino code interprets a raw temperature value > as a signed integer, while upstream assumes it's unsigned. > > [1] > https://github.com/blaisejarrett/Arduino-Lib.MPU3050/blob/master/MPU3050lib.cpp#L111 Oh that's nice. Room temperature as mentioned is 20 deg C I think? The divide by 280 part seems coherent in all examples. > Still, even if assume that the raw temperature is a signed s16 value, it > gives us ~35C in a result, which should be off by ~10C. > > Certainly a manual calibration is an option, but we will try to wait for > the answer from Nathans and Jean-Baptiste before going that route. The method I have seen used is: - Collect many bags of silica gel, those little packages of "dryer" that come in shoe boxes. - Put the device with all these in two layers of plastic bags and pull out cables, glue or strap many layers around the bags to make it really tight where the cables come out. - Submerge this into a mixture of ice and water which is known to be a calibration point for 0 degrees C, wait for some hour or so to stabilize, add some ice if it all melts. Now measures should be 0 deg C so any deviance will be the constant offset that need be added for the sensor. I guess the OTP (one time programmable memory) also contains device-unique calibration, maybe also for the temperature sensor, but IIUC that is read in automatically by the hardware since no drivers seem to look into that. Yours, Linus Walleij