melkati / CO2-Gadget

An advanced CO2 Monitor/Meter firmware for ESP32 with Android and iOS App for real time visualization and charting of air data, data logger, a variety of communication options (BLE, WIFI, MQTT, ESP-Now) and many supported sensors.
https://emariete.com/medidor-co2-gadget/
GNU General Public License v3.0
63 stars 13 forks source link

Better battery/external power detection and handling on different devices #235

Open melkati opened 3 months ago

melkati commented 3 months ago

Feature Request Summary: Enhanced Power Management Configuration for ESP32 Boards

Overview: Currently, the battery detection functionality on ESP32 boards is not optimal, mainly due to inconsistencies between different board models. To address this issue and improve overall power management, we propose implementing enhanced power management configuration options for ESP32 boards. These options will provide users with greater control and adaptability in detecting and managing power sources, ultimately enhancing the reliability and efficiency of ESP32-based projects.

Key Features:

  1. Battery Voltage Threshold: Allow users to set the voltage threshold indicating operation on battery power, catering to specific battery characteristics.

  2. External Power Voltage Threshold: Similar to battery voltage, enable users to define the voltage threshold indicating operation on external power.

  3. Hysteresis: Provide an adjustable hysteresis band to smoothen transitions between battery and external power modes, preventing rapid and unwanted mode changes due to voltage fluctuations.

  4. Mode Change Delay: Implement a configurable delay after detecting a power state change before transitioning to the new mode, minimizing rapid and unintended mode switches.

  5. Battery Connection Detection: Allow users to set a minimum voltage threshold indicating a new battery connection or disconnection of external power, facilitating calibration or adjustment processes when power sources change.

  6. Power Source Priority: Enable users to prioritize between battery and external power sources, ensuring optimal power management when both sources are available.

  7. Display and Feedback Options: Provide options for displaying power status to users, such as through LCD or LED indicators, and communicating power transitions via log messages or visual notifications.

Benefits:

Implementation Considerations:

Conclusion: Enhancing power management configuration options for ESP32 boards will empower users to tailor power detection and management to their specific needs, promoting greater flexibility, reliability, and efficiency in ESP32-based projects. We encourage readers to share their thoughts and suggestions on this proposed feature. Your feedback will play a crucial role in shaping the development process and ensuring that the final implementation meets the diverse needs of the ESP32 community.

Implementation: