ESP32-based outdoor environmental monitoring device with BLE connectivity to the indoor WeatherStation.
- Environmental Monitoring: BME280 sensor for temperature, humidity, and pressure
- Battery Management: LC709203F fuel gauge for LiPo battery monitoring
- BLE Client: Connects to indoor WeatherStation to transmit data
- Power Efficient: Deep sleep operation with configurable intervals
- Low Power: Optimized for battery-powered outdoor operation
- ESP32 development board
- BME280 environmental sensor
- LC709203F battery fuel gauge
- 18650 Li-ion battery (3.7V, 3000mAh typical)
- Weatherproof enclosure
| Component | ESP32 Pin | Description |
|---|---|---|
| BME280 SDA | GPIO 21 | I2C data line |
| BME280 SCL | GPIO 22 | I2C clock line |
| LC709203F SDA | GPIO 21 | I2C data line (shared) |
| LC709203F SCL | GPIO 22 | I2C clock line (shared) |
All settings are configurable in src/config.h:
#define SLEEP_DURATION_SECONDS 300 // 5 minutes (300 seconds)#define BLE_SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b"
#define BLE_CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8"
#define BLE_SCAN_INTERVAL 1349 // 1.35 seconds between scans
#define BLE_SCAN_WINDOW 134 // 10% duty cycle (134ms/1349ms)
#define BLE_SCAN_DURATION 5 // 5 seconds max scan time
#define BLE_SCAN_ACTIVE false // Passive scanning (lower power)
#define BLE_POWER_LEVEL ESP_PWR_LVL_P3 // +3 dBm - good range, lower power// 18650 Battery Settings
#define BATTERY_CAPACITY LC709203F_APA_3000MAH // 3000mAh typical for 18650
#define BATTERY_ALARM_VOLTAGE 3.2 // 3.2V minimum for 18650
#define BATTERY_PROFILE LC709203_ICR18650_SAMSUNG // Samsung 18650 profile#define I2C_SDA 21
#define I2C_SCL 22- Boot: Initialize sensors and BLE client
- Sensor Reading: Read BME280 data (temperature, humidity, pressure)
- Battery Check: Monitor battery voltage and percentage
- Data Serialization: Pack data into binary format
- BLE Connection: Connect to indoor WeatherStation
- Data Transmission: Send serialized data
- Deep Sleep: Enter configurable sleep cycle
The device sends serialized data in this format:
struct {
float temperature; // 4 bytes
float humidity; // 4 bytes
float pressure; // 4 bytes
float batteryVoltage; // 4 bytes
float batteryPercent; // 4 bytes (changed from int to float for compatibility)
} // Total: 20 bytes- Deep Sleep: Configurable sleep duration (default: 5 minutes)
- Battery Monitoring: Real-time voltage and percentage tracking
- Low Power Mode: Optimized BLE settings for minimal power consumption
- Wake-up: Timer-based wake-up from deep sleep
The WeatherStation_outdoor is optimized for maximum battery life:
- BME280 Sensor: 4x oversampling (60% power reduction)
- BLE Configuration: +3 dBm power, 10% scan duty cycle (75% power reduction)
- Deep Sleep: 5-minute sleep cycles minimize active time
- 18650 Battery: Proper voltage monitoring and alarm settings
Estimated Battery Life Improvement: 3-5x longer operation compared to default settings
This device works as a BLE client that connects to the indoor WeatherStation:
- Indoor station acts as BLE server
- Outdoor data is integrated into the web interface
- Available through the indoor station's API
- Compatible with Home Assistant integration
The outdoor station sends data in a format that perfectly matches the indoor station's expectations:
- All sensor values are transmitted as 32-bit floats
- Data structure is optimized for reliable BLE transmission
- Battery percentage is sent as float for precise monitoring
- Clone the repository
- Configure settings in
src/config.h - Connect hardware according to pin diagram
- Build and upload:
pio run -t upload
Change SLEEP_DURATION_SECONDS in src/config.h:
- 60 seconds = 1 minute
- 300 seconds = 5 minutes (default)
- 600 seconds = 10 minutes
Update BATTERY_CAPACITY for your battery:
LC709203F_APA_1000MAHfor 1000mAhLC709203F_APA_2000MAHfor 2000mAhLC709203F_APA_3000MAHfor 3000mAh (18650 default)
For 18650 batteries, use:
LC709203_ICR18650_SAMSUNGfor Samsung 18650 (default)LC709203_ICR18650_PANASONICfor Panasonic 18650
The BME280 is configured for optimal outdoor performance:
- Oversampling: 4x for all sensors (good accuracy, lower power)
- Mode: Forced mode (on-demand reading)
- Filter: 4x filtering (reduces outdoor noise)
- I2C Address: 0x76 (standard)
Benefits of this configuration:
- Power Savings: ~60% reduction in sensor power consumption
- Faster Readings: ~4x faster sensor response time
- Better Stability: Filtering reduces outdoor environmental noise
- Maintained Accuracy: Still excellent resolution for weather monitoring
The BLE configuration is optimized for battery life:
- Power Level: +3 dBm (good range, lower power consumption)
- Scan Duty Cycle: 10% (134ms scan window every 1.35s)
- Scan Duration: 5 seconds maximum
- Passive Scanning: Lower power consumption
Benefits of this configuration:
- Power Savings: ~75% reduction in BLE power consumption
- Faster Connection: Shorter scan duration (5s vs 10s)
- Sufficient Range: +3 dBm covers typical outdoor-indoor distances
- Better Battery Life: Significant improvement in overall power efficiency
Modify scan parameters for different environments:
BLE_SCAN_INTERVAL: Scan interval (higher = less power)BLE_SCAN_WINDOW: Scan window (lower = less power)BLE_SCAN_DURATION: How long to scan (seconds)
- Hardware Setup Guide - Complete hardware assembly instructions
- Troubleshooting Guide - Common issues and solutions
- Contributing Guidelines - How to contribute to the project
- Changelog - Version history and updates
- License - MIT License
- Check BLE UUIDs match indoor station
- Verify indoor station is powered and advertising
- Check battery voltage is above alarm threshold
- Verify I2C connections (SDA/SCL)
- Check BME280 sensor is properly powered
- Ensure I2C address is correct (0x76 or 0x77)
- Verify battery capacity setting matches actual battery
- Check battery profile setting for your cell chemistry
- Monitor battery voltage through serial output
This project is licensed under the MIT License.