Power Management
Power Supply Options
Section titled “Power Supply Options”The Wireless Tracker supports multiple power sources with automatic switching.
Input Specifications
Section titled “Input Specifications”| Power Mode | Min | Typical | Max | Unit |
|---|---|---|---|---|
| Type-C USB (≥500mA) | 4.7 | 5.0 | 6.0 | V |
| Lithium battery (≥250mA) | 3.3 | 3.7 | 4.2 | V |
| 5V pin (≥500mA) | 4.7 | 5.0 | 6.0 | V |
| 3V3 pin (≥150mA) | 2.7 | 3.3 | 3.5 | V |
Output Specifications
Section titled “Output Specifications”| Output | Max Current | Notes |
|---|---|---|
| 3.3V Pin | 500 mA | Regulated output |
| 5V Pin | 500 mA | USB powered only |
| Vext Pin | 350 mA | Powers TFT + GNSS |
Power Consumption
Section titled “Power Consumption”By Operating Mode
Section titled “By Operating Mode”| Mode | USB Power | Battery Power |
|---|---|---|
| Wi-Fi Scanning | 100 mA | 74 mA |
| Wi-Fi Access Point | 150 mA | 111 mA |
| Bluetooth Active | 102 mA | 75 mA |
| GNSS Active | 120 mA | 89 mA |
| LoRa TX @ 14 dBm | 200 mA | 148 mA |
| LoRa TX @ 17 dBm | 220 mA | 163 mA |
| LoRa TX @ 22 dBm | 240 mA | 178 mA |
| LoRa RX Only | 80 mA | 59 mA |
| Deep Sleep | 2 mA | 15 µA |
Battery Management
Section titled “Battery Management”The Wireless Tracker includes an integrated battery management system:
- Charging: Automatic when USB connected with battery attached
- Protection: Overcharge, over-discharge, short circuit
- Switching: Automatic USB/battery source selection
- Monitoring: Battery voltage readable via GPIO1 ADC
Reading Battery Voltage
Section titled “Reading Battery Voltage”#define VBAT_ADC_PIN 1#define VBAT_CTRL_PIN 2
float getBatteryVoltage() { // Enable ADC voltage divider pinMode(VBAT_CTRL_PIN, OUTPUT); digitalWrite(VBAT_CTRL_PIN, LOW);
// Read ADC int rawADC = analogRead(VBAT_ADC_PIN);
// Disable voltage divider to save power digitalWrite(VBAT_CTRL_PIN, HIGH);
// Convert to voltage // Formula: VBAT = ADC_Reading × (3.3V / 4095) × 4.9 float voltage = (rawADC / 4095.0) * 3.3 * 4.9;
return voltage;}
int getBatteryPercent() { float voltage = getBatteryVoltage();
// Simple linear approximation // 4.2V = 100%, 3.3V = 0% int percent = (int)((voltage - 3.3) / (4.2 - 3.3) * 100);
return constrain(percent, 0, 100);}Battery Voltage Thresholds
Section titled “Battery Voltage Thresholds”| Voltage | State | Approximate % |
|---|---|---|
| 4.20 V | Full | 100% |
| 4.00 V | High | 80% |
| 3.80 V | Medium | 50% |
| 3.60 V | Low | 20% |
| 3.40 V | Critical | 5% |
| 3.30 V | Cutoff | 0% |
Low Power Modes
Section titled “Low Power Modes”Deep Sleep
Section titled “Deep Sleep”The ESP32-S3 supports ultra-low-power deep sleep mode:
#include "esp_sleep.h"
void enterDeepSleep(uint64_t sleepTimeUs) { // Disable peripherals digitalWrite(GNSS_PWR_PIN, LOW); // V1.1 digitalWrite(TFT_LED_PIN, LOW);
// Configure wakeup esp_sleep_enable_timer_wakeup(sleepTimeUs);
// Optional: wakeup on button press esp_sleep_enable_ext0_wakeup(GPIO_NUM_0, LOW);
// Enter deep sleep esp_deep_sleep_start();}
void setup() { // Check wakeup reason esp_sleep_wakeup_cause_t reason = esp_sleep_get_wakeup_cause();
switch (reason) { case ESP_SLEEP_WAKEUP_TIMER: Serial.println("Woke from timer"); break; case ESP_SLEEP_WAKEUP_EXT0: Serial.println("Woke from button"); break; default: Serial.println("Normal boot"); break; }}Light Sleep
Section titled “Light Sleep”For faster wake with moderate power savings:
void enterLightSleep(uint64_t sleepTimeUs) { esp_sleep_enable_timer_wakeup(sleepTimeUs); esp_light_sleep_start(); // Execution continues here after wakeup}Peripheral Power Control
Section titled “Peripheral Power Control”Vext Control (V1.1)
Section titled “Vext Control (V1.1)”GPIO3 controls the Vext rail that powers the TFT display and GNSS module:
#define VEXT_PIN 3
void enableVext() { pinMode(VEXT_PIN, OUTPUT); digitalWrite(VEXT_PIN, HIGH);}
void disableVext() { digitalWrite(VEXT_PIN, LOW);}Display Backlight
Section titled “Display Backlight”#define TFT_LED 21
void setBacklight(bool on) { digitalWrite(TFT_LED, on ? HIGH : LOW);}
// PWM dimming (optional)void setBacklightBrightness(uint8_t level) { analogWrite(TFT_LED, level); // 0-255}Power Optimization Tips
Section titled “Power Optimization Tips”- Disable unused peripherals: Turn off Wi-Fi, Bluetooth, GNSS when not needed
- Use deep sleep: 15µA vs 74mA is a 5000× improvement
- Reduce LoRa TX power: 14dBm uses 25% less current than 22dBm
- Lower GNSS update rate: 1Hz vs 10Hz reduces average current
- PWM the display: Dimming backlight saves significant power
- Batch operations: Wake, collect data, transmit, sleep