Fall ResetAmazon USFall reset deals: check better picks before checkoutAmazon US: today's deals, useful picks and quick comparisons.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanFall ResetAmazon USWork and home upgrades are worth comparing todayAmazon US: today's deals, useful picks and quick comparisons.See Picks×
Skip to content
Blog

Build an ESP32 Weather Station with Forecasts, Sensors and Air Quality

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

An ESP32 weather station can combine local temperature, humidity and pressure readings with an internet forecast and particulate measurements. Build it as a modular system: sensors report conditions where the device sits, a weather service supplies the forecast, and an air-quality sensor measures a specific pollutant. Those are different data sources, so label them separately. For a dependable first build, use an ESP32, a BME280, a PMS5003-class particle sensor, and a display or local dashboard. An outdoor installation also needs a ventilated radiation shield and a power plan—not just a weatherproof box.

What the station measures—and what it does not

The ESP32 is the controller and Wi-Fi connection, not a weather sensor. A BME280 measures local temperature, relative humidity and barometric pressure. A particulate sensor measures particles in its airflow. An internet API supplies model-based forecast data for a selected location. Keep those readings distinct on the display: a forecast is not a measurement made at the station, and a pressure trend is not a multi-day forecast.

A BME280 is a practical baseline for local conditions. Bosch specifies I²C and SPI interfaces, a pressure range of 300–1100 hPa, an operating temperature range of −40 to 85 °C, and typical relative-humidity accuracy of ±3% under specified conditions. Those are sensor specifications, not a guarantee for a breakout board mounted beside a warm ESP32 in a sunlit enclosure. See Bosch’s BME280 product information and data sheet.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A BME280 pressure trend can be shown as a rough local indicator, but the ESP32 should retrieve a forecast from a weather service rather than claim to predict tomorrow from its own readings. OpenWeather offers weather, forecast, geocoding, air-pollution and station-upload products; Open-Meteo is another option. Check the provider’s current endpoint, terms and limits before building around it.

#1 Best Overall
LAFVIN Basic Starter Kit for ESP32 ESP-32S WiFi IoT Development Board with Tutorial Compatible with Arduino IDE
  • Perfect choice for beginners to learn, electronics and program.
  • The Basic Starter Kit is easy to use and you can learn to program at an introductory level.
  • You can use ESP32 modules to control other modules, such as LED,DHT11,OLED module, etc
  • The tutorial include codes and lessons.It will teach every users how to assembly Basic Starter Kit for ESP32.
  • Please download our tutorial and learn after you receive the goods.

Choose a build for its location and purpose

Build Typical components Best suited to Main trade-off
Indoor starter ESP32 development board, BME280, OLED, USB supply Learning, local readings and a compact forecast display No direct particle or CO₂ measurement unless those sensors are added
Balanced station ESP32, BME280, PMS5003-class particle sensor, display, ventilated housing Local weather readings plus particulate measurements The particle sensor needs airflow and can dominate battery use
Outdoor station Balanced build plus radiation shield, protected airflow path, cable glands and planned power Continuous outdoor observation Shielding, condensation control and sensor placement require careful construction
Ventilation monitor ESP32, BME280 and an NDIR CO₂ sensor Indoor ventilation monitoring CO₂ is a separate measurement from particles or VOCs

Optional additions include a tipping-bucket rain gauge, wind speed and direction sensors, UV or light sensing, microSD logging, MQTT, or a home-automation dashboard. Add them to meet a specific need; each adds wiring, power draw, calibration or software failure modes.

Pick an air sensor that answers the right question

Particles: PMS5003-class sensor

A PMS5003-class optical sensor is a straightforward way to add PM1.0-, PM2.5- and PM10-related readings. It uses UART and needs air to pass through its sensing chamber. These are particulate measurements, not automatically a regulatory-grade result or an official AQI. Verify the exact sensor or carrier-board documentation for its supply voltage, logic levels, connector pinout, UART framing, warm-up and sleep behavior; modules and breakout boards are not necessarily interchangeable. A manual reference is available from the South Coast Air Quality Management District.

Use a hardware UART if possible. Parse complete frames, check the checksum, reject invalid data, allow warm-up before publishing readings, and keep the inlet and outlet clear. The AirGradient ESP32 firmware is a useful example of particulate-sensor integration; its documentation also illustrates why board and library versions matter.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

VOC trends and CO₂ are different measurements

BME680/BME688 and SGP-family devices provide gas-resistance or VOC-related information. Label such output “VOC index” or “gas-resistance trend,” not PM2.5 or a universal pollution concentration, unless a validated calibration and model support that interpretation. Bosch provides environmental-sensor software and drivers at its software tools page.

If the real goal is ventilation monitoring, choose an NDIR CO₂ sensor. CO₂ is not a substitute for particulate monitoring, just as a PM sensor is not a CO₂ sensor. Use separate sensors when both questions matter.

