Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readTemperature() Returns Nonsensical Values (Nano 33 IoT) #41

Open
ryanohoro opened this issue Dec 7, 2023 · 3 comments
Open

readTemperature() Returns Nonsensical Values (Nano 33 IoT) #41

ryanohoro opened this issue Dec 7, 2023 · 3 comments
Labels
type: imperfection Perceived defect in any part of project

Comments

@ryanohoro
Copy link

Running SimpleTempSensor results in readTemperature() returning nonsensical values that change based on the temperature.

Temperature sensor sample rate = 52.00 Hz

Temperature reading in degrees C
T
123.12
126.44
126.00
127.25
128.56

The root cause is that the original part the Nano 33 IoT shipped with, the LSM6DS3 (Chip marked SH) is no longer manufactured, and other parts from this family are being shipped on these boards. Mine has a LSM6DSOX (Chip marked S4). These parts have different values for temperature sensitivity, which affects how the raw value is converted into degrees Celsius.

t = data[0] / 16.0 + 25;

image

image

Changing the formula results in accurate temperature values

t = data[0] / 256.0 + 25;

Temperature sensor sample rate = 52.00 Hz

Temperature reading in degrees C
T
26.95
26.83
26.79
26.95
26.95

Unfortunately, I'm not sure how to programmatically determine which temperature setting value is appropriate.

@per1234
Copy link
Contributor

per1234 commented Dec 7, 2023

Hi @ryanohoro. Thanks for your report.

Mine has a LSM6DSOX

Arduino provides a different library named "Arduino_LSM6DSOX" specifically for that chip. You can install it from the Arduino Library Manager. Please give it a try.

https://www.arduino.cc/reference/en/libraries/arduino_lsm6dsox/

Even though the description mentions the Nano RP2040 Connect board specifically, the library metadata indicates it is compatible with boards of different architectures as well. I don't happen to have a Nano 33 IoT board with the LSM6DSOX chip, or a LSM6DSOX I can connect to one of my SAMD boards so I can test it out, but I think it is worth a try.

@per1234 per1234 added the type: imperfection Perceived defect in any part of project label Dec 7, 2023
@ryanohoro
Copy link
Author

ryanohoro commented Dec 7, 2023

Thanks so much @per1234 ! I'll use the Arduino_LSM6DSOX library since it's more suitable for my Nano. Shame that this isn't documented on the Nano 33 IoT product pages, and that it's actually kind of hard to determine which chip you have, and therefore which library to use.

Edit: I've sent a tech support request to Arduino about the IMU switch.

@ryanohoro
Copy link
Author

Update from tech support:

While we strive to keep our documentation accurate, there have been instances where component changes are necessary due to various factors, such as supply chain disruptions or improvements in technology. In such cases, we aim to update our documentation as promptly as possible.

Unfortunately, in this instance, the documentation on the IMU in the Nano 33 IoT product page seems outdated. We apologize for any inconvenience this has caused.

We appreciate you identifying the correct library (Arduino_LSM6DSOX) for your specific board. We will investigate the issue further and update our documentation to reflect the actual IMU being used in the Nano 33 IoT (ABX00032).

We are also working on a more comprehensive solution that will automatically detect the installed IMU and recommend the appropriate library. This will ensure that users have the best possible experience with their Arduino boards.

Have a nice day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants