-
Notifications
You must be signed in to change notification settings - Fork 1
Power Management and Deep Sleep
Albin Varghese edited this page Nov 18, 2024
·
2 revisions
- Introduction
- Key Features
- Power Management Architecture
- Deep Sleep Mode
- Solar Charging and Battery Regulation
- Implementation Details
- Diagrams and Workflow
- Testing and Validation
- Conclusion
Efficient power management is essential for HydroLink Plus, ensuring the system operates reliably using solar power and battery storage. By integrating dynamic power regulation and ESP32's Deep Sleep Mode, the system achieves optimal energy efficiency, extending battery life and minimizing power wastage.
-
Dynamic Power Regulation:
- Monitors battery and solar panel inputs to prioritize critical functions.
-
Deep Sleep Mode:
- Reduces power consumption during idle periods.
-
Wake Triggers:
- Wakes the system only for sensor readings, data transmission, or external events.
-
Solar Energy Utilization:
- Uses MPPT (Maximum Power Point Tracking) for efficient solar charging.
-
Low-Power Hardware:
- Selects low-power components like the ESP32, Mini 360 Buck Converter, and efficient sensors.
graph TD;
A[Solar Panel] -->|5V Input| B[MPPT Charger];
B -->|12V Output| C[Li-ion Battery];
C -->|12V Input| D[Mini 360 Buck Converter];
D -->|3.3V/5V Output| E[ESP32];
E -->|Power Control| F[Sensors and Peripherals];
E --> G[Motorized Valve];
-
Solar Panel:
- 5V, 2W solar panel for renewable energy input.
-
MPPT Charger (CN3791):
- Optimizes solar energy usage for charging the 12V Li-ion battery.
-
Mini 360 Buck Converter:
- Regulates voltage from 12V to 3.3V or 5V for the ESP32 and sensors.
The Deep Sleep Mode on the ESP32 minimizes power consumption by shutting down most peripherals and retaining only essential operations in RTC memory.
-
Power Consumption:
- ~10 µA in Deep Sleep, compared to ~100 mA in active mode.
-
RTC Memory:
- Stores essential data like timestamps and wake triggers.
-
Timer-Based Wake-Up:
- Wakes the ESP32 periodically (e.g., every 30 minutes) for sensor readings and data transmission.
-
External Interrupts:
- Wakes on events like tampering detection or valve commands.
-
Sensor Alerts:
- Configurable wake triggers for specific water quality thresholds.
| Mode | Power Consumption |
|---|---|
| Active Mode | ~100 mA |
| Deep Sleep | ~10 µA |
| Sensor Reading | ~50 mA |
| Valve Control | ~150 mA |
- The 5V, 2W solar panel connects to the CN3791 MPPT charger module, which optimizes energy harvesting under varying sunlight conditions.
-
Battery Type:
- 12V 2200mAh Li-ion battery.
-
Voltage Monitoring:
- Regularly checks battery levels to decide operational priorities.
-
Critical Power Mode:
- Disables non-critical functions when battery levels are low.
- Enable Deep Sleep Mode in the firmware:
esp_sleep_enable_timer_wakeup(TIME_TO_SLEEP * uS_TO_S_FACTOR); esp_deep_sleep_start();
- Configure wake-up sources:
esp_sleep_enable_ext0_wakeup(GPIO_NUM_0, 1); // Wake on button press esp_sleep_enable_ext1_wakeup(GPIO_SEL_35, ESP_EXT1_WAKEUP_ANY_HIGH); // Wake on sensor alert
Store critical variables in RTC memory:
RTC_DATA_ATTR int boot_count = 0;
boot_count++;- Use the Mini 360 Buck Converter to step down from 12V (battery) to 3.3V (ESP32 supply).
- Include capacitors (e.g., 10 µF and 100 µF) for voltage smoothing.
graph TD;
A[Active Mode] --> B{Idle Period?};
B -->|Yes| C[Enter Deep Sleep];
B -->|No| D[Continue Operations];
C --> E[Wake Event?];
E -->|Yes| A;
E -->|No| C;
graph TD;
A[Solar Panel] -->|Power Input| B[MPPT Charger];
B -->|Battery Output| C[Li-ion Battery];
C -->|Regulated Output| D[ESP32 and Peripherals];
- Use an ammeter to measure power draw in Deep Sleep Mode.
- Verify wake triggers by simulating:
- Timer wake-ups.
- External GPIO interrupts.
- Test solar panel performance under direct sunlight and cloudy conditions.
- Verify battery charging levels using a multimeter.
- Monitor voltage levels from the buck converter during high load (e.g., valve operation).
- Ensure no significant voltage drops during transitions.
HydroLink Plus 2024
HydroLink Plus ©2024