Power and Battery Optimization on the Cubicore Devboard
Applicable to the Cubicore Devboard (ESP32-S3 + SX1262 on RAK3112 module).
Confirm the current hardware revision, pinout allocations, and supported firmware features in the Cubicore Devboard product documentation before deploying in field production.
The Cubicore Devboard uses a 1:1 direct mapping between its physical silkscreen labels and ESP32-S3 GPIO numbers. In this guide, all references formatted as Devboard GPIO X (such as Devboard GPIO 14, Devboard GPIO 45, and Devboard GPIO 46) directly correspond to the physical silkscreen labels printed on the board headers and the numeric pin definitions in Arduino IDE sketches.
1. Introduction: Designing for Untethered Field Deployments
Most IoT development boards operate continuously tethered to a USB port or bench power supply. However, the true value of long-range LoRaWAN telemetry lies in deploying untethered sensor nodes across remote agricultural fields, rooftop weather stations, or forest microclimate monitors where wall power does not exist.
In standard Arduino sketches, developers often use delay() in loop() to wait between sensor transmissions:
// ❌ WRONG APPROACH FOR BATTERY OPERATION:
void loop() {
sendSensorUplink();
delay(600000); // 10 minutes of active waiting
}
While the microcontroller waits inside delay(), the ESP32-S3's dual 240 MHz Xtensa CPU cores, high-speed APB clock trees, and internal radio circuits remain fully energized, drawing continuous currents between 40 mA and 80 mA. At this rate, a standard 1,200 mAh single-cell Lithium-Polymer (Li-Po) battery will be completely exhausted in less than 20 hours.
By taking advantage of the Cubicore Devboard's hardware power architecture and deep sleep firmware disciplines, you can reduce idle power draw to ~15 µA—extending operating life from hours to multiple years on a single battery charge, or achieving infinite, perpetual operation when paired with a compact solar panel.
2. Hardware Power Architecture & Connectors
The Cubicore Devboard integrates an autonomous multi-source power management system designed to balance simplicity with industrial resilience.

Figure 1: Hardware power architecture and multi-source supply routing on the Cubicore Devboard.

Figure 1: Hardware power architecture and multi-source supply routing on the Cubicore Devboard.
[ Solar Panel (5V–6V) ] [ USB-C 5V VBUS ]
│ │
▼ ▼
[ JST-PH 2.0mm Port ] [ USB-C Receptacle ]
│ │
└──────────────┬─────────────────┘
│
▼
[ Auto Power-Path OR-ing ]
(High-Side P-MOSFET)
│
┌───────────────────────┴───────────────────────┐
▼ ▼
[ TP4054 Linear Charger ] [ RT9080 LDO ]
(500 mA Charge Rate) (3.3V System Rail)
│ (2 µA Quiescent)
▼ │
[ 1S Li-Po Battery ] ▼
[ JST-ZH 1.5mm Port ] [ ESP32-S3 + SX1262 Radio ]
2.1 Power Input Connectors
The board features three independent power entry points:
| Power Port | Connector Type | Voltage Range | Typical Application |
|---|---|---|---|
BAT | 2-pin JST-ZH (1.5 mm pitch) | 3.0V – 4.2V DC | Single-cell 3.7V nominal Li-Po or Li-Ion battery pack. |
SOLAR | 2-pin JST-PH (2.0 mm pitch) | 4.8V – 6.0V DC | Small 5V / 6V photovoltaic solar panel (1W to 3W). |
USB-C | Standard Type-C | 5.0V DC | Bench development, firmware flashing, and fast charging. |

Figure 2: Dedicated JST-ZH battery port, JST-PH solar port, and Grove I2C connector.
Standard JST battery cables do not have a globally enforced color-coding standard across all battery manufacturers. Before connecting a third-party Li-Po battery to the board's BAT connector, verify the polarity with a multimeter:
- Pin 1 (Marked
+on silkscreen): Must connect to Battery Positive (+, Red wire). - Pin 2 (Marked
-on silkscreen): Must connect to Battery Ground (-, Black wire).
Plugging a reverse-polarity battery into the JST-ZH connector will blow the internal reverse protection diodes and permanently damage the TP4054 charger IC.
2.2 Automatic Power-Path Management (Auto OR-ing)
The Devboard includes an onboard high-side P-MOSFET auto-switching circuit that manages system power smoothly between external sources and the battery:
- When USB or Solar Power is Connected (> 4.5V):
- The gate of the P-MOSFET is pulled high, disconnecting the battery from the primary system power rail.
- The incoming 5V rail directly powers the RT9080 system LDO while simultaneously feeding the onboard TP4054 charger to charge the battery.
- When External Power is Removed:
- The P-MOSFET gate falls to ground, seamlessly switching the battery onto the system rail in microseconds without causing a voltage sag, brownout, or CPU reset.

