power_analysis.md 7.6 KB

Wemos D1 Mini Weather Station Power Analysis

Power Consumption Analysis

Component Power Requirements

Wemos D1 Mini Development Board

  • Active Mode: 70-200mA (typical 150mA)
  • WiFi Transmission: 150-200mA peaks
  • Deep Sleep Mode: 10-20µA
  • Modem Sleep: 80mA
  • Operating Voltage: 3.3V
  • Power: ~0.5W (active), ~0.66W (WiFi peak)

Sensors

  • DHT11: 1.5mA (measurement), 40µA (standby)
  • BMP180: 1mA (measurement), 5µA (standby)
  • Rain Sensor Module: 3-5mA (continuous)
  • LDR Circuit: ~0.3mA (with 10kΩ pull-down)

LED Indicator

  • LED: 20mA (full brightness)
  • With 220Ω resistor: ~15mA @ 3.3V

Battery Monitoring

  • Voltage Divider: ~0.1mA (100kΩ + 100kΩ)
  • ADC Reading: Minimal additional current

Total Power Consumption

Active Operation (WiFi + All Sensors)

Wemos D1 Mini (active): 150mA
WiFi transmission:     200mA (peaks)
DHT11:                 1.5mA
BMP180:                1mA
Rain Sensor:           5mA
LDR Circuit:           0.3mA
LED:                   15mA
Battery Monitor:       0.1mA
---------------------------
Total (typical):       ~172mA
Total (peak):          ~222mA

Low Power Operation (WiFi Sleep)

Wemos D1 Mini (modem sleep): 80mA
DHT11 (standby):              0.04mA
BMP180 (standby):             0.005mA
Rain Sensor:                  5mA
LDR Circuit:                  0.3mA
LED (off):                    0mA
Battery Monitor:              0.1mA
-------------------------------
Total:                        ~85mA

Deep Sleep Mode

Wemos D1 Mini (deep sleep): 0.02mA
DHT11 (standby):             0.04mA
BMP180 (standby):            0.005mA
Rain Sensor:                0mA (if powered down)
LDR Circuit:                 0mA
LED (off):                   0mA
Battery Monitor:             0.1mA
-------------------------------
Total:                       ~0.165mA

18650 Battery Analysis

18650 Battery Specifications

  • Capacity: 2000-3500mAh (typical 2500mAh)
  • Voltage: 3.7V (nominal), 4.2V (full), 2.5V (empty)
  • Energy: ~9.25Wh (2500mAh × 3.7V)
  • Discharge Rate: 1C-2C typical (2.5A-5A for 2500mAh)

Runtime Calculations

Scenario 1: Continuous Active Operation

  • Current Draw: 172mA @ 3.7V
  • Battery Capacity: 2500mAh
  • Runtime: 2500mAh ÷ 172mA = 14.5 hours

Scenario 2: Intermittent Operation (Normal Use)

  • Active (30%): 172mA × 0.3 = 51.6mA average
  • Low Power (70%): 85mA × 0.7 = 59.5mA average
  • Total Average: 111.1mA
  • Runtime: 2500mAh ÷ 111.1mA = 22.5 hours

Scenario 3: Deep Sleep Strategy

  • Active (5%): 172mA × 0.05 = 8.6mA
  • Deep Sleep (95%): 0.165mA × 0.95 = 0.157mA
  • Total Average: 8.76mA
  • Runtime: 2500mAh ÷ 8.76mA = 285 hours (11.9 days)

Scenario 4: Optimized Operation

  • Active (10%): 172mA × 0.1 = 17.2mA
  • Moderate Sleep (90%): 80mA × 0.9 = 72mA
  • Total Average: 89.2mA
  • Runtime: 2500mAh ÷ 89.2mA = 28.0 hours

Scenario 5: Solar-Assisted Operation

  • Active (30%): 172mA × 0.3 = 51.6mA average
  • Low Power (70%): 85mA × 0.7 = 59.5mA average
  • Total Average: 111.1mA
  • Solar Input: 6V 2W panel provides ~333mA @ 3.3V
  • Net Consumption: 111.1mA - 333mA = -222mA (charging)
  • Runtime: Continuous operation with battery charging

Power Management Recommendations

Voltage Regulation

Since Wemos D1 Mini and sensors operate at 3.3V, but 18650 provides 3.7V:

