Преглед на файлове

esp32 to Wemos and adding pattery and solar apnel

svalavuo преди 1 месец
родител
ревизия
184dba913e
променени са 8 файла, в които са добавени 1037 реда и са изтрити 127 реда
  1. 37 37
      README.md
  2. 4 5
      platformio.ini
  3. 223 0
      power_analysis.md
  4. 5 31
      schematics.md
  5. 248 0
      solar_battery_system.md
  6. 282 0
      solar_schematics.md
  7. 132 54
      weatherstation.ino
  8. 106 0
      wemos_d1mini_analysis.md

+ 37 - 37
README.md

@@ -1,33 +1,34 @@
-# ESP32 Weather Station
+# Wemos D1 Mini Weather Station
 
-A comprehensive weather monitoring system built on ESP32 with multiple sensors and MQTT connectivity for IoT integration.
+A compact weather monitoring system built on Wemos D1 Mini with multiple sensors and MQTT connectivity for IoT integration.
 
 ## Features
 - Temperature and humidity monitoring (DHT11)
 - Atmospheric pressure measurement (BMP180)
 - Rain detection sensor (analog)
-- Light detection (LDR) with LED indicator
-- Real-time 16x2 I2C LCD display
+- Light detection (LDR) with LED status indicator
 - WiFi connectivity with automatic reconnection
 - MQTT data publishing with JSON format
 - Automatic MQTT reconnection with random client ID
 - Non-blocking timer-based sensor readings
-- Error handling and status indication
+- Error handling with LED status indication
 - Serial debugging output (115200 baud)
+- Battery-friendly low power design
+- Compact form factor
 
 ## Hardware Requirements
-- ESP32 development board
+- Wemos D1 Mini development board
 - DHT11 temperature/humidity sensor
 - BMP180 pressure sensor
 - Rain sensor module (analog output)
 - LDR (Light Dependent Resistor)
-- 16x2 I2C LCD display (0x27 address)
-- LED (for light status indication)
+- LED (for system status indication)
+- 10kΩ resistor (for LDR pull-down)
+- 220Ω resistor (for LED current limiting)
 - Breadboard and jumper wires
 
 ## Software Dependencies
 - DHT sensor library
-- LiquidCrystal I2C
 - SFE BMP180 Breakout Library
 - PubSubClient
 
@@ -39,13 +40,13 @@ Update the following constants in `weatherstation.ino`:
 - `mqtt_port`: MQTT broker port (default 1883)
 - `mqtt_topic`: MQTT topic for data publishing (default: weather/station)
 
-## Pin Configuration
-- DHT11 Sensor: Pin 4
-- LDR Sensor: Pin 35 (input only)
-- Rain Sensor: Pin 34 (analog)
-- Status LED: Pin 2
-- I2C LCD (SDA): Pin 21
-- I2C LCD (SCL): Pin 22
+## Pin Configuration (Wemos D1 Mini)
+- DHT11 Sensor: D4 (GPIO2)
+- LDR Sensor: D3 (GPIO0) - Digital input
+- Rain Sensor: A0 (Analog input only)
+- Status LED: D5 (GPIO14)
+- I2C (SDA): D1 (GPIO5) - for BMP180
+- I2C (SCL): D2 (GPIO4) - for BMP180
 
 ## MQTT Data Format
 The station publishes JSON data to the configured topic:
@@ -59,11 +60,10 @@ The station publishes JSON data to the configured topic:
 }
 ```
 
-## LCD Display Format
-```
-Line 1: T:23.4C H:67%
-Line 2: R:15% P:1013
-```
+## LED Status Indication
+- **Steady ON**: Light detected by LDR
+- **Steady OFF**: No light detected
+- **Rapid Blinking**: Sensor error detected
 
 ## Serial Output Format
 ```
@@ -91,7 +91,6 @@ Temp: 23.45°C, Humidity: 67.89%, Rain: 15%, Pressure: 1013.25 hPa, Light: YES
 ## Operation Schedule
 - **Sensor readings**: Every 2 seconds (2000ms)
 - **MQTT data publishing**: Every 30 seconds (30000ms)
-- **LCD display updates**: Every 2 seconds
 - **LED status updates**: With each sensor reading
 - **WiFi connection attempts**: 20 attempts (10 seconds timeout)
 - **MQTT reconnection**: Every 5 seconds if disconnected
@@ -100,11 +99,11 @@ Temp: 23.45°C, Humidity: 67.89%, Rain: 15%, Pressure: 1013.25 hPa, Light: YES
 - **Sensor errors**: Check wiring connections and power supply
 - **WiFi connection**: Verify SSID and password credentials
 - **MQTT connection**: Ensure broker is accessible and running
-- **LCD display**: Check I2C address (default 0x27) and connections
 - **DHT11 readings**: Look for NaN values in serial output
 - **BMP180 sensor**: Verify initialization and I2C connection
 - **Rain sensor**: Check analog pin assignment (Pin 34)
 - **LDR/LED**: Verify digital pin assignment (Pin 35 for LDR, Pin 2 for LED)
+- **LED status**: Rapid blinking indicates sensor errors
 
 ## Code Architecture
 - **Modular design**: Separate functions for each sensor
@@ -118,47 +117,48 @@ Temp: 23.45°C, Humidity: 67.89%, Rain: 15%, Pressure: 1013.25 hPa, Light: YES
 - **Memory**: 520KB SRAM, 4MB Flash
 - **Wireless**: WiFi 802.11 b/g/n
 - **Sensors**: DHT11 (±2°C, ±5%RH), BMP180 (±1hPa), Rain sensor, LDR
-- **Display**: 16x2 Character LCD with I2C interface
-- **Power**: 5V via USB or external supply
+- **Power**: 5V via USB or external supply (battery-friendly)
 - **Communication**: I2C, WiFi, MQTT
+- **Status**: LED indicator for system status
 
 ## Schematics and Wiring
 
 ### Quick Reference Diagram
 ```
-ESP32 Weather Station Wiring
+Wemos D1 Mini Weather Station Wiring
 ┌─────────────────────────────────────┐
-│ ESP32        
+│ Wemos D1 Mini
 │ ┌─────┐ ┌─────┐ ┌─────┐ ┌─────┐   │
-│ │GPIO2│ │GPIO4│ │GPIO21│ │GPIO22│   │
+│ │ D5  │ │ D4  │ │ D1  │ │ D2  │   │
 │ │ LED │ │DHT11│ │ SDA │ │ SCL │   │
 │ └─────┘ └─────┘ └─────┘ └─────┘   │
 │ ┌─────┐ ┌─────┐                     │
-│ │GPIO34│ │GPIO35│                     │
+│ │ A0  │ │ D3  │                     │
 │ │Rain │ │ LDR │                     │
 │ └─────┘ └─────┘                     │
 └─────────────────────────────────────┘
 ```
 
 ### Complete Wiring Guide