Figure 3: Automatic power path OR-ing circuit transitioning between USB 5V, solar, and battery.

Figure 3: Automatic power path OR-ing circuit transitioning between USB 5V, solar, and battery.
2.3 Onboard TP4054 Linear Li-Po Charger
Battery charging is managed autonomously by a dedicated TP4054 constant-current / constant-voltage (CC/CV) linear charger IC:
- Charge Current: Factory-configured to 500 mA via a precision 2 kΩ programming resistor on the
PROGpin. - Float Voltage: Automatically terminates charging when the cell reaches 4.20V ± 1%.
- Charge Status LED (
CHG):- Solid Red: Active constant-current or constant-voltage charging in progress.
- Off: Battery fully charged (cell voltage ≥ 4.18V) or external power absent.
- Twinkling / Rapid Flashing: External power is present, but no battery is plugged into the
BATconnector.
2.4 Low-Quiescent RT9080 LDO Regulator
The system voltage rail (+3.3V) is generated by a Richtek RT9080 ultra-low-dropout linear regulator. While generic LDOs (such as the AMS1117) consume between 5 mA and 10 mA of continuous ground current even when the microcontroller is asleep, the RT9080 features an ultra-low quiescent current of only 2 µA (0.002 mA). This ensures that the voltage regulator itself never drains your battery while sleeping.
3. Reading Battery Voltage & ADC Calibration (Devboard GPIO 14)
To monitor battery depletion in the field and trigger low-voltage alarms on your dashboard, the board integrates a dedicated high-impedance voltage divider connected to Devboard GPIO 14 (RAK3112 PIN34 / AIN1).
V_BATT (3.0V – 4.2V)
│
┌┴┐
│ │ R1 = 1.0 MΩ (Top Resistor)
└┬┘
├───> Connected to Devboard GPIO 14 (AIN1 / ADC2_CH3)
┌┴┐
│ │ R2 = 1.5 MΩ (Bottom Resistor)
└┬┘
│
GND
3.1 Why High-Impedance Resistors Matter
Standard resistor dividers often use low-value resistors (such as 10 kΩ / 10 kΩ). However, a 20 kΩ divider connected across a 4.2V battery draws:
I_leakage = 4.2V / 20 kΩ = 210 µA
Drawing 210 µA continuously just to measure voltage wastes more than 14 times the entire deep sleep current of the board!
The Cubicore Devboard uses a 1.0 MΩ / 1.5 MΩ network, providing a combined impedance of 2.5 MΩ. The total parasitic leakage current is reduced to:
I_leakage = 4.2V / 2.5 MΩ = 1.68 µA
This parasitic draw is so small that it has virtually zero impact on battery life over multi-year deployments.
3.2 Voltage Divider Mathematics
The divider ratio scales the raw battery voltage down to the safe input range of the ESP32-S3 ADC:
V_ADC = V_BATT × (R2 / (R1 + R2)) = V_BATT × (1.5 MΩ / 2.5 MΩ) = V_BATT × 0.60
To calculate the true battery voltage (V_BATT) from the measured ADC voltage (V_ADC):
V_BATT = V_ADC × ((R1 + R2) / R2) = V_ADC × (2.5 / 1.5) = V_ADC × 1.6667
For a fully charged 4.20V cell, the pin sees 4.20V × 0.60 = 2.52V, safely within the ESP32-S3 ADC's linear range when using ADC_11db attenuation.
3.3 Standalone Battery Voltage Test Sketch
Upload this sketch to verify your battery monitoring circuit before integrating it into deep sleep firmware:
/*
* Cubicore Devboard - Battery Voltage Monitor Test
* Reads onboard 1.0M / 1.5M voltage divider on Devboard GPIO 14
*/
#define PIN_VBAT_SENSE 14
// Divider multiplier = (1.0M + 1.5M) / 1.5M = 1.6667
const float VBAT_DIVIDER_RATIO = 1.6667f;
float readBatteryVoltage() {
// Read calibrated millivolts directly from ESP32-S3 internal eFuse lookup curve
uint32_t adc_mv = analogReadMilliVolts(PIN_VBAT_SENSE);
// Calculate true battery voltage
float battery_volts = (adc_mv * VBAT_DIVIDER_RATIO) / 1000.0f;
return battery_volts;
}
int calculateBatteryPercentage(float voltage) {
// Approximate State of Charge (SoC) curve for single-cell Li-Po:
// 4.20V = 100% (Full charge)
// 3.85V = ~50% (Nominal plateau)
// 3.30V = 0% (Cutoff threshold)
if (voltage >= 4.20f) return 100;
if (voltage <= 3.30f) return 0;
int percentage = (int)((voltage - 3.30f) / (4.20f - 3.30f) * 100.0f);
return constrain(percentage, 0, 100);
}
void setup() {
Serial.begin(115200);
while (!Serial && millis() < 3000);
// Configure ADC resolution and full-scale attenuation
analogReadResolution(12);
analogSetAttenuation(ADC_11db); // Full-scale range up to ~3.1V
Serial.println(F("\n=========================================="));
Serial.println(F(" Cubicore Devboard - Battery Monitor Test "));
Serial.println(F("=========================================="));
}
void loop() {
float vbat = readBatteryVoltage();
int percent = calculateBatteryPercentage(vbat);
Serial.printf("[BATTERY] Measured Voltage: %.3f V | State of Charge: %d %%\n", vbat, percent);
delay(3000);
}
4. Deep Sleep & RTC Fast SRAM Session Architecture
Transitioning a LoRaWAN node into deep sleep requires more than just calling a sleep function. Because LoRaWAN relies on continuous cryptographic sequence counters (FCntUp), losing state across reboots breaks network communication.
4.1 The Three Power States
An optimized node transitions between three distinct operating states:
- Active CPU Sampling: Dual-core Xtensa CPU running at 240 MHz to sample I2C sensors and read ADC voltages. Draws 30–50 mA for ~50 ms.
- LoRa TX Transmission: Semtech SX1262 power amplifier delivering +22 dBm RF output, followed by Class A receive windows (RX1/RX2). Draws 118 mA during TX pulse (~120 ms) and 8 mA during RX windows (~100 ms).
- Deep Sleep State: CPU, high-speed clocks, and digital peripherals powered completely off. The SX1262 is in cold sleep (160 nA) and the RT9080 LDO draws 2 µA. Total quiescent draw: ~15 µA for 599 seconds (in a 10-minute cycle).
4.2 The Flash Wear Problem vs. RTC Fast SRAM Solution
In Chapter 6: Joining a LoRaWAN Network, we established that writing frame counters to SPI Flash NVS inside loop() destroys the flash memory over time due to write endurance limits.
When using deep sleep, the ESP32-S3 completely resets its main SRAM memory upon waking. If firmware were to save the session to Flash NVS before each sleep cycle, a device sleeping for 5-minute intervals would execute:
Flash Writes = 24 hrs/day × 12 cycles/hr × 365 days/yr = 105,120 writes/year
The onboard NOR flash memory chip (rated for ~100,000 erase cycles) would suffer permanent block failure within a single year!
The RTC Fast SRAM Architecture
The ESP32-S3 contains 8 KB of RTC Fast SRAM that remains continuously powered by the low-power RTC domain during deep sleep. Variables tagged with the RTC_DATA_ATTR macro persist in RAM across sleep cycles with zero wear:
// Stored in 8 KB RTC Fast SRAM (survives deep sleep with ZERO Flash writes):
RTC_DATA_ATTR uint8_t rtcSessionBuf[RADIOLIB_LORAWAN_SESSION_BUF_SIZE];
RTC_DATA_ATTR bool rtcSessionValid = false;
RTC_DATA_ATTR uint32_t bootCount = 0;
┌──────────────────────────────┐
│ POWER-ON / COLD BOOT │
│ (Battery or USB Inserted) │
└──────────────┬───────────────┘
│
▼
┌──────────────────────────────┐
│ 1. Check rtcSessionValid │
│ -> false: Perform OTAA │
│ -> Save DevNonce to NVS │
│ -> Copy session to RTC │
│ -> rtcSessionValid = true│
└──────────────┬───────────────┘
│
▼
┌──────────────────────────────┐
│ 2. Sample Sensors & Bat mV │
└──────────────┬───────────────┘
│
▼
┌──────────────────────────────┐
│ 3. Transmit LoRaWAN Uplink │
└──────────────┬───────────────┘
│
▼
┌──────────────────────────────┐
│ 4. Update rtcSessionBuf │
│ radio.sleep() │
│ esp_deep_sleep_start() │
└──────────────┬───────────────┘
│
▼
┌──────────────────────────────────┴──────────────────────────────────┐
│ DEEP SLEEP (~15 µA) │
│ (Main CPU, Flash, & Radio powered off for 10 min) │
└──────────────────────────────────┬──────────────────────────────────┘
│
▼ (RTC Timer Wakeup)
┌──────────────────────────────┐
│ 5. WAKEUP FROM DEEP SLEEP │
│ -> rtcSessionValid = true│
│ -> node.setBufferSession │
│ -> Instant resume (<1 ms)│
│ -> ZERO FLASH WRITES │
└──────────────┬───────────────┘
│
└───────> (Return to Step 2)
5. Complete Production Firmware Sketch
Below is the complete, self-contained production firmware. It combines AS923-3 dual-channel pinning, RTC SRAM session persistence, precision battery voltage monitoring, packed binary telemetry, and deep sleep duty cycling.
/*
* ============================================================================
* Project: Cubicore Devboard - Ultra-Low-Power LoRaWAN Deep Sleep Node
* Target: Cubicore Devboard V1.3 (ESP32-S3 + SX1262 on RAK3112)
* Hardware: Onboard Battery Divider on GPIO 14, Grove SHT30 I2C Sensor on J6
* ============================================================================
*/
#include <RadioLib.h>
#include <Wire.h>
#include <Adafruit_SHT31.h>
#include <Preferences.h>
#include <esp_sleep.h>
// --- Deep Sleep Interval Configuration ---
#define SLEEP_INTERVAL_SECONDS 600 // 10 minutes between transmissions
// --- Hardware Pin Definitions (1:1 Silkscreen Mapping) ---
#define PIN_LED_BLUE 45
#define PIN_LED_GREEN 46
#define PIN_VBAT_SENSE 14 // Battery ADC divider (1.0M / 1.5M) on AIN1
#define LORA_SCK 5
#define LORA_MISO 3
#define LORA_MOSI 6
#define LORA_NSS 7
#define LORA_RESET 8
#define LORA_DIO1 47
#define LORA_BUSY 48
// --- Regional LoRaWAN Configuration (Dual-Channel Profile) ---
#define REGION_BANDWIDTH 125.0
#define REGION_SPREADING_FACTOR 10 // SF10 / DR2
#define REGION_CODING_RATE 5
#define REGION_SYNC_WORD 0x34
#define REGION_POWER_DBM 22
#define REGION_PREAMBLE_LENGTH 8
// --- LoRaWAN Network Credentials (From TTN Console) ---
uint64_t joinEUI = 0x0000000000000000;
uint64_t devEUI = 0x70B3D57ED007940B; // Replace with your DevEUI
uint8_t appKey[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; // Replace with your AppKey
// --- Dedicated SPI & Radio Instances ---
SPIClass loraSPI(FSPI);
Module loraMod(LORA_NSS, LORA_DIO1, LORA_RESET, LORA_BUSY, loraSPI);
SX1262 radio(&loraMod);
LoRaWANNode node(&radio, &AS923_3);
// --- I2C Environmental Sensor ---
Adafruit_SHT31 sht30 = Adafruit_SHT31();
// --- NVS Flash (DevNonce Persistence on Boot) ---
Preferences prefs;
#define NONCES_BUF_SIZE RADIOLIB_LORAWAN_NONCES_BUF_SIZE
#define SESSION_BUF_SIZE RADIOLIB_LORAWAN_SESSION_BUF_SIZE
// --- RTC Fast SRAM Persistence (Zero Flash Wear During Deep Sleep) ---
RTC_DATA_ATTR uint8_t rtcSessionBuf[SESSION_BUF_SIZE];
RTC_DATA_ATTR bool rtcSessionValid = false;
RTC_DATA_ATTR uint32_t rtcBootCount = 0;
// --- Battery Voltage Helper ---
const float VBAT_DIVIDER_RATIO = 1.6667f;
uint16_t readBatteryMilliVolts() {
uint32_t adc_mv = analogReadMilliVolts(PIN_VBAT_SENSE);
return (uint16_t)(adc_mv * VBAT_DIVIDER_RATIO);
}
// --- LoRaWAN Session & Join Management ---
void handleNetworkActivation() {
if (rtcSessionValid) {
// 1. FAST WAKEUP: Restore session directly from RTC Fast SRAM (<1 ms, 0 Flash writes)
Serial.println(F("[RTC] Waking from Deep Sleep. Restoring session from RTC Fast SRAM..."));
node.setBufferSession(rtcSessionBuf);
node.activateOTAA(); // Resumes active state in memory without air-join
} else {
// 2. COLD BOOT: Power applied or reset pressed. Restore nonces from Flash and join.
Serial.println(F("[COLD BOOT] Initializing network session..."));
prefs.begin("lorawan", false);
if (prefs.isKey("nonces")) {
Serial.println(F("[NVS] Restoring saved DevNonces from Flash..."));
uint8_t noncesBuf[NONCES_BUF_SIZE];
prefs.getBytes("nonces", noncesBuf, NONCES_BUF_SIZE);
node.setBufferNonces(noncesBuf);
}
Serial.println(F("[NETWORK] Sending OTAA Join Request..."));
int attempt = 1;
while (!node.isActivated() && attempt <= 5) {
Serial.printf("[NETWORK] OTAA Join Attempt %d of 5... ", attempt);
digitalWrite(PIN_LED_BLUE, HIGH);
int16_t joinState = node.activateOTAA();
digitalWrite(PIN_LED_BLUE, LOW);
if (joinState == RADIOLIB_LORAWAN_NEW_SESSION) {
Serial.println(F("SUCCESS!"));
// Cache newly incremented DevNonce to Flash ONLY ONCE per cold boot
prefs.putBytes("nonces", node.getBufferNonces(), NONCES_BUF_SIZE);
Serial.println(F("[NVS] DevNonce updated in Flash."));
// Cache session into RTC SRAM for all subsequent deep sleep wakeups
memcpy(rtcSessionBuf, node.getBufferSession(), SESSION_BUF_SIZE);
rtcSessionValid = true;
break;
} else {
Serial.printf("FAILED (Error: %d). Retrying in 5s...\n", joinState);
delay(5000);
attempt++;
}
}
prefs.end();
}
}
void enterLowPowerSleep(uint32_t sleepSeconds) {
// Put SX1262 transceiver into cold sleep (~160 nA)
radio.sleep();
// Configure RTC timer wakeup
esp_sleep_enable_timer_wakeup((uint64_t)sleepSeconds * 1000000ULL);
Serial.printf("[SLEEP] Entering Deep Sleep for %u seconds...\n", sleepSeconds);
Serial.flush();
// Power down CPU, flash, high-speed clocks, and main SRAM
esp_deep_sleep_start();
}
void setup() {
rtcBootCount++;
pinMode(PIN_LED_BLUE, OUTPUT);
pinMode(PIN_LED_GREEN, OUTPUT);
digitalWrite(PIN_LED_BLUE, LOW);
digitalWrite(PIN_LED_GREEN, LOW);
// Configure ADC for precision battery reading
analogReadResolution(12);
analogSetAttenuation(ADC_11db);
Serial.begin(115200);
// Brief delay to establish USB CDC connection if connected to workstation
delay(1000);
Serial.printf("\n=== Cubicore Devboard Boot #%u ===\n", rtcBootCount);
// 1. Initialize I2C Grove Sensor on J6
Wire.begin(9, 40);
bool sensorOk = sht30.begin(0x44);
// 2. Initialize Dedicated LoRa SPI
loraSPI.begin(LORA_SCK, LORA_MISO, LORA_MOSI, LORA_NSS);
int state = radio.begin();
if (state != RADIOLIB_ERR_NONE) {
Serial.printf("[RADIO] Init failed (%d). Retrying sleep...\n", state);
enterLowPowerSleep(60);
}
// 3. Configure Dual-Channel Locking Profile
node.beginOTAA(joinEUI, devEUI, appKey);
node.setADR(false);
node.setDatarate(2); // DR2 / SF10
// 4. Activate or restore LoRaWAN session
handleNetworkActivation();
if (!node.isActivated()) {
Serial.println(F("[HALT] OTAA Join failed. Halting for retry..."));
rtcSessionValid = false;
enterLowPowerSleep(60);
}
// 5. Sample Environmental & Battery Sensors
float temperature = 0.0f;
float humidity = 0.0f;
if (sensorOk) {
temperature = sht30.readTemperature();
humidity = sht30.readHumidity();
}
uint16_t batteryMilliVolts = readBatteryMilliVolts();
Serial.printf("[SENSOR] Temp: %.2f C | Humidity: %.2f %% | Battery: %u mV\n",
temperature, humidity, batteryMilliVolts);
// 6. Pack Binary Payload (6 Bytes total)
// [0..1]: Temperature * 100 (int16_t)
// [2..3]: Humidity * 100 (uint16_t)
// [4..5]: Battery mV (uint16_t)
uint8_t payload[6];
int16_t tempEncoded = (int16_t)(temperature * 100);
uint16_t humEncoded = (uint16_t)(humidity * 100);
payload[0] = (uint8_t)(tempEncoded >> 8);
payload[1] = (uint8_t)(tempEncoded & 0xFF);
payload[2] = (uint8_t)(humEncoded >> 8);
payload[3] = (uint8_t)(humEncoded & 0xFF);
payload[4] = (uint8_t)(batteryMilliVolts >> 8);
payload[5] = (uint8_t)(batteryMilliVolts & 0xFF);
// 7. Dispatch Uplink Transmission
Serial.print(F("[UPLINK] Sending packet... "));
digitalWrite(PIN_LED_BLUE, HIGH);
state = node.sendReceive(payload, sizeof(payload));
digitalWrite(PIN_LED_BLUE, LOW);
if (state == RADIOLIB_ERR_NONE) {
Serial.println(F("SUCCESS!"));
digitalWrite(PIN_LED_GREEN, HIGH);
delay(100);
digitalWrite(PIN_LED_GREEN, LOW);
// Save updated frame counter to RTC Fast SRAM (0 Flash wear!)
memcpy(rtcSessionBuf, node.getBufferSession(), SESSION_BUF_SIZE);
} else {
Serial.printf("FAILED (Error: %d)\n", state);
}
// 8. Put radio to sleep and enter Deep Sleep
enterLowPowerSleep(SLEEP_INTERVAL_SECONDS);
}
void loop() {
// Empty: The ESP32-S3 reboots into setup() upon each timer wakeup
}
6. Energy Budgeting & Battery Longevity Calculations
To determine how long your Cubicore Devboard will run in the field, we calculate the average power consumption across a complete duty cycle.
6.1 Phase-by-Phase Energy Profile
Assuming a 10-minute uplink interval (600 seconds total cycle):
| Operating Phase | Duration (t) | Current (I) | Energy Consumption (I × t) |
|---|---|---|---|
| Sensor Sample & Math | 50 ms (0.05 s) | 30 mA | 1.50 mA·s |
| LoRa TX (+22 dBm, SF10) | 120 ms (0.12 s) | 118 mA | 14.16 mA·s |
| RX1 / RX2 Listen Windows | 100 ms (0.10 s) | 8 mA | 0.80 mA·s |
| Deep Sleep Phase | 599.73 s | 0.015 mA (15 µA) | 8.99 mA·s |
| Total Cycle | 600.00 s | — | 25.45 mA·s |
6.2 Average Current Formula
I_avg = Total Energy / Total Time = 25.45 mA·s / 600 s ≈ 0.0424 mA = 42.4 µA
6.3 Expected Battery Lifespan Table
Assuming an 85% usable battery discharge efficiency:
| Battery Capacity | 5-Minute Uplink (I_avg ≈ 68 µA) | 10-Minute Uplink (I_avg ≈ 42 µA) | 1-Hour Uplink (I_avg ≈ 20 µA) |
|---|---|---|---|
| 500 mAh Li-Po | ~175 Days (~6 Months) | ~283 Days (~9.5 Months) | ~1.7 Years |
| 1,200 mAh Li-Po | ~1.1 Years | ~1.8 Years | ~4.2 Years |
| 2,500 mAh (18650 Cell) | ~2.4 Years | ~3.8 Years | ~7.5+ Years (Shelf-life limited) |
For ultra-long-term field logging (such as remote soil moisture monitoring), transmitting once every 15 to 30 minutes provides the sweet spot where current draw is dominated almost entirely by the 15 µA sleep floor. Under this profile, standard 18650 lithium cells easily exceed the 5-year deployment mark.
6.4 Solar Harvesting Calculations
When pairing the board with a small solar panel via the SOLAR JST-PH connector:
- A 10-minute reporting node consumes ~1.02 mAh per day (0.0424 mA × 24 hrs).
- A tiny 5V / 1 Watt solar panel produces ~150 mA in direct sunlight.
- Generating 1.02 mAh of replacement energy requires:
Sunlight Required = (1.02 mAh / 150 mA) × 60 min ≈ 25 seconds of sunlight per day
Even in rainy, overcast climates with only 1 hour of diffuse sunlight per week, a 1W solar panel paired with a 1,200 mAh battery will keep the Cubicore Devboard running indefinitely.
7. Hardware Safety & Field Deployment Best Practices
7.1 Battery Safety & Discharge Cutoffs
- Use Cells with Integrated PCM: Always use single-cell Li-Po packs that incorporate an internal Protection Circuit Module (PCM). The PCM protects against short circuits, overcharging (above 4.25V), and dangerous over-discharge (below 2.8V).
- Soft Firmware Cutoff: If
readBatteryMilliVolts()reports less than 3,250 mV, configure firmware to skip the LoRa transmission and sleep for 1 hour to prevent draining the cell to permanent shutdown.
7.2 Solar Panel Selection
- Voltage Limits: The
SOLARinput connects to the TP4054 charger through reverse-blocking Schottky diodes. Ensure your panel's open-circuit voltage (Voc) does not exceed 6.0V, as higher voltages can damage the linear charger. - Recommended Panel Specs: 5V or 5.5V nominal, 1W to 2W, monocrystalline with an IP67 epoxy or PET lamination.
7.3 Weatherproof Enclosure Considerations
- Breather Vents: When deploying in sealed IP66/IP67 enclosures, install an ePTFE waterproof breather vent (such as a Gore vent). Sealed enclosures experience internal pressure differentials under hot tropical sun, drawing moisture past O-rings during evening cooling.
- Antenna Placement: Never mount the 915 MHz LoRa blade antenna inside a metal enclosure. Use the Devboard baseplate's external RP-SMA bulkhead jack to mount the antenna externally.
8. Troubleshooting Power & Sleep Failures
| Symptom / Error | Root Cause | Recommended Fix |
|---|---|---|
| Sleep current exceeds 1 mA (battery drains in days) | 1. Semtech SX1262 was not put into sleep mode before calling esp_deep_sleep_start().2. Floating GPIO pins or enabled internal pullups. 3. USB cable still attached. | 1. Ensure radio.sleep(); is called before deep sleep.2. Unplug the USB cable—the native USB-C PHY consumes ~10 mA when connected to a live host. 3. Verify no external sensors remain powered on unswitched rails. |
| Device rejoins network on every timer wakeup | 1. Session buffer was not declared with RTC_DATA_ATTR.2. Battery voltage sag caused a brownout reset (clearing RTC SRAM). | 1. Verify RTC_DATA_ATTR uint8_t rtcSessionBuf[...] is defined at global scope.2. Verify that handleNetworkActivation() checks rtcSessionValid before sending join requests.3. Test battery capacity under high-current TX load. |
| Serial Monitor disconnects and stops printing | Normal behavior for ESP32-S3 native USB CDC. | During deep sleep, the internal USB PHY is powered off, causing the operating system to unmount the virtual COM port. When testing on the bench, keep delay(1000) in setup() to allow the USB CDC device to enumerate upon wakeup. |
| Battery is plugged in but not charging from Solar | Solar panel voltage is lower than battery voltage or reverse diode dropout. | The TP4054 requires an input voltage at least 100 mV higher than the battery cell voltage to enter constant-current charging. Measure solar panel open-circuit voltage under active sunlight. |
Battery voltage reads 0.0V or incorrect values | ADC attenuation or resolution not configured. | Ensure analogReadResolution(12); and analogSetAttenuation(ADC_11db); are invoked in setup(). Verify PIN_VBAT_SENSE is set to 14. |
Next Steps
Congratulations! You have completed the Cubicore Devboard Guide Series. Your untethered field node is now fully optimized for multi-year battery operation and real-time cloud monitoring:
- Return to Chapter 7: Integrating with Cubicore Cloud to monitor battery voltage trends on live cloud charts.
- Ingest device telemetry over MQTT with Chapter 8: Ingesting Telemetry via TTN MQTT.
- Explore direct device-to-device communication in Chapter 9: LoRa Point-to-Point (P2P).
- Explore backhaul infrastructure in the Cubicore Gateway Guide Series.