Jump to content
I2Cdevlib Forums

Why the 36.53 degree offset to get temperature?

Recommended Posts

Thanks for the info. I can't understand why the constant value of 36.53 is added to convert degrees C in the code that everyone uses. The data sheet says the offset is -521 and since the sensitivity is 340 per degree c, surely 521/340 = 1.53 ?? Yes, I do see the 35 degrees under Conditions - but this was the test condition that the spec was determined under - right? Why is it (apparently) added to the 1,53 to get the 36.53 ? Thanks Russell

Link to comment
Share on other sites

  • 3 years later...

Dear Rusell, I could not understand either that same concern. I totally get your point, taking the -521 LSB as the offset and 35 (ºC) as the offset measurement conditions (as could checked in the datasheet screenshot provided below).

However, adding that offset value instead of subtracting it and adding 35 results in an accurate reading value.

Also consider that if you extend the temperature's measurement through the time, the board will self-heat. I noticed risings around 0.6 to 1 degree.

Please, before slopping any opinion here, keep in mind that the readings were tested to be accurate (see the attached image, I know is cropped up it was the only way it fixed 500 kb with a decent resolution).

Kind regards to the community,

Fran Hdez.





#include "MPU6050.h"
#include "Wire.h"

int16_t temp_raw;
float temp;

MPU6050 sensor;

void setup()

  if (sensor.testConnection())
    Serial.println("Sensor attached successfully");
    Serial.println("Error at sensor attachment");

void loop()
  // Screen showing the MPU temperature read (16-bit in 2's Complement format, interpreted by default as a negative number).
  temp_raw = sensor.getTemperature();
  temp = float(temp_raw + 521)/340 + 35.0
  Serial.println (temp);
  delay (100);




MPU6050 Temp.jpg

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...