Skip to content

Add low power mode functionality #188

@melkati

Description

@melkati

Add low power modes to CO2 Gadget,

Starting with SCD41 sensor (not too expensive and widely available).

Nothing too complex but with different low power modes the user can select in preferences:

  1. None = No power savings, as working now.
  2. Basic = Use the sensors on low power mode (one shot measurement instead of continuous measurement).
  3. Medium = Basic + Deep Sleep between measurements. Also, the option to connect to WiFi, MQTT or ESPNow each x measurements (for example time between measurements = 5 minutes and send data each 6 measurements).
  4. Maximum = every possibility to save power (TBD: Possible it will only measure and display on demand, when not working on external power, for maximum autonomy on battery).

Some of the options will work also for SCD40 and SCD30 (no real low power measurement but support a pseudo low power mode).

This is linked also to eInk (ePaper) display support. (There is already work in parallel at #190)

Tasks to implement:

  • Add structures to store data for Low Power Mode
  • Add user configurable data to preferences
  • Implement One Shot measurements for SCD41/SCD40
  • Implement One Shot measurements for CM1106SL-NS
  • Add Deep Sleep functionality (with data storage between sleep and wake up)
  • Add hysteresis (thresholds) to filter new readings handling to save energy #212
  • Add support logic for sample time coherency in the different working phases
  • Add functionality and needed logic for CO2 sensor calibration in low power
  • Add configuration to menu
  • Add configuration to web config
  • Test with as many hardware combinations as possible
  • Document on GitHub
  • Document on Blog

TO DO/FIX:

  • Support for Sensirion SCD30 Sensor (WIP. Half implemented. Partially Working. Non optimized)
  • Cleanup code

As for the cleanup code there are multiple tasks to do:

  • Deal with third party dependencies (apport pull request or fork, depending on case)
  • Internal code structure (each code where it should be (Sensors, DeepSleep, e-Ink, etc)
  • Reduce mess and duplicity
  • Improve code readability, reusability and maintainability

IMPORTANT NOTES:

Warning! Take care. Some CO2 sensors need re-calibration after changing sample time interval.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesthelp wantedExtra attention is needed

Projects

Status

In review

Relationships

None yet

Development

No branches or pull requests

Issue actions