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

Add sleep support for Nova Fitness SDS011 sensor #2387

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

ruimarinho
Copy link
Contributor

The Nova Fitness SDS011 sensor has a limited lifespan time of 8000 hours, or roughly 1 year of continuous operation. This lifespan can be largely extended if the sensor is configured to sleep for a certain amount of time (the so called 'working cycles'), wake up to take a measurement, and then going back to sleep again.

This PR changes the default behaviour of this integration to benefit from these working cycles as users might inadvertently be 'killing' their sensors by an overly aggressive continuous reading strategy.

@mcspr
Copy link
Collaborator

mcspr commented Oct 27, 2020

Nice! Defaults are indeed rough
(but it is kind-of possible that the sensor can be pre-configured using PC software tool? since the settings persist based on the .pdf info)

I wonder though, would it be enough to just add small func doing the serial writing + reading response by ourselves instead of using the lib? ref. https://cdn.sparkfun.com/assets/parts/1/2/2/7/5/Laser_Dust_Sensor_Control_Protocol_V1.3.pdf in the 3 Command, 5) Set working period
Payload format from our side is always fixed, response seems to be too. Although, query reading mode is an interesting addition to be based off of the sensor read interval time

Also, don't we want the setting to be using minutes directly? Regardless of the implementation, library or custom code. Sensor does not have sub-minute setting anyway, just another possible bug when we will try to use numbers like 300 in uint8_t and overflow things by accident

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants