# ESP32 Weather Station Schematics ## Wiring Diagram ### ESP32 Pin Connections ``` ESP32 Development Board ┌─────────────────────────────────────┐ │ │ │ 3V3 ──┐ │ │ GND ──┼───┐ │ │ GPIO2 ──┘ │ │ │ │ │ │ GPIO4 ──────┼─── DHT11 Sensor │ │ │ ┌─────┐ │ │ GPIO21 ─────┼───│ SDA │ │ │ │ │ │ │ │ GPIO22 ─────┼───│ SCL │ │ │ │ └─────┘ │ │ GPIO34 ─────┼─── Rain Sensor │ │ │ │ │ GPIO35 ─────┼─── LDR │ │ │ │ VIN ──┐ │ │ GND ──┼───┐ │ │ │ │ │ └─────────┘ │ │ │ │ ▼ ▼ Power Supply Status LED ``` ### Detailed Component Connections #### DHT11 Temperature & Humidity Sensor ``` DHT11 Sensor ┌───────┐ │ 1 │─── +3.3V │ 2 │─── GPIO4 (Data) │ 3 │─── (Not Connected) │ 4 │─── GND └───────┘ Pinout (front view): ┌─────────┐ │ • • • │ ← Pins 1-4 └─────────┘ ``` #### BMP180 Pressure Sensor (I2C) ``` BMP180 Sensor ┌─────────────┐ │ VIN ─────┼─── +3.3V │ GND ─────┼─── GND │ SDA ─────┼─── GPIO21 │ SCL ─────┼─── GPIO22 └─────────────┘ ``` #### Rain Sensor Module ``` Rain Sensor Module ┌─────────────┐ │ VCC ───────┼─── +3.3V │ GND ───────┼─── GND │ AO ───────┼─── GPIO34 (Analog) │ DO ───────┼─── (Not Connected) └─────────────┘ ``` #### LDR (Light Dependent Resistor) ``` LDR Circuit ┌─────────┐ ┌─────────┐ │ 3.3V │ │ │ │ │ │ LDR │ │ ┌─────┼────┼─────┐ │ │ │ │ │ │ │ │ ▼ │ │ ▼ │ │ 10kΩ │ │ │ │ Resistor│ │ │ │ │ │ │ │ │ └─────┼────┼─────┐ │ │ │ │ │ │ │ GND │ │ │ │ └─────────┘ │ GPIO35│ │ │ │ │ └───────┼───┘ │ GND ``` #### LED Status Indicator ``` LED Circuit ┌─────┐ ┌─────────┐ │3.3V │ │ │ │ │ │ LED │ │ ┌───┼────┼─────┐ │ │ │ │ │ │ │ │ ▼ │ │ ▼ │ │220Ω │ │ │ │Res │ │ │ │ │ │ │ │ │ └───┼────┼─────┐ │ │ │ │ │ │ │GPIO2│ │ │ │ └─────┼────┼─────┼───┘ │ │ │ └────┼─────┘ │ GND ``` ## Complete Circuit Schematic ``` +3.3V │ ├───────────────────┐ │ │ │ ▼ │ ┌─────────┐ │ │ DHT11 │ │ │ Sensor │ │ └─────┬───┘ │ │ │ ▼ │ GPIO4 │ │ │ │ │ │ │ ▼ │ GPIO21 │ │ │ ▼ │ ┌─────────┐ │ │ BMP180 │ │ │ Sensor │ │ └─────┬───┘ │ │ │ ▼ │ GPIO22 │ │ │ │ │ │ │ ▼ │ GPIO34 │ │ │ ▼ │ ┌─────────┐ │ │ Rain │ │ │ Sensor │ │ └─────┬───┘ │ │ │ │ │ │ │ │ │ ▼ │ GPIO35 │ │ │ ▼ │ ┌─────────┐ │ │ LDR │ │ │ Circuit │ │ └─────┬───┘ │ │ │ │ │ │ │ ▼ │ GPIO2 │ │ │ ▼ │ ┌─────────┐ │ │ LED │ │ │ Circuit │ │ └─────┬───┘ │ │ │ │ │ ▼ │ ┌─────────┐ │ │ LCD │ │ │Display │ │ │ (I2C) │ │ └─────┬───┘ │ │ │ │ │ ▼ │ ┌─────────┐ └───────────────────┤ GND │ └─────────┘ ``` ## Power Distribution ``` Power Supply (USB 5V or External 5V) ┌─────────────────────────────────────┐ │ │ │ +3.3V ──────────────────────────────┼─── DHT11 VCC │ (from ESP32 regulator) │ │ ├─── BMP180 VCC │ ├─── Rain Sensor VCC │ └─── LDR Circuit VCC │ │ │ GND ────────────────────────────────┼─── All GND connections │ │ └─────────────────────────────────────┘ ``` ## Bill of Materials ### Components Required 1. **ESP32 Development Board** - 1x 2. **DHT11 Temperature & Humidity Sensor** - 1x 3. **BMP180 Pressure Sensor** - 1x 4. **Rain Sensor Module** - 1x 5. **LDR (Light Dependent Resistor)** - 1x 6. **LED (5mm, any color)** - 1x 7. **Resistors**: - 220Ω (for LED) - 1x - 10kΩ (for LDR pull-down) - 1x 8. **Breadboard** - 1x 9. **Jumper Wires** - Multiple ### Optional Components - **External Power Supply** (5V, 1A) - For standalone operation - **Project Enclosure** - For protection - **PCB** - For permanent installation ## Assembly Instructions ### Step 1: Power Connections 1. Connect ESP32 to USB power 2. Verify 3.3V output from ESP32 3. Connect all VCC pins to appropriate power sources ### Step 2: I2C Bus Setup 1. Connect GPIO21 to all SDA pins 2. Connect GPIO22 to all SCL pins 3. Add pull-up resistors if needed (usually built-in to modules) ### Step 3: Digital Sensors 1. Connect DHT11 data pin to GPIO4 2. Connect LED circuit to GPIO2 3. Connect LDR circuit to GPIO35 ### Step 4: Analog Sensors 1. Connect rain sensor analog output to GPIO34 2. Ensure proper grounding for analog circuits ### Step 5: Testing 1. Test each sensor individually 2. Verify LCD display operation 3. Check MQTT connectivity 4. Validate complete system operation ## Troubleshooting Guide ### Common Issues - **I2C Communication**: Check SDA/SCL connections and addresses - **Power Issues**: Verify voltage levels and current capacity - **Sensor Readings**: Check pin assignments and wiring - **LCD Display**: Verify I2C address (usually 0x27) ### Measurement Points - **3.3V Rail**: Should be stable at 3.3V - **I2C Signals**: Should show clear clock and data transitions - **Analog Inputs**: Should vary with sensor changes - **Digital Inputs**: Should show clear HIGH/LOW states