Sentinel
Loading...
Searching...
No Matches
battery.h File Reference

Battery monitoring system for LILYGO ESP32-based boards. More...

#include "utilities.h"
#include "config.h"
#include <Arduino.h>
#include <TinyGsmClient.h>
#include <esp32-hal-adc.h>
#include <vector>
#include <algorithm>
#include <numeric>

Go to the source code of this file.

Classes

class  Battery
 

Macros

#define LOW_VOLTAGE_LEVEL   3600
 
#define WARN_VOLTAGE_LEVEL   3700
 
#define SLEEP_MINUTE   60
 

Detailed Description

Battery monitoring system for LILYGO ESP32-based boards.

Supports:

  • LILYGO T-SIM7670G-S3 (ESP32-S3 based)
  • LILYGO T-A7670 (ESP32 based)

Features:

  • High-accuracy voltage readings with 30-sample averaging
  • Outlier removal for stable measurements
  • Safety voltage thresholds and automatic shutdown
  • Power management with light/deep sleep modes
  • Battery percentage calculation for lithium batteries