# Correct temperature scale formula for MPU6500

**URL:** <https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004>\
**Category:** Sensors\
**Created:** [September 2, 2026, 9:53am UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004 "2026-09-02T09:53:47Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![ardnut](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ardnut/32/1098836_2.png) [@ardnut](https://forum.arduino.cc/u/ardnut)\
**Post date:** [September 2, 2026, 9:53am UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004/1 "2026-09-02T09:53:47Z")

</div>

Hi,

I have a few chinese breakout boards with MPU6050 and 6500 chips on them.

It seems that Ivensense use two different scaling formulae to get form the sensor data to a temperature in celcius. Neither of which give credible temperature out values.

They are typically 5-10 deg C either side of ambient room temp. I'm aware this is chip temp but I doubt the current case I have on the bench showing 7 deg C LESS than ambient is the chip temp. They are somewhat near RT, and the rest of the data is good, so I rule out comms failure or incorrect programming of the interface.

This seems to be persistent problem and I have found two formulae on line. Neither of which seem to be physically credible.

Has anyone managed to get this to work correctly or should I regard this as a largely worthless feature?

I should also note that I do not know the origin of the actual chips. One is marked IVENSENSE MPU-6050, so I'm guessing it's legit, the other seems like markings may have been osbcured. In any case it's not too legible, so it could be a knock off chip, not Ivensense devices. It register structure and whoami reg suggest 6500.

TIA.

---

<div class="post-metadata">

**Author:** ![anon95813201](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@anon95813201](https://forum.arduino.cc/u/anon95813201)\
**Post date:** [September 2, 2026, 10:51am UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004/2 "2026-09-02T10:51:22Z")

</div>

If it is of any help, this is what I see from the datasheet:  
Temperature = ((TEMP\_OUT – RoomTemp\_Offset)/Temp\_Sensitivity) + 21degC  
where RoomTemp\_Offset = 0 and Temp\_Sensitivity = 333.87

So  
Temperature = (TEMP\_OUT / 333.87) + 21.0

---

<div class="post-metadata">

**Author:** ![ardnut](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ardnut/32/1098836_2.png) [@ardnut](https://forum.arduino.cc/u/ardnut)\
**Post date:** [September 2, 2026, 12:09pm UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004/3 "2026-09-02T12:09:11Z")

</div>

thanks,

I have rev 2.1 of the 6500 data sheet which gives that formula but I do not see where gives RoomTemp\_Offset = 0. If that is the case what is the point of that parameter? That was part of my confusion.

What do you have for 6050 ?

---

<div class="post-metadata">

**Author:** ![robtillaart](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/robtillaart/32/1098811_2.png) [@robtillaart](https://forum.arduino.cc/u/robtillaart)\
**Post date:** [September 2, 2026, 1:05pm UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004/4 "2026-09-02T13:05:08Z")

</div>

> I have rev 2.1 of the 6500 data sheet which gives that formula but I do not see where gives RoomTemp\_Offset = 0.

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/3/e/2/3e27f183f48f762f7aab7a0aba6074c9aa2c95a2.png)

> [@ardnut](#):
>
> What do you have for 6050 ?

from [https://www.hestore.hu/prod\_getfile.php?id=8301](https://www.hestore.hu/prod_getfile.php?id=8301)

 ![image](https://europe1.discourse-cdn.com/arduino/original/4X/2/0/4/20463f7fde5f63babe682c90833b5dd29e508bff.png)

That would be

```arduino

Temperature = (TEMP_OUT - 521) / 340.0 + 35.0

```

* * *

update: updated the formula.

* * *

The formula above is incorrect (see discussion below) the correct version is

```arduino
Temperature = (TEMP_OUT + 521) / 340.0 + 35.0

```

---

<div class="post-metadata">

**Author:** ![InquisitiveMind](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/inquisitivemind/32/1272398_2.png) [@InquisitiveMind](https://forum.arduino.cc/u/InquisitiveMind)\
**Post date:** [September 2, 2026, 1:09pm UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004/5 "2026-09-02T13:09:18Z")

</div>

> [@ardnut](#):
>
> to get this to work correctly

What do you actually want to use the temperature reading for?

The MPU's temperature sensor isn't intended to be an accurate ambient temperature sensor. It's primarily useful for tracking the die temperature and temperature-dependent behaviour of the IMU. So even if you get the conversion formula right, it may not give you the ambient temperature accuracy you're looking for.

If you need actual ambient temperature, use a proper temperature sensor such as a DS18B20 instead.

---

<div class="post-metadata">

**Author:** ![anon95813201](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@anon95813201](https://forum.arduino.cc/u/anon95813201)\
**Post date:** [September 2, 2026, 3:18pm UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004/6 "2026-09-02T15:18:02Z")

</div>

Thank you for answering @robtillaart.  
I was off the air for a while

---

<div class="post-metadata">

**Author:** ![ardnut](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ardnut/32/1098836_2.png) [@ardnut](https://forum.arduino.cc/u/ardnut)\
**Post date:** [September 2, 2026, 4:02pm UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004/7 "2026-09-02T16:02:57Z")

</div>

"Temperature = (TEMP\_OUT - 521) / 340.0 + 35.0"

Thanks Rob, for 6050 I was using this which is the same:

(float)temp / 340.0 + 36.53

[EDIT] well not quite the same the offset is neg., so I add it to correct for the offset.

Re. 6500: Now, I understand the room temp offset. It is not an offset, it is the temperature with zero offset, so it is indeed not needed in the calculation.

That won't get my 6050 any nearer and I dumped the 6500 which was junk anyway.

Thanks for the help. At least I know I have the right figures now.

---

<div class="post-metadata">

**Author:** ![ardnut](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ardnut/32/1098836_2.png) [@ardnut](https://forum.arduino.cc/u/ardnut)\
**Post date:** [September 2, 2026, 7:00pm UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004/8 "2026-09-02T19:00:10Z")

</div>

Hang on 6050 spec. sheet says at 35deg C it will output -521 .

`(T-35)*340=-521 LSB = temp_out`

`(temp_out +521)/340.0+35 = Temp / deg C`

aka: (temp\_out )/340.0+36.53 = Temp / deg C

6500: at 21deg C it will output 0x0000 .

`temp_out / 333.87f + 21.f `

Make sense?

---

<div class="post-metadata">

**Author:** ![InquisitiveMind](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/inquisitivemind/32/1272398_2.png) [@InquisitiveMind](https://forum.arduino.cc/u/InquisitiveMind)\
**Post date:** [September 2, 2026, 7:05pm UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004/9 "2026-09-02T19:05:24Z")

</div>

> [@ardnut](#):
>
> Make sense?

Did you see post #5?

---

<div class="post-metadata">

**Author:** ![ardnut](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ardnut/32/1098836_2.png) [@ardnut](https://forum.arduino.cc/u/ardnut)\
**Post date:** [September 2, 2026, 7:12pm UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004/10 "2026-09-02T19:12:22Z")

</div>

Did you see post #1 ?

---

<div class="post-metadata">

**Author:** ![kmin](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kmin/32/1147370_2.png) [@kmin](https://forum.arduino.cc/u/kmin)\
**Post date:** [September 2, 2026, 7:32pm UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004/11 "2026-09-02T19:32:16Z")

</div>

> [@ardnut](#):
>
> sheet says at 35deg C it will output -521

In my opinion it says offset at 35'C is -521. So what robtillart posted should be correct.  
But is it valid offset at 15'C, I have no idea.

---

<div class="post-metadata">

**Author:** ![ardnut](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ardnut/32/1098836_2.png) [@ardnut](https://forum.arduino.cc/u/ardnut)\
**Post date:** [September 2, 2026, 8:25pm UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004/12 "2026-09-02T20:25:17Z")

</div>

Thanks for your reply.

Linearity is quite good : +/- LSB -40 to 85 C. So this should be the const term of a linear fit to real data.

So how do we interpret "offset". Offset from what? I can only understand that as offset from zero.

If I want to correct an offset of 100, I would expect to subtract 100.

If I want to correct an offset of -100, I would expect to add 100.

If there is another way to understand that, can someone explain the logic?

Thanks.

Maybe this is an temp\_out = m\*T+c situation. Sensitivity is m (LSB/deg.C), c (LSB) is "offset".

Still looks the same to me.

---

<div class="post-metadata">

**Author:** ![kmin](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/kmin/32/1147370_2.png) [@kmin](https://forum.arduino.cc/u/kmin)\
**Post date:** [September 3, 2026, 9:23am UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004/13 "2026-09-03T09:23:41Z")

</div>

> [@ardnut](#):
>
> So how do we interpret "offset".

That's the point, it's not 100% clear.  
The table says: Offset = −521 LSB @ 35°C

If we assume it means: Traw(35'C) = -521  
then  
T = (Traw - (-521)) / 340 +35  
T= Traw / 340 + 36.532

---

<div class="post-metadata">

**Author:** ![anon95813201](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@anon95813201](https://forum.arduino.cc/u/anon95813201)\
**Post date:** [September 3, 2026, 9:34am UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004/14 "2026-09-03T09:34:56Z")

</div>

> [@ardnut](#):
>
> I can only understand that as offset from zero.

That is correct and as I pointed out the offset for the 6500 is zero. See post #2

---

<div class="post-metadata">

**Author:** ![ardnut](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ardnut/32/1098836_2.png) [@ardnut](https://forum.arduino.cc/u/ardnut)\
**Post date:** [September 3, 2026, 9:46am UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004/15 "2026-09-03T09:46:49Z")

</div>

Thanks but that does not really weigh either way. Since the 6500 "offset" is zero : 0= -0

The confusion arises with the finite "offset" is -521

Maybe the ambiguity is why the 6500 doc. gives the temp at which offset is zero.

How do you interpret -521 , do I add it or subtract it, and why?

It seems I need to subtract the offset, hence add 521.

---

<div class="post-metadata">

**Author:** ![anon95813201](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@anon95813201](https://forum.arduino.cc/u/anon95813201)\
**Post date:** [September 3, 2026, 9:49am UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004/16 "2026-09-03T09:49:10Z")

</div>

> [@ardnut](#):
>
> The confusion arises with the finite "offset" is -521

I don't see why, it's just a number like 0 which is also finite.

---

<div class="post-metadata">

**Author:** ![ardnut](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ardnut/32/1098836_2.png) [@ardnut](https://forum.arduino.cc/u/ardnut)\
**Post date:** [September 3, 2026, 9:53am UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004/17 "2026-09-03T09:53:19Z")

</div>

0 is "just a number" and it is finite (or rather infinitely small) but it does not matter whether you add or subtract it. In fact as I pointed out it does not even need to be in the calculation.

---

<div class="post-metadata">

**Author:** ![anon95813201](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@anon95813201](https://forum.arduino.cc/u/anon95813201)\
**Post date:** [September 3, 2026, 9:57am UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004/18 "2026-09-03T09:57:38Z")

</div>

> [@ardnut](#):
>
> In fact as I pointed out it does not even need to be in the calculation.

Yes it does. The formula has a parameter called RoomTemp\_Offset and you need to know what that is whether it's 0 or not does not matter.

---

<div class="post-metadata">

**Author:** ![ardnut](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/ardnut/32/1098836_2.png) [@ardnut](https://forum.arduino.cc/u/ardnut)\
**Post date:** [September 3, 2026, 9:57am UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004/19 "2026-09-03T09:57:57Z")

</div>

> [@anon95813201](#):
>
> Temperature = ((TEMP\_OUT – RoomTemp\_Offset)/Temp\_Sensitivity) + 21degC

If I subtract -521 , I add 521. So you agree with my reading that the formula needs to be:

' (temp\_out )/340.0+36.53 = Temp / deg C'

---

<div class="post-metadata">

**Author:** ![anon95813201](https://avatars.discourse-cdn.com/v4/letter/a/87869e/32.png) [@anon95813201](https://forum.arduino.cc/u/anon95813201)\
**Post date:** [September 3, 2026, 9:59am UTC](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004/20 "2026-09-03T09:59:12Z")

</div>

For the 6500 or the 6050?

[Next page](https://forum.arduino.cc/t/correct-temperature-scale-formula-for-mpu6500/1458004.md?page=2)
