Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp55634pxy; Wed, 21 Apr 2021 18:20:52 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPdLPKOgAShfdjIE+6sExLhDyO/fNw40Dt2uRfgLhYcYpEllpx07IbNa7oYtMKvmR9sjAT X-Received: by 2002:a17:902:e293:b029:ec:aa43:4aad with SMTP id o19-20020a170902e293b02900ecaa434aadmr884610plc.32.1619054452458; Wed, 21 Apr 2021 18:20:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619054452; cv=none; d=google.com; s=arc-20160816; b=vnt4e6JgWsdgNop/AVEEV7VFNNvaifCLifSmQH5xHpPV18d76ZG1uuZDW1KxluCVHb e0bOY0aJQtFnL7Sk1A4Ys8WbMLgiJZ3BkSKTNdVYmEHXUnamcyoFYsmSTL3xvcFgCqSy s/niUUCZZvsrHPFY1HQwwUT1YAumZajf7VgDRY+pYU+WNcCBCH+5ncVKe8KCUy/VemUM fzS08m9hVz8BpE62v4UsgxDQTEKKQ9lfItaXiV9XxdLzcRCtj1+yVRrPLt1TG5WFYC+0 SeFXY6Oowdg7izZBgFa27HzltcgISNKkmrXwRg+Nq8N3iYefDUoC2ulHf5LLd+kbYAys dYKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=1Y23JnKjBwQdkJUIgYx6qPgc4bpAYldIpTO3iXzJLC8=; b=yJmMGYe9RLJCWghQgJw35RgNf4u4/uh1mNtNluTg4jKy7bzaZpjB8HQ89hdlmvSqrz fJw4cB4Xx+sntFqNEigB34j9lVOVsJXPaCZndgNdYkt6TMBn+FyvZSJr812tV4m2Q6hM 17zbzMJ/8aXs3eFGkr6xRlNbk3F10RrIYyOVxqUMcUcvPh5Da6MMTiuL0v72TFapKv8P +unzNiIw1QdMFIH+ozF/iixqI+YYqMiltNSS7wa0OcGyvqR5pdJrMIOEFs+rgtyr2CV3 YxZSoK4rr0tsi1myCeLxJ5woLZfZQOkW4G2tH9WSN4KkmEVZJJddVQ5L6ncL8w3YDvJZ pkng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JrYibZGQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o2si1041243plg.401.2021.04.21.18.20.40; Wed, 21 Apr 2021 18:20:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=JrYibZGQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236161AbhDUTGj (ORCPT + 99 others); Wed, 21 Apr 2021 15:06:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234222AbhDUTGi (ORCPT ); Wed, 21 Apr 2021 15:06:38 -0400 Received: from mail-pl1-x632.google.com (mail-pl1-x632.google.com [IPv6:2607:f8b0:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 520F4C06138A; Wed, 21 Apr 2021 12:06:04 -0700 (PDT) Received: by mail-pl1-x632.google.com with SMTP id 20so18244269pll.7; Wed, 21 Apr 2021 12:06:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=1Y23JnKjBwQdkJUIgYx6qPgc4bpAYldIpTO3iXzJLC8=; b=JrYibZGQdBbnfEVpUaV9G0AG6Hr2ikoH4WWszoEkyadJi3tn5QxoiAysIEaMR/B+x+ a1qCFnyicaxd1Lx9w7tUFyKunaxeySRMJ2+xXy5EXZJJLsA4aFNFkc+AF5RfXZQW1m4T aJM00f9JE1VyovGk/FALPO4GMSbscBYkTil1kUELcwzsWaAPYmOASmqj91YBv0kf3HBL uJeEng1z/Rf9UEB63/suGcSGTnkVXtQrobqaokbVS0r0MtYcUDDRy9+mgUOBkQI2EUPm IszEgl2XWyYRpSq3Tqs/PBSNzRfrxIg2LjwHdGMBJjJAhlK5C0xkFcHR5w6FuMWAqDIr guOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=1Y23JnKjBwQdkJUIgYx6qPgc4bpAYldIpTO3iXzJLC8=; b=BRMrlfnSZscPUKYloEIdbnEGJv9MAm1RXVZA/l8bxJ4WU8xxaZxBVyN8hTRPQpfT5T uLqwzmE3Idi1Y4zGxZ798g6l6RqWCpacJxbqf3jUCG8N586wi/J4SKWpfLdiZHPRAquR 1XQH7N9Sxz5VLAE2bSUN3upnnnym5T+veZiwuvaRJIXXk2iiVld+tAZhX2ycM2+n0N2e hJyLPmGHrz/1Y0Z1ym1D973uYs1nu/EhOknTI+pKHJQT2K+Gms+Q8tzgRnV4YAQxU5gd T3xon2ktq+Y8fn7s/ctfen2wkiOykw/JhJi2KofV/VXnvtKZqj/WIt9iDz2cSLtkgZLt ZRvg== X-Gm-Message-State: AOAM530iGVpmRjc0nXIwoSE4qTwWRFG6OwD6LU2F8oyqLGGw2gnAFALl x5EaEutqEPXs9oshgP/ZG9Va1XKEAUYPtmotX1M= X-Received: by 2002:a17:902:a406:b029:e6:78c4:71c8 with SMTP id p6-20020a170902a406b02900e678c471c8mr34933891plq.17.1619031963840; Wed, 21 Apr 2021 12:06:03 -0700 (PDT) MIME-Version: 1.0 References: <483ac17b-705a-38c3-54ee-7f0089262c03@gmail.com> In-Reply-To: From: Andy Shevchenko Date: Wed, 21 Apr 2021 22:05:47 +0300 Message-ID: Subject: Re: BUG: iio: mpu3050: Wrong temperature scale To: Linus Walleij Cc: Dmitry Osipenko , Jonathan Cameron , "linux-iio@vger.kernel.org" , Linux Kernel Mailing List , Svyatoslav Ryhel , Nathan Royer , Jean-Baptiste Maneyrol Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 21, 2021 at 1:14 PM Linus Walleij wr= ote: > > On Tue, Apr 20, 2021 at 11:26 PM Dmitry Osipenko 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/MPU305= 0lib.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, i= t > > 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=C2=B0C= . Range: -30=C2=B0C .. +85=C2=B0C Sensitivity: 280 LSB/=C2=B0C Room temperature offset: 35=C2=B0C =3D -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 fo= r > > 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 ou= t > 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. --=20 With Best Regards, Andy Shevchenko