Arduino nano 33 IoT: Internal temperature sensor

Hi friends!
I am writing here to ask you about, if it is possible, to know the internal temperature of Arduino nano 33 IoT (without any external temperature sensor). This Arduino board has an embedded temperature sensor into IMU LSM6DS3. Is there any function or library to use this temperature sensor?
Thank you very much!

There is a proposal to add this functionality to the Arduino_LSM6DS3 library:

If you want to give it a try, you can download the modified version of the library here:
https://github.com/iLikePieTM/Arduino_LSM6DS3/archive/master.zip

If you already have the Arduino_LSM6DS3 library installed, you'll need to delete it before installing the modified version.

1 Like

Hey Pert!
Thank you very much! It works perfectly! It is easy to use.

I am trying to calculate the tilt angle with Arduino nano 33 IoT. I haven't seen any library or code on internet.

For that, I need to calculate the offset of gyro which depend (I think) of temperature.

Thanks Pert,

You're welcome. I'm glad to hear it works for you. I also just gave it a try. It seems like a nice addition to the library. Hopefully it will make it into the next official release.

Hey!
The only thing that is possible to improve is to increase the decimals of the temperature measurement. Now only I can read 23.00....24.00...25.00. etc.
Thanks.

Good point! To fix this, change line 191 of src/LSM6DS3.cpp from:

  t = data[0] / 16 + 25;

to:

  t = data[0] / 16.0 + 25;

Serial.println() defaults to 2 decimal places. If you want more than that, you can set it via the optional 2nd parameter. For example, if you want 4 decimal places, change line 43 of the SimpleTempSensor example sketch from:

    Serial.println(t);

to:

    Serial.println(t, 4);

Thanks!!