Battery-powered mailbox sensor using LoRa for long-range communication. Sends notification when the mailbox lid is opened, including battery voltage for monitoring.
- Long range: LoRa communication (tested at -70 to -80 dBm indoors)
- Long battery life: ~4-6 months on 6x 18650 cells (12000mAh)
- Low power: ~2.6-3.4mA deep sleep current
- Battery monitoring: Voltage reported with each message, LOW_BAT warning at 3.4V
- Lid open warning: Alert if lid stays open for 5+ minutes
- Home Assistant integration: Via ESPHome API
- Heltec WiFi LoRa 32 V3 (ESP32-S3 + SX1262)
- 6x 18650 Li-ion cells in parallel (12000mAh)
- Reed switch or magnetic contact sensor
- Voltage divider for battery monitoring (2x equal resistors)
- Heltec WiFi LoRa 32 V3 (ESP32-S3 + SX1262)
- USB powered (always on)
Reed Switch:
- One terminal → GPIO5
- Other terminal → GND
- (Internal pullup enabled)
Battery Voltage Divider:
- Battery+ → 100kΩ → GPIO7 → 100kΩ → GND
- Gives 0-2.1V for 0-4.2V battery
Battery Pack:
- 6x 18650 in parallel → JST connector or direct to board
Just USB power - no additional wiring needed
- Install ESPHome
- Copy
lora-sender.yamlandlora-receiver.yamlto your ESPHome config folder - Update
secrets.yamlwith your WiFi credentials and API keys - Flash receiver first (needs WiFi for OTA)
- Flash sender via USB (no WiFi in production mode)
| Message | Meaning |
|---|---|
1|4.02 |
Mail received, battery at 4.02V |
1|3.35|LOW_BAT |
Mail received, battery low (<3.4V) |
W|4.02|LID_OPEN |
Lid open for 5+ minutes |
The receiver fires a esphome.lora_mailbox_packet event with:
payload: The raw messagerssi: Signal strength in dBm
Example automation:
automation:
- alias: "Mailbox notification"
trigger:
- platform: event
event_type: esphome.lora_mailbox_packet
condition:
- condition: template
value_template: "{{ trigger.event.data.payload.startswith('1|') }}"
action:
- service: notify.mobile_app
data:
title: "📬 You've got mail!"
message: "Battery: {{ trigger.event.data.payload.split('|')[1] }}V"Tested optimizations that did NOT help (hardware limited):
rtc_gpio_isolate()on unused pinsgpio_hold_en()andgpio_deep_sleep_hold_en()- Various GPIO configurations
The ~2.6-3.4mA deep sleep current is due to:
- CP2102 USB-UART chip (always powered)
- LDO regulator quiescent current
- These are hardware limitations of the Heltec V3 board
The Heltec V4 board is worth exploring for this type of battery-powered project. It features improved power management compared to the V3, which may significantly reduce deep sleep current. This project has not been tested on V4, but it is the recommended upgrade path if battery life is a priority.
- Weekly heartbeat with battery status
- DS18B20 temperature sensor
- Solar panel charging (CN3065 + 6V panel) — goal is indefinite runtime without manual charging
MIT
Developed with assistance from Claude AI (Anthropic)