Re: BUG: iio: mpu3050: Wrong temperature scale

From: Andy Shevchenko
Date: Wed Apr 21 2021 - 15:06:09 EST


On Wed, Apr 21, 2021 at 1:14 PM Linus Walleij <linus.walleij@xxxxxxxxxx> wrote:
>
> 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.

Actually here [1] it says in chapter 3.1 that room temperature is 35°C.

Range: -30°C .. +85°C
Sensitivity: 280 LSB/°C
Room temperature offset: 35°C = -13200 LSB

[1]: https://www.cdiweb.com/datasheets/invensense/mpu-3000a.pdf

> > 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.



--
With Best Regards,
Andy Shevchenko