This guide will help you get your ESP32 Weather Station up and running in minutes.
Before you begin, make sure you have:
- ESP32 development board
- BME280 sensor
- SCD30 CO2 sensor
- Breadboard and jumper wires
- USB cable for ESP32
- Computer with Visual Studio Code installed
-
Download and install Visual Studio Code
- Visit: https://code.visualstudio.com/
- Download for your operating system
- Install and launch VS Code
-
Install PlatformIO Extension
- Open VS Code
- Click the Extensions icon (or press
Ctrl+Shift+X) - Search for "PlatformIO IDE"
- Click "Install" on the official PlatformIO IDE extension
- Wait for installation to complete (may take a few minutes)
- Restart VS Code if prompted
- Wire the sensors according to this diagram:
ESP32 BME280/SCD30
----- ------------
3.3V --> VCC
GND --> GND
GPIO21 --> SDA
GPIO22 --> SCL
- Connect ESP32 to computer via USB cable
See HARDWARE.md for detailed wiring diagrams and troubleshooting.
-
Clone or download this repository
git clone https://github.com/rflulling/WeatherStation_EmergencyData.git
-
Open in VS Code
- Launch VS Code
- Click "File" → "Open Folder"
- Navigate to the
WeatherStation_EmergencyDatafolder - Click "Select Folder"
-
Wait for PlatformIO to initialize
- PlatformIO will automatically detect the project
- Wait for "PlatformIO: Home" to appear in the bottom status bar
-
Build the project
- Click the checkmark (✓) icon in the bottom status bar
- Or press
Ctrl+Alt+B - Wait for build to complete (first build downloads libraries, may take 5-10 minutes)
-
Upload to ESP32
- Click the right arrow (→) icon in the bottom status bar
- Or press
Ctrl+Alt+U - Wait for upload to complete
-
Open Serial Monitor
- Click the plug icon in the bottom status bar
- Or press
Ctrl+Alt+S - You should see sensor readings every 5 seconds!
Once running, the Serial Monitor will display:
========================================
WEATHER STATION - EMERGENCY DATA
========================================
--- Environmental Conditions ---
Temperature: 23.5 °C
Humidity: 45.2 %
Pressure: 1013.2 hPa
Altitude: 100.5 m
Status: Normal Pressure - Stable Conditions
--- Air Quality ---
CO2: 450 ppm
Status: CO2 Normal
========================================
Problem: Serial Monitor shows "No sensors detected!"
Solutions:
- Check all wiring connections
- Verify sensors are powered (LED on sensor boards should be lit)
- Try one sensor at a time to isolate the issue
- Use an I2C scanner sketch to verify addresses
Problem: Cannot upload code to ESP32
Solutions:
- Check USB cable (must be data cable, not charging-only)
- Install CH340/CP2102 USB drivers if needed
- Try a different USB port
- Hold the BOOT button during upload
- Check Device Manager (Windows) or
ls /dev/tty*(Linux/Mac) for port
Problem: Build fails with library errors
Solutions:
- Delete
.piofolder in project directory - Click PlatformIO icon → Project Tasks → Clean
- Rebuild the project
- Check internet connection (needed to download libraries)
Problem: Sensor readings seem wrong
Solutions:
- Give sensors 5-10 minutes to stabilize after power-on
- Ensure sensors are not near heat sources
- For altitude: Adjust
SEALEVEL_PRESSURE_HPAin code to your local sea level pressure - For CO2: SCD30 needs several hours to calibrate initially
- Data Logging: Add SD card module to log data over time
- Display: Add OLED display for standalone operation
- WiFi: Enable remote monitoring via web interface
- Alerts: Add buzzer or LED for threshold warnings
- Power: Add battery for portable operation
- Check
README.mdfor detailed documentation - Review
HARDWARE.mdfor wiring help - Check PlatformIO forums: https://community.platformio.org/
- Open an issue on GitHub if you find bugs
-
CO2 Levels:
- < 1000 ppm: Normal, safe air
- 1000-2000 ppm: Ventilate the area
- > 2000 ppm: Dangerous, evacuate immediately
-
Pressure Changes:
- Rapid pressure drops may indicate severe weather
- Track trends over hours/days for best results
-
Emergency Use:
- This device is for informational purposes
- Do not rely solely on this device for life-safety decisions
- Always follow official emergency guidance
Enjoy your weather station! 🌤️📊