Wire the sensors safely

The following connections describe interfaces, not universal GPIO assignments. ESP32 boards differ, and a pin available on one model may be occupied, unavailable or a boot-strapping pin on another. Choose pins for the specific board and define them once in the firmware configuration.

BME280 over I²C

BME280 VIN/VDD  -> ESP32 3.3 V (subject to breakout-board specifications)
BME280 GND      -> ESP32 GND
BME280 SDA      -> configured ESP32 I²C SDA GPIO
BME280 SCL      -> configured ESP32 I²C SCL GPIO

Check the module’s voltage requirements and I²C address. Modules may use different addresses depending on the SDO/ADR connection, so document the expected address or scan for the common alternatives. A BMP280-shaped module does not measure humidity; do not treat it as a BME280 just because its board is labeled similarly.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Particle sensor over UART

PMS5003 VCC     -> supply specified for the exact module
PMS5003 GND     -> common ground
PMS5003 TX      -> ESP32 hardware-UART RX
PMS5003 RX      -> ESP32 hardware-UART TX, if commands are needed

ESP32 GPIO is generally a 3.3-V logic environment. Verify peripheral output levels before connecting signals, and do not assume the sensor’s power input or logic requirements from a generic product photo. Avoid powering a high-current particle sensor from a regulator that cannot support it. Use a common ground unless the design intentionally provides isolation, and add appropriate local decoupling. For exposed outdoor runs, keep UART wiring short or provide suitable protection, and protect connectors against moisture.

Before finalizing the pin map, check for conflicts with the display, microSD, flash and board boot configuration. A wiring diagram for one ESP32 board is not a universal ESP32 pinout.

Rank #2
ELEGOO ESP-32 Super Starter Kit with Tutorial Compatible with Arduino IDE
  • Powerful ESP-32 Board: Unlock the world of Internet of Things (IoT) and advanced electronics with the heart of this kit: the ESP-32 board. It features a powerful dual-core processor, integrated Wi-Fi and Bluetooth 4.2, making it perfect for building connected, smart devices that communicate with your phone or the cloud. It's fully compatible with the Arduino IDE for easy programming.
  • Super Starter Kit: This kit contains over 35 different modules and electronic components, including sensors, displays, motors, and input devices. From LEDs and buttons to an OLED screen, servo motor, and keypad, you have everything needed to explore a vast range of projects in one box.
  • Step by Step Online Tutorial: Jump right in with our detailed, beginner-friendly tutorial. Access 30+ projects with complete code, clear circuit diagrams, and step-by-step instructions. Learn the fundamentals of electronics, coding, and how to utilize the ESP-32's unique capabilities without any prior experience.
  • Hands-on Learning for All Skill Levels: Perfect for students, makers, engineers, and hobbyists. Start with basic circuits and coding, then progress to intermediate and advanced IoT applications. Build practical projects like weather stations, smart home controllers, remote-controlled devices, and interactive gadgets. The skills you learn are the foundation for real-world innovation.
  • Quality & Great Support: Elegoo is committed to quality. We provide a clear, detailed tutorial guide, refined code, and a well-organized component kit. All modules are carefully selected for reliability and ease of use. Our dedicated technical support team and active online community are ready to help you succeed in your learning journey.

Separate sensing, networking and presentation in firmware

Organize the project into modules for configuration, local sensors, Wi-Fi and time, forecast retrieval, air-quality validation, display, and storage. Keep provider-specific API code behind an interface such as bool fetchForecast(ForecastData& forecast);. This makes it easier to change forecast providers without rewriting sensor, display or logging code.

Read sensors, fetch forecasts and refresh the screen on independent timers. Do not make an API request on every pass through loop(), and avoid long blocking waits that prevent local sensing or display updates.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
if (millis() - lastSensorRead >= SENSOR_INTERVAL_MS) {
    readLocalSensors();
    lastSensorRead = millis();
}

if (millis() - lastForecastFetch >= FORECAST_INTERVAL_MS) {
    if (WiFi.isConnected()) fetchForecastIfAvailable();
    lastForecastFetch = millis();
}

if (millis() - lastDisplayUpdate >= DISPLAY_INTERVAL_MS) {
    updateDisplay();
    lastDisplayUpdate = millis();
}

Use explicit states instead of silently presenting stale or missing data: “Sensor warming up,” “Forecast unavailable,” “Using cached forecast,” “Time not synchronized,” or an appropriate sensor/API error. A network failure should not erase valid local measurements.

For recovery, give Wi-Fi connection attempts a timeout, continue local sensing offline, retry with increasing delays, and retain the last successful forecast with its age. Distinguish authentication, quota, DNS, TLS and timeout errors. Rebooting should be a last-resort recovery mechanism, not the ordinary response to a failed request. The Arduino-ESP32 Wi-Fi documentation covers station and access-point modes, security and Wi-Fi events.