-- **DHT11 Sensor**: Pin 4 (Data), 3.3V, GND
-- **BMP180 Sensor**: SDA→GPIO21, SCL→GPIO22, 3.3V, GND
-- **Rain Sensor**: AO→GPIO34, 3.3V, GND
-- **LDR**: GPIO35 with 10kΩ pull-down, 3.3V
-- **LED**: GPIO2 with 220Ω resistor, GND
-- **LCD Display**: SDA→GPIO21, SCL→GPIO22, 5V, GND
+- **DHT11 Sensor**: D4 (Data), 3.3V, GND
+- **BMP180 Sensor**: SDA→D1, SCL→D2, 3.3V, GND
+- **Rain Sensor**: AO→A0, 3.3V, GND
+- **LDR**: D3 with 10kΩ pull-down, 3.3V
+- **LED**: D5 with 220Ω resistor, GND
 
 ### Detailed Schematics
 For complete circuit diagrams, component layouts, and assembly instructions, see [schematics.md](schematics.md).
 
 ### Bill of Materials
-- ESP32 Development Board
+- Wemos D1 Mini Development Board
 - DHT11 Temperature & Humidity Sensor
 - BMP180 Pressure Sensor
 - Rain Sensor Module (analog)
 - LDR (Light Dependent Resistor)
-- 16x2 LCD Display with I2C Module
 - LED (5mm) + 220Ω resistor
 - 10kΩ resistor (for LDR)
 - Breadboard and jumper wires
 
+### Battery Operation
+For power analysis and battery operation guidelines, see [power_analysis.md](power_analysis.md).
+

+ 4 - 5
platformio.ini

@@ -1,12 +1,11 @@
-[env:esp32dev]
-platform = espressif32
-board = esp32dev
+[env:d1_mini]
+platform = espressif8266
+board = d1_mini
 framework = arduino
 monitor_speed = 115200
 
 lib_deps = 
     adafruit/DHT sensor library@^1.4.4
-    adafruit/LiquidCrystal I2C@^1.1.4
     sparkfun/BMP180 Breakout Library@^1.0.1
     knolleary/PubSubClient@^2.8
 
@@ -14,4 +13,4 @@ build_flags =
     -DCORE_DEBUG_LEVEL=3
 
 upload_speed = 921600
-monitor_filters = esp32_exception_decoder
+monitor_filters = esp8266_exception_decoder

+ 223 - 0
power_analysis.md

