-
Notifications
You must be signed in to change notification settings - Fork 32
Purposed Version 1.1.0 - Temperature Sensor Support #12
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using readTemperature
, temperatureAvailable
, temperatureSampleRate
to make the code more self-documenting. "temp" might be short for "temporary".
Please add the new function names to keywords.txt. Use a true tab to separate the function name from the identifier:
https://github.com/arduino/Arduino/wiki/Arduino-IDE-1.5:-Library-specification#keywordstxt-format
Thanks for the feedback @per1234! Co-Authored-By: per1234 <[email protected]>
Thanks for the feedback!
|
Co-Authored-By: per1234 <[email protected]>
Co-Authored-By: per1234 <[email protected]>
Co-Authored-By: per1234 <[email protected]>
Will this be merged soon? |
@iLikePieTM it seems your PR was approved long time ago, will it be merged soon? 😄 (this is a great feature) |
+1! |
very useful to have and hope this gets merged. worked well with Nano 33 IoT a little suggestion if I may, to follow LSM6DSOXClass::readTemperature and LSM6DSOXClass::readTemperatureFloat from Arduino_LSM6DSOX that way we have int and float |
Would love to bump this, since all checks have passed and its been approved. This would be immensely helpful to have on my current project. |
It's been years and I totally forgot about this lol. I fixed the conflicts with the current master branch, it's ready to merge by someone with write access. |
Memory usage change @ 1a874c5
Click for full report table
Click for full report CSV
|
@iLikePieTM thanks for the quick response! Really excited to make use of this. @per1234 any chance this could get a second review / a merge? |
Hello all. Thanks @iLikePieTM for your pull request and also to @oliverswitzer for your interest in this open source project. My role in this project is essentially janitorial. I am not in a role to merge changes to the library codebase. One of the projects other maintainers will make that decision. Regards, |
Merged, thanks for your contribution! |
Thanks for merging @facchinm! Any sense of when the next release will be? |
Hi @iLikePieTM, I am trying to use this functionality now, but am consistently getting temperature readings that seem like they're too high considering that the board is sitting at ambient room temperature (75 degrees F):
Output (over a few seconds):
Any idea why this temp seems so high? |
I ran into a similar problem with my Nano 33 IoT. Running the SimpleTempSensor example code for this library caused non-sensible results.
Reading the source code for the Adafruit_CircuitPython_LSM6DS library for this sensor reveals the formula for converting the raw temperature value to Celsius is probably the culprit. The Adafruit makes a similar assumption, that all the chips in this family have the same temperature parameters. Arduino_LSM6DS3 library uses The datasheet for the LSM6DS3 has a temperature sensitivity of 16 (Table 4.3) https://content.arduino.cc/assets/st_imu_lsm6ds3_datasheet.pdf (SH) The datasheets for the LSM6D3-C/LSM6DST/LSM6DSL/LSM6DSO/LSM6DSOX have a temperature sensitivity of 256 (Table 4.3) https://www.st.com/resource/en/datasheet/lsm6ds3tr-c.pdf (SE) Changing this library's temperature sensitivity value to 256 outputs values that I confirmed with an infrared thermometer are accurate:
I suspect Arduino shipped the Nano 33 IoT with undocumented LSM6DS3 compatible variants because LSM6DS3 is an obsolete part, and it likely didn't affect the IMU function. However, it seems all the new parts in the family have higher temperature sensitivity. The S4 marking on my chip suggests it's a LSM6DSOX. Photos on the Arduino website show SH markings, the LSM6DS3. The SH and S4 markings are hard to distinguish, bit I'm confident mine is S4. https://learn.adafruit.com/lis3mdl-triple-axis-magnetometer @iLikePieTM Seems like it's going to look like this function is randomly broken unless the IMU temperature sensitivity can be programmatically determined. |
I would like to propose a version 1.1.0 update to the library that adds support for the LSM6DS3's integrated temperature sensor with three new functions:
readTemp
outputs the temperature reading in deg. C and returns 1 if successfultempSampleRate
returns the sampling rate of the sensortempAvailable
returns 1 if there is available data from the temperature sensorP.S. first time doing this so don't be too harsh :)