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

What is the sensor frequency/data rate/sampling rate? #13

Open
hkayann opened this issue Nov 15, 2021 · 2 comments
Open

What is the sensor frequency/data rate/sampling rate? #13

hkayann opened this issue Nov 15, 2021 · 2 comments
Labels
topic: documentation Related to documentation for the project

Comments

@hkayann
Copy link

hkayann commented Nov 15, 2021

The spreadsheet of the sensor states the following:

Selectable ODR from 1 Hz to 12.5 Hz

However, I could not see any code regarding this.

Is there any default value? What is current sensor frequency?

@per1234 per1234 added the type: support OT: Request for help using the project label Nov 21, 2021
@LRagji
Copy link

LRagji commented Feb 28, 2022

Looking at the code i see this operates in One Shot Mode as described in the (datasheet)[https://www.st.com/resource/en/datasheet/hts221.pdf] Page 23 ONE_SHOT Page
Line i2cWrite(HTS221_CTRL1_REG, 0x84); in begin function sets ODR1 & ODR2 to ONE_SHOT mode

@patti-favaron
Copy link
Contributor

The data sheet also indicates (page 21, register AV_CONF - 0x10) how to change the number of individual readings contributing to a single data gathered from the HTS221. Changing this number affects the response time somewhat (more individual readings = less speed). I made no precise measurements, but this could have some impact on your application.

Also: it is true the HTS221 can work in stream mode (the opposite of single-shot), but as far as I've seen using the chip, in stream mode you are responsible to ensure the reads made from the MCU are made at a rate equal or slower than the chip's. Overall, adopting the single-shot mode potentially allows to reach the maximum data rate compatible with the averaging depth selected in AV_CONF.

It is true the implementation of single-shot data reads in Arduino_HTS221 library is blocking, but a non-blocking version could be easily implemented in my feeling. Nevertheless, the simplicity of a blocking approach is, to me and my applications, a value.

@per1234 per1234 added topic: documentation Related to documentation for the project and removed type: support OT: Request for help using the project labels May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: documentation Related to documentation for the project
Projects
None yet
Development

No branches or pull requests

4 participants