@@ -0,0 +1,223 @@
+# ESP32 Weather Station Power Analysis
+
+## Power Consumption Analysis
+
+### Component Power Requirements
+
+#### ESP32 Development Board
+- **Active Mode**: 160-260mA (typical 200mA)
+- **WiFi Transmission**: 200-250mA peaks
+- **Sleep Mode**: 10-150µA (deep sleep)
+- **Operating Voltage**: 3.3V
+- **Power**: ~0.66W (active), ~0.825W (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
+
+### Total Power Consumption
+
+#### Active Operation (WiFi + All Sensors)
+```
+ESP32 (active):        200mA
+WiFi transmission:     250mA (peaks)
+DHT11:                 1.5mA
+BMP180:                1mA
+Rain Sensor:           5mA
+LDR Circuit:           0.3mA
+LED:                   15mA
+---------------------------
+Total (typical):       ~473mA
+Total (peak):          ~523mA
+```
+
+#### Low Power Operation (WiFi Sleep)
+```
+ESP32 (modem sleep):    80mA
+DHT11 (standby):       0.04mA
+BMP180 (standby):      0.005mA
+Rain Sensor:           5mA
+LDR Circuit:           0.3mA
+LED (off):             0mA
+---------------------------
+Total:                 ~90mA
+```
+
+#### Deep Sleep Mode
+```
+ESP32 (deep sleep):     0.01mA
+DHT11 (standby):       0.04mA
+BMP180 (standby):      0.005mA
+Rain Sensor:           0mA (if powered down)
+LDR Circuit:           0mA
+LED (off):             0mA
+---------------------------
+Total:                 ~0.055mA
+```
+
+## 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**: 473mA @ 3.7V
+- **Battery Capacity**: 2500mAh
+- **Runtime**: 2500mAh ÷ 473mA = **5.3 hours**
+
+#### Scenario 2: Intermittent Operation (Normal Use)
+- **Active (30%)**: 473mA × 0.3 = 141.9mA average
+- **Low Power (70%)**: 90mA × 0.7 = 63mA average
+- **Total Average**: 204.9mA
+- **Runtime**: 2500mAh ÷ 204.9mA = **12.2 hours**
+
+#### Scenario 3: Deep Sleep Strategy
+- **Active (5%)**: 473mA × 0.05 = 23.65mA
+- **Deep Sleep (95%)**: 0.055mA × 0.95 = 0.052mA
+- **Total Average**: 23.7mA
+- **Runtime**: 2500mAh ÷ 23.7mA = **105 hours (4.4 days)**
+
+#### Scenario 4: Optimized Operation
+- **Active (10%)**: 473mA × 0.1 = 47.3mA
+- **Moderate Sleep (90%)**: 80mA × 0.9 = 72mA
+- **Total Average**: 119.3mA
+- **Runtime**: 2500mAh ÷ 119.3mA = **20.9 hours**
+
+## Power Management Recommendations
+
+### Voltage Regulation
+Since ESP32 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**: >600mA
+- **Recommended**: TP4056 with protection + 3.3V LDO or buck converter
+
+### Power Management Strategies
+
+#### 1. WiFi Sleep Mode
+```cpp
+// Enable WiFi sleep between transmissions
+WiFi.setSleep(true);
+```
+
+#### 2. Deep Sleep with Timer
+```cpp
+// Sleep for 5 minutes between readings
+esp_sleep_enable_timer_wakeup(5 * 60 * 1000000);
+esp_deep_sleep_start();
+```
+
+#### 3. Sensor Power Management
+```cpp
+// Power down sensors when not reading
+digitalWrite(SENSOR_POWER_PIN, LOW);
+```
+
+#### 4. LCD Backlight Control
+```cpp
+// Turn off backlight when not needed
+lcd.noBacklight();
+```
+
+### Battery Monitoring
+
+#### Voltage Monitoring
+```cpp
+// Monitor battery voltage
+float batteryVoltage = analogRead(BATTERY_PIN) * (3.3 / 4096.0) * 2.0; // Voltage divider
+if (batteryVoltage < 3.0) {
+  // Low battery warning
+}
+```
+
+#### Battery Percentage
+```cpp
+int batteryPercentage = map(batteryVoltage, 3.0, 4.2, 0, 100);
+```
+
+## Power Optimization Code
+
+### Optimized Loop Structure
+```cpp
+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
+```cpp
+// Power saving settings
+WiFi.setSleep(true);
+WiFi.setTxPower(WIFI_POWER_LOW);
+adc_set_cali_scheme(ADC_CALI_SCHEME_VER_CURVE);
+```
+
+## 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**: 3-4 days (5-minute readings)
+- **Aggressive**: 7-10 days (15-minute readings)
+- **Minimal**: 14+ days (30-minute readings)
+
+### Hardware Requirements:
+- 18650 battery (2500mAh+ recommended)
+- Battery holder with protection circuit
+- 3.3V buck converter (high efficiency)
+- Battery voltage divider for monitoring
+- Optional: Solar panel for charging
+
+## Conclusion
+
+**Yes, one 18650 can run this system**, but with important considerations:
+
+- **Continuous Operation**: ~5 hours (not practical)
+- **Optimized Operation**: 3-10 days (with deep sleep)
+- **Key Requirement**: Deep sleep implementation is essential
+- **Voltage Regulation**: Proper 3.3V regulation needed
+- **Battery Protection**: Prevent over-discharge below 3.0V
+
+For reliable long-term operation, implement deep sleep with periodic wake-up cycles for sensor readings.

+ 5 - 31
schematics.md

@@ -28,7 +28,7 @@ ESP32 Development Board
 └─────────┘   │                      │
               │                      │
               ▼                      ▼
-         Power Supply              LCD Display
+         Power Supply              Status LED
 ```
 
 ### Detailed Component Connections
@@ -93,23 +93,6 @@ LDR Circuit
                       GND
 ```
 
-#### 16x2 I2C LCD Display
-```
-LCD with I2C Module
-┌─────────────────────┐
-│ 16x2 LCD Display    │
-│                     │
-│ ┌─────────────────┐ │
-│ │   I2C Module   │ │
-│ │                 │ │
-│ │ GND ───────────┼─┼─── GND
-│ │ VCC ───────────┼─┼─── +5V
-│ │ SDA ───────────┼─┼─── GPIO21
-│ │ SCL ───────────┼─┼─── GPIO22
-│ └─────────────────┘ │
-└─────────────────────┘
-```
-
 #### LED Status Indicator
 ```
 LED Circuit
@@ -149,12 +132,6 @@ LED Circuit
                       │                   GPIO4
                       │                     │
                       │                     │
-                      │                   ┌─────┐
-                      │                   │ESP32│
-                      │                   │Board│
-                      │                   └─────┘
-                      │                     │
-                      │                     │
                       │                     │
                       │                     ▼
                       │                   GPIO21
@@ -223,8 +200,6 @@ LED Circuit
 Power Supply (USB 5V or External 5V)
 ┌─────────────────────────────────────┐
 │                                     │
-│  +5V ───────────────────────────────┼─── LCD VCC
-│                                     │
 │  +3.3V ──────────────────────────────┼─── DHT11 VCC
 │  (from ESP32 regulator)             │
 │                                     ├─── BMP180 VCC
@@ -244,13 +219,12 @@ Power Supply (USB 5V or External 5V)
 3. **BMP180 Pressure Sensor** - 1x
 4. **Rain Sensor Module** - 1x
 5. **LDR (Light Dependent Resistor)** - 1x
-6. **16x2 LCD Display with I2C Module** - 1x
-7. **LED (5mm, any color)** - 1x
-8. **Resistors**:
+6. **LED (5mm, any color)** - 1x
+7. **Resistors**:
    - 220Ω (for LED) - 1x
    - 10kΩ (for LDR pull-down) - 1x
-9. **Breadboard** - 1x
-10. **Jumper Wires** - Multiple
+8. **Breadboard** - 1x
+9. **Jumper Wires** - Multiple
 
 ### Optional Components
 - **External Power Supply** (5V, 1A) - For standalone operation

+ 248 - 0
solar_battery_system.md

@@ -0,0 +1,248 @@
+# Solar + 18650 Battery Power System
+
+## System Overview
+
+Complete solar-powered weather station with 18650 battery backup for continuous operation.
+
+## Power System Components
+
+### Battery System
+- **18650 Battery**: 2500-3500mAh, 3.7V
+- **Battery Holder**: 1x18650 with protection circuit
+- **TP4056 Charging Module**: USB charging with protection
+- **Battery Management System (BMS)**: Overcharge/discharge protection
+
+### Solar System
+- **Solar Panel**: 5V-6V, 1-2W (recommended 6V 2W)
+- **Solar Charge Controller**: TP4056 or dedicated solar controller
+- **Diode**: Schottky diode for reverse polarity protection
+- **Mounting**: Adjustable angle for optimal sun exposure
+
+### Power Regulation
+- **3.3V Buck Converter**: High efficiency (>90%)
+- **Voltage Divider**: For battery monitoring
+- **Power Switch**: Manual power control
+- **LED Indicators**: Charging status, battery level
+
+## Circuit Design
+
+### Solar Charging Circuit
+```
+Solar Panel (6V 2W)
+    │
+    ├───[Schottky Diode]───┐
+    │                      │
+    ▼                      ▼
+TP4056 Charging Module    18650 Battery
+    │                      │
+    ├───[Protection]──────┘
+    │
+    ▼
+3.3V Buck Converter
+    │
+    ▼
+Wemos D1 Mini + Sensors
+```
+
+### Battery Monitoring Circuit
+```
+Battery (3.0V-4.2V)
+    │
+    ├───[100kΩ]───┐
+    │             │
+    ▼             ▼
+   GND          A0 (Wemos)
+    │             │
+    └───[100kΩ]───┘
+```
+
+## Power Consumption Analysis
+
+### Wemos D1 Mini Power Requirements
+- **Active Mode**: 150mA @ 3.3V
+- **WiFi Transmission**: 200mA peaks
+- **Deep Sleep**: 0.02mA
+- **Sensors**: 10mA total
+- **Total Active**: ~160mA
+
+### Solar Panel Requirements
+- **Daily Energy Need**: 160mA × 24h = 3840mAh
+- **Solar Efficiency**: ~70% (cloudy days, angle)
+- **Required Solar**: 3840mAh ÷ 0.7 ÷ 6h = 914mAh
+- **Recommended Panel**: 6V 2W (333mA @ 6V)
+
+### Battery Runtime
+- **Battery Capacity**: 2500mAh
+- **Continuous Runtime**: 2500mAh ÷ 160mA = 15.6 hours
+- **With Solar**: Continuous operation
+- **Deep Sleep Runtime**: 2500mAh ÷ 0.02mA = 125,000 hours (~14 years)
+
+## Hardware Components
+
+### Required Parts
+1. **18650 Battery** (2500mAh+) - 1x
+2. **TP4056 Charging Module** - 1x
+3. **Solar Panel** (6V 2W) - 1x
+4. **3.3V Buck Converter** - 1x
+5. **Schottky Diode** (1N5817) - 1x
+6. **Resistors** (100kΩ × 2) - 2x
+7. **Battery Holder** (1x18650) - 1x
+8. **Power Switch** - 1x
+9. **LEDs** (red/green) - 2x
+10. **330Ω Resistors** (for LEDs) - 2x
+
+### Optional Parts
+- **Solar Charge Controller** (MPPT for better efficiency)
+- **Battery Level Indicator** (LED bar graph)
+- **Weatherproof Enclosure**
+- **Solar Panel Mount**
+
+## Assembly Instructions
+
+### Step 1: Battery System
+1. Connect 18650 to TP4056 module
+2. Verify protection circuit is working
+3. Test charging with USB power
+4. Check battery voltage (3.0V-4.2V range)
+
+### Step 2: Solar Integration
+1. Connect solar panel to TP4056 input
+2. Add Schottky diode for reverse protection
+3. Test solar charging in sunlight
+4. Verify charging LED operation
+
+### Step 3: Power Regulation
+1. Connect battery output to 3.3V buck converter
+2. Set output voltage to 3.3V
+3. Test with load (Wemos D1 Mini)
+4. Verify efficiency (>90%)
+
+### Step 4: Battery Monitoring
+1. Build voltage divider (100kΩ + 100kΩ)
+2. Connect to A0 pin
+3. Calibrate reading with known voltage
+4. Implement battery percentage calculation
+
+### Step 5: System Integration
+1. Connect all components
+2. Add power switch
+3. Add status LEDs
+4. Test complete system
+
+## Code Implementation
+
+### Battery Monitoring
+```cpp
+#define BATTERY_PIN A0
+#define BATTERY_VOLTAGE_DIVIDER 2.0
+
+float getBatteryVoltage() {
+  int adcValue = analogRead(BATTERY_PIN);
+  float voltage = adcValue * (3.3 / 1023.0) * BATTERY_VOLTAGE_DIVIDER;
+  return voltage;
+}
+
+int getBatteryPercentage() {
+  float voltage = getBatteryVoltage();
+  // Map 3.0V (0%) to 4.2V (100%)
+  int percentage = map(voltage * 100, 300, 420, 0, 100);
+  return constrain(percentage, 0, 100);
+}
+```
+
+### Power Management
+```cpp
+void managePower() {
+  int batteryLevel = getBatteryPercentage();
+  
+  // Low battery warning
+  if (batteryLevel < 20) {
+    // Enter deep sleep to conserve power
+    Serial.println("Low battery - entering deep sleep");
+    esp_sleep_enable_timer_wakeup(300000000); // 5 minutes
+    esp_deep_sleep_start();
+  }
+  
+  // Send battery status via MQTT
+  String batteryPayload = "{\"battery\":" + String(batteryLevel) + "}";
+  client.publish("weather/battery", batteryPayload.c_str());
+}
+```
+
+## Solar Panel Sizing
+
+### Location-Based Sizing
+| Location | Peak Sun Hours | Recommended Panel |
+|----------|----------------|-------------------|
+| Sunny    | 6+ hours       | 6V 1W            |
+| Moderate | 4-6 hours      | 6V 2W            |
+| Cloudy   | 2-4 hours      | 6V 3W            |
+
+### Panel Specifications
+- **Voltage**: 6V nominal (5V-7V operating)
+- **Current**: 167mA-500mA (1W-3W)
+- **Efficiency**: >17% (monocrystalline)
+- **Size**: 100mm x 70mm (1W) to 200mm x 140mm (3W)
+
+## Battery Management
+
+### Charging Stages
+1. **Bulk Charge**: Constant current until 4.2V
+2. **Absorption Charge**: Constant voltage at 4.2V
+3. **Float Charge**: Maintenance at 4.0V
+
+### Protection Features
+- **Overcharge Protection**: Cuts off at 4.2V
+- **Over-discharge Protection**: Cuts off at 2.5V
+- **Short Circuit Protection**: Current limiting
+- **Temperature Protection**: Thermal cutoff
+
+### Battery Life Optimization
+- **Depth of Discharge**: Keep above 20%
+- **Temperature**: Operate 0°C-45°C
+- **Charging**: Avoid overcharging
+- **Storage**: Charge to 40% for long-term storage
+
+## Expected Performance
+
+### Daily Operation
+- **Sunny Day**: Solar provides 100% of power needs
+- **Cloudy Day**: Battery supplements solar power
+- **Night Operation**: Battery provides 100% of power needs
+- **Continuous Operation**: 24/7 operation possible
+
+### Battery Life
+- **Cycle Life**: 500-1000 cycles (2-3 years)
+- **Calendar Life**: 3-5 years
+- **Self-Discharge**: <2% per month
+- **Temperature Impact**: High temperature reduces life
+
+## Troubleshooting
+
+### Common Issues
+- **No Charging**: Check solar panel connection and sunlight
+- **Low Battery**: Verify panel size and sun exposure
+- **System Resets**: Check power supply stability
+- **Inaccurate Reading**: Calibrate voltage divider
+
+### Testing Procedures
+1. **Solar Output**: Measure panel voltage in sunlight
+2. **Charging Current**: Measure current to battery
+3. **System Load**: Measure current draw
+4. **Battery Voltage**: Verify monitoring accuracy
+
+## Maintenance
+
+### Regular Checks
+- Clean solar panel surface
+- Check battery connections
+- Verify charging status
+- Monitor battery health
+
+### Seasonal Adjustments
+- Adjust panel angle for sun position
+- Increase panel size for winter months
+- Check for weather damage
+- Verify waterproofing
+
+This solar + battery system enables truly autonomous weather station operation with minimal maintenance requirements.

+ 282 - 0
solar_schematics.md

@@ -0,0 +1,282 @@
+# Solar + Battery Powered Weather Station Schematics
+
+## Complete System Overview
+
+```
+Solar Panel (6V 2W)
+    │
+    ├───[Schottky Diode 1N5817]───┐
+    │                            │
+    ▼                            ▼
+TP4056 Charging Module        18650 Battery
+    │                            │
+    ├───[Protection PCB]────────┘
+    │
+    ▼
+3.3V Buck Converter
+    │
+    ▼
+Wemos D1 Mini + Sensors
+```
+
+## Detailed Circuit Diagrams
+
+### Solar Charging Circuit
+```
+Solar Panel (6V 2W)
+┌─────────────────┐
+│ +               │
+│                 │
+│ -               │
+└─────┬───────────┘
+      │
+      ├───[1N5817 Schottky Diode]───┐
+      │                           │
+      ▼                           ▼
+┌─────────────────┐        ┌─────────────────┐
+│ IN+            │        │ +              │
+│ TP4056         │        │ 18650 Battery   │
+│ Charging       │        │ 3.7V 2500mAh   │
+│ Module         │        │                │
+│ OUT+           │        │ -              │
+└─────┬───────────┘        └─────────────────┘
+      │                           │
+      └───────────[Protection]────┘
+```
+
+### Battery Monitoring Circuit
+```
+18650 Battery (3.0V-4.2V)
+    │
+    ├───[100kΩ]───┐
+    │             │
+    ▼             ▼
+   GND          A0 (Wemos D1 Mini)
+    │             │
+    └───[100kΩ]───┘
+```
+
+### Power Distribution Circuit
+```
+Battery Output (3.0V-4.2V)
+    │
+    ▼
+┌─────────────────┐
+│ IN             │
+│ 3.3V Buck      │
+│ Converter      │
+│ OUT            │
+└─────┬───────────┘
+      │
+      ├───3.3V─────────────────────────────┐
+      │                                 │
+      ▼                                 ▼
+┌─────────────────┐              ┌─────────────────┐
+│ Wemos D1 Mini   │              │ Sensors         │
+│                 │              │                 │
+│ VCC             │              │ VCC             │
+└─────────────────┘              └─────────────────┘
+```
+
+## Complete Weather Station Wiring
+
+```
+Wemos D1 Mini Pin Layout
+┌─────────────────────────────────────┐
+│ D1 (SDA) ──────────────────────┐    │
+│ D2 (SCL) ──────────────────────┤    │
+│ D3 (LDR) ──────────────────────┤    │
+│ D4 (DHT11) ────────────────────┤    │
+│ D5 (LED) ──────────────────────┤    │
+│ A0 (Battery) ──────────────────┤    │
+│                                 │    │
+│ 3V3 ──────────────────────────┼────┤
+│ GND ───────────────────────────┼────┤
+└───────────────────────────────────┘    │
+                                      │
+┌─────────────────────────────────────┐
+│ Component Connections              │
+│                                   │
+│ BMP180 Sensor                      │
+│ ┌─────────────────┐               │
+│ │ VIN ───────────┼─ 3.3V         │
+│ │ GND ───────────┼─ GND          │
+│ │ SDA ───────────┼─ D1           │
+│ │ SCL ───────────┼─ D2           │
+│ └─────────────────┘               │
+│                                   │
+│ DHT11 Sensor                       │
+│ ┌─────────────────┐               │
+│ │ Pin 1 ─────────┼─ 3.3V         │
+│ │ Pin 2 ─────────┼─ D4           │
+│ │ Pin 4 ─────────┼─ GND          │
+│ └─────────────────┘               │
+│                                   │
+│ Rain Sensor                        │
+│ ┌─────────────────┐               │
+│ │ VCC ───────────┼─ 3.3V         │
+│ │ GND ───────────┼─ GND          │
+│ │ AO ────────────┼─ A0 (Conflict!) │
+│ └─────────────────┘               │
+│                                   │
+│ LDR Circuit                        │
+│ ┌─────────────────┐               │
+│ │ 3.3V ──────────┼─ 3.3V         │
+│ │     ┌───┐     │               │
+│ │     │LDR │     │               │
+│ │     └───┘     │               │
+│ │       │         │               │
+│ │     ┌───┐     │               │
+│ │     │10kΩ│     │               │
+│ │     └───┘     │               │
+│ │       │         │               │
+│ │       └─────────┼─ D3           │
+│ │                 │               │
+│ │ GND ───────────┼─ GND          │
+│ └─────────────────┘               │
+│                                   │
+│ LED Circuit                         │
+│ ┌─────────────────┐               │
+│ │ 3.3V ──────────┼─ 3.3V         │
+│ │     ┌───┐     │               │
+│ │     │220Ω│     │               │
+│ │     └───┘     │               │
+│ │       │         │               │
+│ │     ┌───┐     │               │
+│ │     │LED │     │               │
+│ │     └───┘     │               │
+│ │       │         │               │
+│ │       └─────────┼─ D5           │
+│ │                 │               │
+│ │ GND ───────────┼─ GND          │
+│ └─────────────────┘               │
+└─────────────────────────────────────┘
+```
+
+## Important Wiring Note
+
+**Pin Conflict Resolution:**
+The rain sensor and battery monitoring both need analog input (A0). Solutions:
+
+### Option 1: Priority to Battery Monitoring
+```
+Rain Sensor: Use digital output instead of analog
+- Connect rain sensor DO to D6 (if available)
+- Use digital threshold detection
+- A0 reserved for battery monitoring
+```
+
+### Option 2: Analog Multiplexing
+```
+Use CD4051 analog multiplexer
+- Connect multiple analog inputs to A0
+- Switch between battery and rain sensor
+- More complex but preserves both analog inputs
+```
+
+### Option 3: Separate Battery Monitoring
+```
+Use dedicated battery monitoring IC
+- MAX17043 or similar fuel gauge
+- I2C communication instead of analog
+- Frees up A0 for rain sensor
+```
+
+## Recommended Solution: Digital Rain Sensor
+
+```
+Rain Sensor Digital Configuration
+┌─────────────────┐
+│ Rain Sensor     │
+│ Module          │
+│                 │
+│ VCC ───────────┼─ 3.3V
+│ GND ───────────┼─ GND
+│ DO ────────────┼─ D6 (GPIO12)
+│ AO ────────────┼─ (Not used)
+└─────────────────┘
+```
+
+## Power Management Features
+
+### Battery Protection
+- Overcharge protection (4.2V cutoff)
+- Over-discharge protection (2.5V cutoff)
+- Short circuit protection
+- Temperature protection
+
+### Solar Charging
+- Maximum power point tracking (MPPT) optional
+- Reverse polarity protection
+- Charging status indicators
+
+### Power Optimization
+- Deep sleep capability
+- Battery level monitoring
+- Low power warnings
+- Automatic shutdown on critical battery level
+
+## Assembly Instructions
+
+### Step 1: Battery System
+1. Install 18650 in holder with protection circuit
+2. Connect to TP4056 charging module
+3. Test charging with USB power
+4. Verify protection circuit operation
+
+### Step 2: Solar Integration
+1. Connect solar panel to TP4056 input
+2. Install Schottky diode for reverse protection
+3. Test solar charging in direct sunlight
+4. Verify charging LED indicators
+
+### Step 3: Power Regulation
+1. Connect battery output to 3.3V buck converter
+2. Adjust output to 3.3V
+3. Test with full load (all sensors active)
+4. Verify efficiency (>90%)
+
+### Step 4: Battery Monitoring
+1. Build voltage divider (100kΩ + 100kΩ)
+2. Connect to A0 pin
+3. Calibrate with known voltage
+4. Test accuracy
+
+### Step 5: Weather Station Assembly
+1. Connect all sensors to Wemos D1 Mini
+2. Use digital rain sensor (D6) to free A0
+3. Connect power from buck converter
+4. Test complete system
+
+## Expected Performance
+
+### Solar Charging (6V 2W Panel)
+- **Peak Current**: ~333mA @ 6V
+- **Daily Energy**: ~2Wh (sunny day)
+- **Charging Time**: 4-6 hours (full charge)
+
+### Battery Runtime
+- **Active Mode**: ~15 hours (2500mAh ÷ 160mA)
+- **Deep Sleep**: ~125,000 hours (theoretical)
+- **Mixed Operation**: Several days with solar support
+
+### System autonomy
+- **Sunny Location**: 100% solar powered
+- **Cloudy Location**: Battery supplementation needed
+- **Night Operation**: Battery powered only
+
+## Troubleshooting
+
+### Common Issues
+- **No Charging**: Check solar panel orientation and connections
+- **Low Battery**: Insufficient solar panel size
+- **Inaccurate Reading**: Calibrate voltage divider
+- **System Resets**: Check power supply stability
+
+### Testing Procedures
+1. **Solar Output**: Measure voltage and current in sunlight
+2. **Charging Current**: Monitor battery charging rate
+3. **System Load**: Measure total current consumption
+4. **Battery Life**: Test runtime without solar input
+
+This solar-powered system enables truly autonomous weather station operation with minimal maintenance requirements.

+ 132 - 54
weatherstation.ino

@@ -1,18 +1,18 @@
 // -------- LIBRARIES --------
-#include <Wire.h>
-#include <LiquidCrystal_I2C.h>
 #include <WiFi.h>
 #include <PubSubClient.h>
 #include <DHT.h>
 #include <SFE_BMP180.h>
-// -------- PIN DEFINITIONS --------
-#define DHTPIN 4
+// -------- PIN DEFINITIONS (WEMOS D1 MINI) --------
+#define DHTPIN D4
 #define DHTTYPE DHT11
-#define LDR_PIN 35 // input only pin (good choice)
-#define RAIN_PIN 34 // analog pin
-#define LED_PIN 2
+#define LDR_PIN D3 // digital pin
+#define RAIN_PIN A0 // analog pin (only analog input)
+#define LED_PIN D5
+// I2C Pins
+#define I2C_SDA D1
+#define I2C_SCL D2
 // -------- OBJECTS --------
-LiquidCrystal_I2C lcd(0x27, 16, 2);
 DHT dht(DHTPIN, DHTTYPE);
 SFE_BMP180 bmp;
 WiFiClient espClient;
@@ -29,6 +29,16 @@ unsigned long lastSensorRead = 0;
 const long sensorInterval = 2000; // Read sensors every 2 seconds
 unsigned long lastMQTTSend = 0;
 const long mqttInterval = 30000; // Send data every 30 seconds
+// Wemos D1 Mini specific
+int ldrThreshold = 500; // Digital LDR threshold
+// Battery monitoring
+#define BATTERY_PIN A0
+#define BATTERY_VOLTAGE_DIVIDER 2.0
+#define RAIN_DIGITAL_PIN D6  // Digital rain sensor pin
+unsigned long lastBatteryCheck = 0;
+const long batteryCheckInterval = 60000; // Check battery every minute
+int batteryLevel = 100;
+float batteryVoltage = 0.0;
 
 struct WeatherData {
   float temperature;
@@ -39,6 +49,15 @@ struct WeatherData {
   bool valid;
 };
 
+struct BatteryData {
+  float voltage;
+  int percentage;
+  bool charging;
+  bool lowBattery;
+};
+
+BatteryData batteryData;
+
 WeatherData currentData;
 // -------- FUNCTIONS --------
 // DHT SENSOR
@@ -53,12 +72,16 @@ void readDHT() {
   currentData.temperature = t;
   currentData.humidity = h;
 }
-// RAIN SENSOR
+// RAIN SENSOR (Digital for Wemos D1 Mini)
 void readRain() {
-  int value = analogRead(RAIN_PIN);
-  value = map(value, 0, 4095, 0, 100);
-  value = 100 - value;
-  currentData.rainLevel = value;
+  // Use digital rain sensor to free A0 for battery monitoring
+  int value = digitalRead(RAIN_DIGITAL_PIN);
+  // Convert digital to percentage (simplified)
+  if (value == HIGH) {
+    currentData.rainLevel = 0; // No rain (digital HIGH)
+  } else {
+    currentData.rainLevel = 80; // Rain detected (digital LOW)
+  }
 }
 // PRESSURE SENSOR
 void readPressure() {
@@ -77,12 +100,42 @@ void readPressure() {
     currentData.valid = false;
   }
 }
-// LDR SENSOR
+// LDR SENSOR (Digital for Wemos D1 Mini)
 void readLDR() {
+  // For Wemos D1 Mini, we'll use digital reading with threshold
+  // You could also use analog reading on A0, but it's used by rain sensor
   int value = digitalRead(LDR_PIN);
   currentData.lightDetected = (value == HIGH);
   digitalWrite(LED_PIN, currentData.lightDetected ? HIGH : LOW);
 }
+
+// BATTERY MONITORING
+void readBattery() {
+  // Read battery voltage through voltage divider
+  int adcValue = analogRead(BATTERY_PIN);
+  batteryVoltage = adcValue * (3.3 / 1023.0) * BATTERY_VOLTAGE_DIVIDER;
+  
+  // Calculate battery percentage (3.0V = 0%, 4.2V = 100%)
+  batteryLevel = map(batteryVoltage * 100, 300, 420, 0, 100);
+  batteryLevel = constrain(batteryLevel, 0, 100);
+  
+  // Update battery data structure
+  batteryData.voltage = batteryVoltage;
+  batteryData.percentage = batteryLevel;
+  batteryData.lowBattery = (batteryLevel < 20);
+  
+  // Detect charging (voltage > 4.0V indicates charging)
+  batteryData.charging = (batteryVoltage > 4.0);
+  
+  Serial.print("Battery: ");
+  Serial.print(batteryVoltage, 2);
+  Serial.print("V (");
+  Serial.print(batteryLevel);
+  Serial.print("%) ");
+  if (batteryData.charging) Serial.print("Charging");
+  if (batteryData.lowBattery) Serial.print(" LOW BATTERY!");
+  Serial.println();
+}
 // READ ALL SENSORS
 void readSensors() {
   currentData.valid = true;
@@ -104,37 +157,49 @@ void readSensors() {
     Serial.println(currentData.lightDetected ? "YES" : "NO");
   }
 }
-// UPDATE LCD DISPLAY
-void updateDisplay() {
+// STATUS INDICATION
+void updateStatus() {
   if (!currentData.valid) {
-    lcd.setCursor(0, 0);
-    lcd.print("Sensor Error! ");
-    lcd.setCursor(0, 1);
-    lcd.print("Check wiring ");
-    return;
+    // Blink LED rapidly for sensor error
+    digitalWrite(LED_PIN, HIGH);
+    delay(100);
+    digitalWrite(LED_PIN, LOW);
+    delay(100);
+    digitalWrite(LED_PIN, HIGH);
+    delay(100);
+    digitalWrite(LED_PIN, LOW);
+  } else if (batteryData.lowBattery) {
+    // Blink LED slowly for low battery warning
+    digitalWrite(LED_PIN, HIGH);
+    delay(500);
+    digitalWrite(LED_PIN, LOW);
+    delay(500);
+  } else {
+    // LED indicates light detection status
+    digitalWrite(LED_PIN, currentData.lightDetected ? HIGH : LOW);
+  }
+}
+
+// POWER MANAGEMENT
+void managePower() {
+  if (batteryData.lowBattery) {
+    Serial.println("WARNING: Low battery - consider deep sleep");
+    
+    // Optional: Enter deep sleep to conserve power
+    // Uncomment below lines for automatic deep sleep on low battery
+    /*
+    Serial.println("Entering deep sleep due to low battery");
+    ESP.deepSleep(300000000); // 5 minutes
+    */
   }
   
-  // Display temperature and humidity on first line
-  lcd.setCursor(0, 0);
-  lcd.print("T:");
-  lcd.print(currentData.temperature, 1);
-  lcd.print("C H:");
-  lcd.print(currentData.humidity, 0);
-  lcd.print("%");
-  
-  // Display rain and pressure on second line
-  lcd.setCursor(0, 1);
-  lcd.print("R:");
-  lcd.print(currentData.rainLevel);
-  lcd.print("% P:");
-  lcd.print(currentData.pressure, 0);
-  lcd.print(" ");
+  if (batteryData.charging) {
+    Serial.println("Battery charging - solar power active");
+  }
 }
 // SETUP WIFI
 void setupWiFi() {
   Serial.println("Connecting to WiFi...");
-  lcd.setCursor(0, 0);
-  lcd.print("WiFi connecting");
   
   WiFi.begin(ssid, password);
   
@@ -149,12 +214,8 @@ void setupWiFi() {
     Serial.println("\nWiFi connected");
     Serial.println("IP address: ");
     Serial.println(WiFi.localIP());
-    lcd.setCursor(0, 0);
-    lcd.print("WiFi connected ");
   } else {
     Serial.println("Failed to connect to WiFi");
-    lcd.setCursor(0, 0);
-    lcd.print("WiFi failed! ");
   }
   
   delay(2000);
@@ -188,7 +249,10 @@ void sendMQTTData() {
   payload += "\"humidity\":" + String(currentData.humidity, 2) + ",";
   payload += "\"pressure\":" + String(currentData.pressure, 2) + ",";
   payload += "\"rainLevel\":" + String(currentData.rainLevel) + ",";
-  payload += "\"lightDetected\":" + String(currentData.lightDetected ? "true" : "false");
+  payload += "\"lightDetected\":" + String(currentData.lightDetected ? "true" : "false") + ",";
+  payload += "\"battery\":" + String(batteryData.percentage) + ",";
+  payload += "\"batteryVoltage\":" + String(batteryData.voltage, 2) + ",";
+  payload += "\"charging\":" + String(batteryData.charging ? "true" : "false");
   payload += "}";
   
   if (client.publish(mqtt_topic, payload.c_str())) {
@@ -196,6 +260,16 @@ void sendMQTTData() {
   } else {
     Serial.println("Failed to send MQTT data");
   }
+  
+  // Also send battery status separately
+  String batteryPayload = "{";
+  batteryPayload += "\"percentage\":" + String(batteryData.percentage) + ",";
+  batteryPayload += "\"voltage\":" + String(batteryData.voltage, 2) + ",";
+  batteryPayload += "\"charging\":" + String(batteryData.charging ? "true" : "false") + ",";
+  batteryPayload += "\"lowBattery\":" + String(batteryData.lowBattery ? "true" : "false");
+  batteryPayload += "}";
+  
+  client.publish("weather/battery", batteryPayload.c_str());
 }
 // -------- SETUP --------
 void setup() {
@@ -203,14 +277,12 @@ void setup() {
   
   // Initialize pins
   pinMode(LDR_PIN, INPUT);
-  pinMode(RAIN_PIN, INPUT);
+  pinMode(RAIN_DIGITAL_PIN, INPUT);
   pinMode(LED_PIN, OUTPUT);
   digitalWrite(LED_PIN, LOW);
   
-  // Initialize I2C and sensors
-  Wire.begin(21, 22); // SDA, SCL
-  lcd.init();
-  lcd.backlight();
+  // Initialize I2C and sensors (Wemos D1 Mini pins)
+  Wire.begin(I2C_SDA, I2C_SCL); // D1, D2
   dht.begin();
   
   if (!bmp.begin()) {
@@ -225,12 +297,11 @@ void setup() {
   
   // Initial sensor reading
   readSensors();
-  updateDisplay();
+  readBattery();
+  updateStatus();
+  managePower();
   
-  lcd.setCursor(0, 0);
-  lcd.print("System Ready");
-  delay(2000);
-  lcd.clear();
+  Serial.println("Weather Station Ready (Wemos D1 Mini + Solar + Battery)");
 }
 // -------- LOOP --------
 void loop() {
@@ -246,7 +317,14 @@ void loop() {
   if (currentMillis - lastSensorRead >= sensorInterval) {
     lastSensorRead = currentMillis;
     readSensors();
-    updateDisplay();
+    updateStatus();
+  }
+  
+  // Check battery status every minute
+  if (currentMillis - lastBatteryCheck >= batteryCheckInterval) {
+    lastBatteryCheck = currentMillis;
+    readBattery();
+    managePower();
   }
   
   // Send MQTT data at regular interval

+ 106 - 0
wemos_d1mini_analysis.md

@@ -0,0 +1,106 @@
+# Wemos D1 Mini Compatibility Analysis
+
+## Wemos D1 Mini vs ESP32 Comparison
+
+### Wemos D1 Mini Specifications
+- **Microcontroller**: ESP8266 (ESP-12E)
+- **CPU**: Tensilica L106 32-bit RISC processor
+- **Clock Speed**: 80-160MHz
+- **Memory**: 80KB SRAM, 4MB Flash
+- **Wireless**: WiFi 802.11 b/g/n
+- **GPIO**: 11 pins available
+- **ADC**: 10-bit, single channel (A0)
+- **I2C**: Hardware I2C on pins D1, D2
+- **Power**: 3.3V logic, 5V input via USB
+
+### ESP32 vs Wemos D1 Mini
+
+| Feature | ESP32 | Wemos D1 Mini |
+|---------|-------|---------------|
+| **CPU** | Dual Core 240MHz | Single Core 80-160MHz |
+| **Memory** | 520KB SRAM | 80KB SRAM |
+| **ADC** | Multiple channels, 12-bit | Single channel (A0), 10-bit |
+| **GPIO** | 36+ pins | 11 pins |
+| **Power** | Lower consumption | Higher consumption |
+| **Size** | Larger | Compact (11.5mm x 34mm) |
+| **Cost** | Higher | Lower |
+
+## Compatibility Analysis
+
+### ✅ Compatible Features
+- **WiFi Connectivity**: Both support WiFi
+- **I2C Communication**: Both have hardware I2C
+- **Digital GPIO**: Both support digital I/O
+- **MQTT Client**: Both can run PubSubClient
+- **DHT11 Sensor**: Compatible (digital pin)
+- **BMP180 Sensor**: Compatible (I2C)
+- **LED Status**: Compatible (digital pin)
+
+### ⚠️ Limited Features
+- **Analog Inputs**: Only 1 analog pin (A0) vs multiple on ESP32
+- **Processing Power**: Lower performance for complex operations
+- **Memory**: Less SRAM may limit complex operations
+
+### ❌ Incompatible Features
+- **LDR on GPIO35**: ESP32 has input-only pins, Wemos D1 Mini doesn't
+- **Rain Sensor on GPIO34**: Need to use A0 or digital pins
+
+## Required Modifications
+
+### Pin Mapping Changes
+```
+ESP32 → Wemos D1 Mini
+---------------------
+DHT11 (GPIO4) → D4 (GPIO2)
+LDR (GPIO35) → D3 (GPIO0) - Digital
+Rain Sensor (GPIO34) → A0 (Analog only)
+LED (GPIO2) → D5 (GPIO14)
+I2C SDA (GPIO21) → D1 (GPIO5)
+I2C SCL (GPIO22) → D2 (GPIO4)
+```
+
+### Code Changes Required
+1. Update pin definitions
+2. Change analog reading for rain sensor
+3. Adjust for single ADC channel
+4. Update platformio.ini configuration
+5. Consider memory limitations
+
+## Power Consumption Comparison
+
+### Wemos D1 Mini Power Requirements
+- **Active Mode**: 70-200mA (typical 150mA)
+- **WiFi Transmission**: 150-200mA peaks
+- **Deep Sleep**: 10-20µA
+- **Operating Voltage**: 3.3V
+
+### Battery Runtime with 18650
+- **Continuous Active**: 2500mAh ÷ 150mA = **16.7 hours**
+- **Optimized Operation**: **25-30 hours**
+- **Deep Sleep Strategy**: **7-10 days**
+
+## Recommendation
+
+**Yes, the Wemos D1 Mini can be used**, but with some limitations:
+
+### Advantages
+- **Lower Cost**: Significantly cheaper than ESP32
+- **Compact Size**: Much smaller footprint
+- **Lower Power**: Better battery life in active mode
+- **Sufficient Performance**: Adequate for weather station tasks
+
+### Limitations
+- **Single Analog Input**: Can only read one analog sensor
+- **Less Memory**: May limit future expansions
+- **Lower Processing**: Slower response times
+- **Fewer GPIO**: Less expansion capability
+
+### Implementation Strategy
+1. **Use digital LDR** instead of analog
+2. **Prioritize rain sensor** on A0
+3. **Optimize code** for smaller memory footprint
+4. **Consider deep sleep** for battery operation
+
+## Conclusion
+
+The Wemos D1 Mini is a viable alternative for the weather station with proper modifications. It offers better battery life and lower cost, but requires careful pin planning and code optimization.