Retrieve forecast data without confusing it with local readings

A forecast request normally uses a configured latitude and longitude or a location identifier, an HTTPS client, and JSON parsing. Select only fields the display needs, such as forecast high and low, precipitation probability, condition and wind. Location lookup can be separate from forecast retrieval. Configure units and the location’s time zone deliberately.

OpenWeather’s API overview describes its weather products, and Open-Meteo’s documentation describes its available weather data. Account or API-key requirements, endpoint eligibility, quotas, attribution and commercial terms can change; consult the live provider documentation and OpenWeather pricing page for the plan and endpoint you intend to use. Do not assume an API is unlimited or that every product is available on every plan.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Synchronize time using NTP or another time source before labeling observations or forecast periods. Handle daylight-saving time and local time-zone display explicitly. For pressure, label whether the device reports station pressure or sea-level-adjusted pressure: a raw reading at elevation is not directly comparable with an app’s sea-level pressure.

HTTPS and JSON can use substantial memory on a small device. Limit response size where the provider allows it, extract only needed fields, avoid unnecessary dynamic-string concatenation, and free request buffers. Cache the last valid forecast and show when it was retrieved. A forecast that is present but old should not look current.

Display particulate readings and AQI accurately

Show pollutant concentration before any index, for example, “PM2.5: 12 µg/m³” and “PM10: 19 µg/m³,” provided those values are valid for the sensor and its reporting mode. If you also show AQI, identify the pollutant, units, averaging period, named standard and whether the number is instantaneous, rolling or forecast. National AQI methods differ; an unqualified 0–500 scale is not universal.

Rank #3
ESP8266 Weather Station Kit for Switching and Displaying Data for Any City in The World
  • The weather station uses the ESP8266-12E to obtain data from the Internet: time of a city, weather data and forecast information for the next 3 days, scrolling on the SSD1306 OLED Display;
  • The device can switch to display data from any city in the world - maybe your relatives or friends live there.
  • The device uses sensors DHT11, BMP180, BH1750FVI to collect temperature, humidity, Atmosphetic Pressure and light data.
  • The weather station reads data indoor via sensor every 5 seconds and uploads it to the Internet every 60 seconds.
  • You can see real-time data charts from your phone or computer.Of course you can modify the code to implement different functions.

For a U.S. display, use the current U.S. EPA method and its pollutant-specific breakpoints, concentration truncation and averaging requirements. Do not use a generic breakpoint table or label a sensor’s proprietary score as regulatory AQI. Interpolation follows this general pattern once the correct standard-specific inputs are selected:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
float calculateAQI(float concentration,
                   float concentrationLow, float concentrationHigh,
                   int indexLow, int indexHigh) {
    return ((indexHigh - indexLow) /
            (concentrationHigh - concentrationLow)) *
           (concentration - concentrationLow) + indexLow;
}

The formula alone does not establish a valid AQI: the implementation still needs the applicable authority’s current breakpoints, pollutant, averaging period and rounding rules. If the sensor is warming up or its data is invalid, show that state rather than assigning an AQI category.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Place sensors for useful readings

Protect the BME280 from heat and sun

The BME280’s temperature can be biased by the ESP32, voltage regulator, battery charging, display, enclosure heat or direct sunlight. Mount it away from heat-producing electronics in a shaded, ventilated area. For outdoor readings, use a radiation shield rather than a sealed electronics box. Ventilation must admit ambient air without exposing the sensor to direct sun or rain.

Give the particle sensor a protected airflow path

A particle sensor in a sealed weatherproof box cannot sample outdoor air properly. Keep its inlet and outlet unobstructed while shielding them from rain, condensation, insects and direct exposure to exhaust heat. Cooking aerosols, smoke, dust, cleaning products, humidity and contamination can affect readings; make the air path accessible for inspection and cleaning.

Treat outdoor construction as a separate design problem

An outdoor station needs a radiation shield, condensation management, protected cable entries, drainage, suitable materials and a maintenance plan. Weatherproofing and ventilation work against each other: protect electronics and connectors while preserving a shielded path for the sensing elements to sample air. Sensor separation matters too; a warm power supply should not sit beside the temperature sensor.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose a display, dashboard and logging path

Output option Useful for Trade-off
On-device OLED or TFT Fast updates, color, charts and immediate status Uses more power and adds wiring and enclosure constraints
E-paper Low-power, always-visible readings updated periodically Slow refresh and possible ghosting; unsuitable for animation
ESP32 local web page A lightweight dashboard on the local network Not reachable when the device or local network is unavailable
MQTT and Home Assistant History, automations, alerts and multiple stations Requires another maintained host and secure broker setup
Cloud logging Remote access and hosted history Depends on accounts, network availability, quotas and provider policies

