IntermediateSensors and IoT
ESP32 Wi-Fi Weather Station
Read temperature, humidity, and pressure with a BME280, then serve a small live dashboard from the ESP32.
Parts from the database
- ESP32-WROOM-32 Ć 1Use on a development board
- BME280 Ć 1Temperature, humidity, and pressure sensor
- SSD1306 Ć 1Optional small OLED display controller
Other supplies
- ESP32 development boardCommon build supply
- BME280 breakout explicitly marked 3.3 V compatibleCommon build supply
- USB power supplyCommon build supply
- jumper wiresCommon build supply
- optional SSD1306 OLED breakoutCommon build supply
Amazon links may be affiliate links. As an Amazon Associate, Electronics Hobby Hub earns from qualifying purchases.
Connections
- BME280 VIN to 3V3, GND to GND, SDA to GPIO 21 and SCL to GPIO 22 on a classic ESP32 DevKit.
- If using SSD1306 too, connect its SDA/SCL to the same bus; verify the two devices have different I²C addresses.
- Do not connect 5 V pull-ups to ESP32 I/O.
Build steps
- Install Adafruit BME280 and Unified Sensor libraries; test the sensor example over USB first.
- Set the sensor address (usually 0x76 or 0x77) based on the breakout's SDO jumper.
- Add Wi-Fi credentials locally in the sketch and start the ESP32 web server.
- Open the displayed local IP address on a device on the same network; refresh and compare with the serial output.
Software and firmware setup
Firmware is required, but a complete combined web-server sketch is not included yet. Bring up the BME280 readout on the ESP32 first, then add a local web-server handler that reports the latest readings. Keep Wi-Fi credentials in a local, uncommitted copy of the sketch.
Test your build
The page should show live sensor readings and refresh without requiring a cloud account. Expect indoor pressure/weather trends, not a certified forecast.
Troubleshooting
- If begin() fails, try address 0x76 then 0x77 and check the module label.
- If the ESP32 never joins Wi-Fi, verify 2.4 GHz network support and the SSID/password.
- If the browser cannot load the page, confirm the phone/computer is on the same local network.
Safety and limitations
Use a 3.3 V-compatible sensor breakout and keep Wi-Fi credentials out of public source code. Do not treat hobby readings as weather warnings.
Manufacturer and platform documentation
Community Notes for This Project
These are unverified visitor contributions, separate from the build guide and manufacturer specifications. Verify technical advice against the linked datasheets before relying on it.
Set up the comments service to load community notes.