DM-01 · Projects · REV 2026.11
PRJ-001Shipped
ESP32 Weather Station
A battery-powered, Wi-Fi connected weather station with deep-sleep power management and a live web dashboard.
- platform
- ESP32
- lang
- C++
- duration
- 6 weeks
- year
- 2025
- type
- embedded
- code
- 2,400 lines
- authors
- 1
ESP32 · C++ · PlatformIO · BME280 · MQTT
Overview
A self-contained outdoor weather station that measures temperature, humidity and pressure, publishes readings over MQTT, and runs for weeks on a single battery charge thanks to aggressive deep-sleep power management.
Problem Statement
Commercial weather stations are either cheap and closed, or open and expensive. I wanted full control over the data, the sampling interval and the power budget — and an excuse to learn low-power embedded design properly.
Solution
An ESP32 wakes every ten minutes, reads a BME280 sensor over I2C, publishes a JSON payload over MQTT, and returns to deep sleep. A small web dashboard subscribes to the broker and charts the history.
Hardware
- ESP32 DevKit with the voltage regulator's quiescent draw measured and accounted for
- BME280 environmental sensor on I2C
- Voltage divider on an ADC pin for battery monitoring
- 18650 cell with a TP4056 charging board
Challenges
- Getting deep-sleep current from ~10 mA down to microamps required cutting power to the sensor via a MOSFET and disabling the dev board's power LED.
- Wi-Fi association time dominated the wake budget; caching the BSSID and channel cut connection time roughly in half.
Lessons Learned
- Measure, don't assume: the multimeter contradicted three "low power" tutorials.
- State that survives deep sleep (RTC memory) is a tiny but critical API to design around.
Future Improvements
- Custom PCB to replace the dev-board-plus-modules build
- Solar charging
- LoRa version for locations without Wi-Fi