18650 (3.7V) → DC-DC Buck Converter → 3.3V

Required Converter Specifications:

  • Input Voltage: 2.5V-4.2V
  • Output Voltage: 3.3V
  • Efficiency: >90%
  • Max Current: >200mA (Wemos D1 Mini requirement)
  • Recommended: TP4056 with protection + 3.3V buck converter

Power Management Strategies

1. WiFi Sleep Mode

// Enable WiFi sleep between transmissions
WiFi.setSleep(true);

2. Deep Sleep with Timer

// Sleep for 5 minutes between readings
ESP.deepSleep(5 * 60 * 1000000); // Wemos D1 Mini

3. Sensor Power Management

// Power down sensors when not reading
digitalWrite(SENSOR_POWER_PIN, LOW);

4. LED Power Management

// Turn off LED when not needed
digitalWrite(LED_PIN, LOW);

Battery Monitoring

Voltage Monitoring

// Monitor battery voltage (Wemos D1 Mini - 10-bit ADC)
float batteryVoltage = analogRead(BATTERY_PIN) * (3.3 / 1023.0) * 2.0; // Voltage divider
if (batteryVoltage < 3.0) {
  // Low battery warning
}

Battery Percentage

int batteryPercentage = map(batteryVoltage, 3.0, 4.2, 0, 100);

Power Optimization Code

Optimized Loop Structure

void loop() {
  // Wake up sensors
  digitalWrite(SENSOR_POWER_PIN, HIGH);
  delay(100);
  
  // Read sensors
  readSensors();
  
  // Update display briefly
  updateDisplay();
  
  // Send MQTT data
  sendMQTTData();
  
  // Power down sensors
  digitalWrite(SENSOR_POWER_PIN, LOW);
  lcd.noBacklight();
  
  // Sleep for extended period
  esp_sleep_enable_timer_wakeup(300000000); // 5 minutes
  esp_deep_sleep_start();
}

Battery-Powered Configuration

// Power saving settings (Wemos D1 Mini)
WiFi.setSleep(true);
WiFi.setSleepMode(WIFI_LIGHT_SLEEP);

Recommendations

For Single 18650 Operation:

  1. Use Deep Sleep: Essential for multi-day operation
  2. Optimize Reading Frequency: 5-15 minute intervals
  3. Power Down Sensors: Cut power when not reading
  4. Use Efficient Voltage Regulation: Buck converter >90% efficiency
  5. Monitor Battery Voltage: Prevent over-discharge

Expected Runtime with Optimization:

  • Conservative: 7-10 days (5-minute readings)
  • Aggressive: 14-21 days (15-minute readings)
  • Minimal: 28+ days (30-minute readings)
  • Solar-Assisted: Continuous operation with battery charging

Hardware Requirements:

  • 18650 battery (2500mAh+ recommended)
  • Battery holder with protection circuit
  • 3.3V buck converter (high efficiency)
  • Battery voltage divider for monitoring
  • 6V 2W solar panel for continuous operation

Power Consumption Comparison

ESP32 vs Wemos D1 Mini

Feature ESP32 Wemos D1 Mini Improvement
Active Current 200mA 150mA 25% less
WiFi Peak 250mA 200mA 20% less
Deep Sleep 0.01mA 0.02mA Similar
Battery Runtime 5.3 hours 14.5 hours 174% better
Deep Sleep Runtime 105 hours 285 hours 171% better

Solar Panel Requirements

  • ESP32 System: 6V 3W panel recommended
  • Wemos D1 Mini System: 6V 2W panel sufficient
  • Power Margin: Wemos D1 Mini has 33% more solar margin

Conclusion

Yes, one 18650 can run this system exceptionally well, with significant advantages:

  • Continuous Operation: 14.5 hours (practical for daily use)
  • Optimized Operation: 7-21 days (with deep sleep)
  • Solar-Assisted: Continuous operation with battery charging
  • Key Advantage: Wemos D1 Mini's lower power consumption
  • Voltage Regulation: Proper 3.3V regulation needed
  • Battery Protection: Prevent over-discharge below 3.0V

The Wemos D1 Mini provides superior battery life compared to ESP32, making it ideal for battery-powered weather station applications. With solar panel integration, truly autonomous operation is achievable.