Keep the screen legible about provenance and age. A useful layout separates “Local,” “Forecast” and “Air quality,” includes units, and marks offline or cached data. A cloud dashboard or local display should not imply that API forecast values were measured by the station.

Plan power, privacy and security

USB power is the simplest choice for an indoor build. Battery or solar operation needs a measured power budget for the completed station, including Wi-Fi activity, particle-sensor operation, display updates and sleep intervals. A PMS5003-class sensor can dominate consumption, so consider scheduled measurements, supported sleep modes, ESP32 deep sleep, e-paper or no display, and less frequent forecast requests. Do not promise a battery life based only on the ESP32’s bare-chip specifications.

Keep Wi-Fi credentials and API keys out of public repositories; store secrets in an excluded configuration file and provide a reset or Wi-Fi reprovisioning path. Prefer local-network access or a properly secured VPN over exposing the ESP32 web server directly to the internet. Use HTTPS where supported and test memory behavior on the chosen board. Arduino-ESP32 documents security modes including WPA2 and WPA3, but compatibility depends on the specific board, software and router.

Bring up the project in stages

  1. Confirm the board and toolchain. Select the exact ESP32 board in Arduino IDE or PlatformIO and record the tested Arduino-ESP32 core and library versions. At the time represented by Espressif’s documentation, its site identifies Arduino-ESP32 3.3.11 based on ESP-IDF 5.5, while the repository lists a 3.3.8 release entry based on ESP-IDF 5.5.4. Pin the package actually tested by your build rather than assuming those pages update together. See the Arduino-ESP32 documentation and repository.
  2. Test the BME280 alone. Confirm the I²C address and verify that temperature, humidity and pressure return plausible values. A missing humidity reading may indicate a BMP280 or incorrectly identified module.
  3. Add the display. Establish the pin map and check for I²C or SPI conflicts before connecting other modules.
  4. Add the particle sensor. Confirm the module’s supply and logic specifications, UART connection, valid frames and checksum handling. Wait through warm-up before treating measurements as available.
  5. Add Wi-Fi and time. Test connection timeout, offline sensing, retry behavior and the display’s status indicators.
  6. Add forecast retrieval last. Request only the fields needed, check provider terms and limits, test error paths, and display the timestamp or age of cached data.
  7. Test the assembled enclosure and power source. Check thermal bias, airflow, rain protection, sensor access and measured current in active and sleep states before deploying it outdoors or relying on a battery.

Troubleshoot common failures

Symptom Likely checks
BME280 not detected Check power, common ground, SDA/SCL mapping and the module’s I²C address; scan for the expected address options.
Humidity is missing Verify the chip is a BME280 rather than a BMP280, then check the driver and module.
Temperature reads too high Move the sensor away from the ESP32, regulator, charger and display; improve shade and ventilation.
PMS5003 frames fail validation Check UART RX/TX direction, baud and module documentation; verify full frame length and checksum before accepting data.
Particle readings remain at zero Allow warm-up, check sensor power and sleep state, and inspect the airflow path and UART parser.
Wi-Fi reconnects continuously Use bounded attempts and backoff; continue local sensing and provide a credential-reset or reprovisioning route.
Forecast request fails Distinguish authentication or quota errors from DNS, TLS, timeout and malformed-response failures; retain local readings and show cached-data age.
Units or forecast times look wrong Check API unit parameters, configured time zone, daylight-saving handling, synchronization and station-versus-sea-level pressure labeling.
Display is blank Check its supply, interface, address or pin mapping, initialization and conflicts with other devices.
Battery drains quickly Measure the complete station in active and sleep states; review particle-sensor duty cycle, Wi-Fi frequency and display refresh.

A balanced first build

For a capable first station, use an ESP32 development board, a verified BME280 breakout, a PMS5003-class sensor on a suitable supply and UART, and a USB-powered display. Start indoors, prove each sensor independently, then add a forecast provider with cached-data and offline handling. Move outdoors only after designing a shielded, ventilated sensor path and checking temperature bias and moisture protection. Add CO₂, logging, wind or rain measurement only when those measurements serve a defined purpose.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

For component documentation and implementation references, consult Adafruit’s BME280 breakout, SparkFun’s BME280 breakout, Adafruit’s PMSA003I page, the Adafruit display catalog, and Espressif development boards. These are examples, not a guarantee that every breakout shares the same voltage, pinout or environmental suitability.

Quick Recap

Bestseller No. 1
LAFVIN Basic Starter Kit for ESP32 ESP-32S WiFi IoT Development Board with Tutorial Compatible with Arduino IDE
LAFVIN Basic Starter Kit for ESP32 ESP-32S WiFi IoT Development Board with Tutorial Compatible with Arduino IDE
Perfect choice for beginners to learn, electronics and program.; You can use ESP32 modules to control other modules, such as LED,DHT11,OLED module, etc
$19.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.