Arduino nano 33 IoT: Internal temperature sensor wrong values

Hello,

I'm trying to measure temperature in celsius with the examples for the LSM6DS3
https://app.arduino.cc/sketches/examples?nav=Libraries&eid=arduino_lsm6ds3_1_0_3%2Fexamples%2FSimpleTempSensor&slid=arduino_lsm6ds3_1_0_3
I used the original code from the examples, the data shown in the serial monitor are 3 digits and is increasing very fast when starting the arduino. The values must be wrong.

This is the output of the serial monitor:

12:05:15.946 -> Temperature sensor sample rate = 52.00 Hz
12:05:15.946 -> 
12:05:15.946 -> Temperature reading in degrees C
12:05:15.946 -> T
12:05:15.946 -> 114.81
12:05:15.946 -> 113.19
12:05:15.979 -> 115.31
12:05:15.979 -> 114.00
12:05:16.015 -> 114.81
12:05:16.015 -> 115.06
12:05:16.052 -> 113.00
12:05:16.052 -> 112.87
12:05:16.091 -> 115.62
12:05:16.091 -> 115.06
12:05:16.129 -> 115.81
12:05:16.169 -> 115.44
12:05:16.169 -> 113.50
12:05:16.169 -> 113.87
12:05:16.205 -> 113.87
12:05:16.247 -> 112.31
12:05:16.247 -> 112.81
12:05:16.247 -> 113.37
12:05:16.281 -> 114.62
12:05:16.324 -> 113.75
12:05:16.324 -> 113.31

Does anybody know, why the values are wrong or how i can fix the problem?

It's measuring the internal temperature, which I'd expect to rise from ambient to a higher value after you power on the chip.

That also came to my mind. But the temperature was at -8 degrees at the beginning and i have already implemented the temperature measurement to several arduinos where it works.

If you used (didn't type) sample code, then it is very likely correct (we can't tell since you didn't follow the advice of a first-time poster, namely, read the pinned post 'How to get the best from the forum')

I loaded the Example in the Arduino IDE from the examples, so i didn't type it. Yes, it is correct, i tried it also with an Arduino, where i could implement the temperature measurement corectly (It is from an older order).

I tried it also with more than one currently ordered Arduino Nano 33 IoTs. Each of them have the same wrong behaviour. The Arduinos, where the temperature measurement works are also Arduino Nano 33 IoTs.

I dont think, that all new ordered Arduinos are broken, are they?
Or is it possible to calibrate the IMU of the Arduino?

What do you mean the temps are wrong?

These are genuine Arduino boards? Although I'm not aware of anyone producing clones of the Nano 33 IOTs.

Yes, they are

I mean, that i get over 100 degrees celsius in my room where it is only 24 degrees celsius. I think i am right, if i say, that the temps are wrong.

Over 100 degrees celsius is definitely wrong, if he chip produces that much heat internally the temperature sensor would be worthless for measuring external temperatures anyway.

Have you contacted Arduino directly, they could have gotten a bad run of chips.

Not yet, but I will do it now :slight_smile:

You need to read the datasheet for the LSM6DS3 (and link it in your post). Do I see a mention of an oscillator so that suggests circuitry that will produce heat.
Do you have an instrument for measuring temps (many VOMs have the now)? Getting a second opinion is a standard debugging technique. Until you can prove the readings are wrong, I would assume they are correct. Have you tried changing the sample rate and/or any other temperature-related functions? Have you tried a second time, at least, and ideally three total, to see if all have the same reading?

I just checked the datasheet. The sensor tops out at +85. That means either your wiring or code is not correct.
The sample code may be flawed, doesn't happen often, but this may be the exception.I am a bit suspicious/concerned re the sample rate. I would also carefully check what other Public members are available in the class in order to aid in debug.
Do you have the option of a different sensor? I never heard of this one before.

The Arduino is only connected via a USB cable. The code is from the Arduino IDE from the examples. The same code works perfectly on other Arduinos of the same type. The same code does not work on the last Arduinos ordered (exactly the same type - Nano IoT 33).
The Arudinos also do not get as warm as the output temperature of the Arduino.
Since I know that I was able to measure the temperature (even if only approximately +/- a few degrees) with exactly this sensor, I actually want to use it again to have the same code everywhere.

Are they genuine or clones.

They are all genuine, but from other batches.

All purchased from Arduino?

In that case, return as defective and ask them to test before shipping.

If you check the datasheet (August 2017, DocID026899 Rev 10), page 24, section 4.3, it states that the temperature offset can vary by ±15 °C. That’s a significant range.

Also, your link doesn’t work for me, and without your code, I can't tell if you're printing the temperature in Celsius or Fahrenheit. When you touch the device, does it feel hot enough to burn? What’s the actual temperature reading from the chip? Keep in mind that the die temperature will be a bit higher than the case temperature .

Please post your code and an annotated schematic so we can better understand what you're working with. If you’ve read earlier requests, you'd know we need that information to offer meaningful help.

Right now, it’s like asking, “Where does my neighbor’s brother live?” — when we don’t even know if he has a brother.

This is the code that runs on the Arduino.
The Arduino is only connected via a USB cable and has no other connections.
As I said, the Arduino is not so hot that you burn yourself. I measured a temperature of around 32 degrees Celsius with the thermal imaging camera.
After the Arduino was not connected overnight, it gives these values as the first values:

08:27:58.601 -> Temperature sensor sample rate = 52.00 Hz
08:27:58.601 -> 
08:27:58.601 -> Temperature reading in degrees C
08:27:58.601 -> T
08:27:58.601 -> -36.94
08:27:58.601 -> -8.31
08:27:58.637 -> -5.87
08:27:58.637 -> -8.13
08:27:58.676 -> -7.56
08:27:58.676 -> -5.69
08:27:58.714 -> -6.56
08:27:58.753 -> -7.19
08:27:58.753 -> -5.81
08:27:58.753 -> -5.94
08:27:58.792 -> -4.62

After three minutes the values have risen so far:

08:30:58.037 -> 59.50
08:30:58.037 -> 59.94
08:30:58.084 -> 60.19
08:30:58.084 -> 59.81
08:30:58.126 -> 59.75
08:30:58.126 -> 59.31
08:30:58.126 -> 59.69

Over time, the values stabilize at around 100.
An offset of +/- 15 degrees is not logical in relation to the values, as the room temperature is 22 degrees.

But I have already given all this information in various answers.