Guides · 7 min read

ESP32 Weather Station BME280: OLED, Web Page and Forecast

Build an ESP32 weather station with a BME280: temperature, humidity and pressure on an OLED and a web dashboard, sea-level pressure, altitude and a forecast.

An ESP32 weather station with a BME280 measures temperature, relative humidity and air pressure with a single sensor and shows the results both on a small OLED display and on a web page you open on your phone, and you can build it in one evening. The ESP32 has Wi-Fi built in, so no extra module is needed, and the BME280 and the OLED share the same two-wire I2C bus. Thanks to the pressure data, the station does more than measure: it works out your altitude and gives a rough forecast of whether the weather will turn in the next few hours.

In this guide we first check from the chip ID whether your sensor really is a BME280 or a BMP280, which can't measure humidity, then wire the circuit and write the complete sketch. We walk through the formula that reduces raw pressure to sea level, altitude from pressure, and a table that turns the pressure change over the last 3 hours into a forecast. BME280 basics are covered in BME280 with Arduino; here we turn it into a complete ESP32 station.

BME280 temperature, humidity and pressure sensor module
BME280 module: Bosch's 2.5 × 2.5 mm sensor measures temperature, humidity and pressure in one chip and connects over I2C with just four wires.

Parts list and BME280 specifications

  • ESP32 DevKit (30 or 38 pins, either works)
  • BME280 module (I2C, 3.3 V; the common purple or blue boards)
  • 0.96-inch SSD1306 OLED display (I2C, 128×64)
  • Breadboard and jumper wires, plus 10–20 cm female-to-male wires to keep the sensor away from the board's heat
  • 5 V USB power adapter to run the station without a computer
FeatureBME280 value
Temperature−40…+85 °C; ±1 °C from 0–65 °C, ±0.5 °C at 25 °C
Relative humidity0–100%, ±3%
Pressure range300–1100 hPa
Pressure accuracyAbsolute ±1 hPa, relative ±0.12 hPa (about ±1 m of altitude)
Supply1.71–3.6 V (modules with a regulator also accept 5 V)
CurrentAbout 3.6 µA at one reading per second, 0.1 µA in sleep
Interface and addressI2C: 0x76 (SDO → GND) or 0x77 (SDO → VCC); SPI also supported

BME280 or BMP280? Identify your sensor

Some cheap modules sold as BME280 actually carry a BMP280. Both chips are made by Bosch and have the same pins and I2C addresses, but the BMP280 cannot measure humidity. The silkscreen is often vague, something like "BME/BMP280"; the reliable test is to read the chip ID register at 0xD0: a BME280 returns 0x60, a BMP280 returns 0x58 (0x56 or 0x57 on early samples). You can also guess from the metal lid: the BME280's is almost square, the BMP280's clearly rectangular.

FeatureBME280BMP280
MeasuresTemperature, humidity, pressureTemperature, pressure (no humidity)
Chip ID (0xD0)0x600x58 (0x56/0x57 on samples)
Lid size2.5 × 2.5 mm, square2.0 × 2.5 mm, rectangular
I2C address0x76 or 0x770x76 or 0x77
Arduino libraryAdafruit BME280Adafruit BMP280
C++ (Arduino IDE)
1// BME280 mi BMP280 mi? Çip kimliğini oku / BME280 or BMP280? Read the chip ID
2#include <Wire.h>
3
4void setup() {
5  Serial.begin(115200);
6  Wire.begin(21, 22);                          // ESP32: SDA = GPIO 21, SCL = GPIO 22
7  Serial.print(F("Kart / board: "));
8  Serial.println(ESP.getChipModel());
9
10  for (uint8_t addr = 0x76; addr <= 0x77; addr++) {
11    Wire.beginTransmission(addr);
12    Wire.write(0xD0);                          // çip kimliği yazmacı / chip ID register
13    if (Wire.endTransmission() != 0) continue; // bu adreste cihaz yok / no device here
14    Wire.requestFrom(addr, (uint8_t)1);
15    uint8_t id = Wire.read();
16
17    Serial.print(F("Adres / address 0x"));
18    Serial.print(addr, HEX);
19    Serial.print(F(" -> kimlik / ID 0x"));
20    Serial.print(id, HEX);
21    if (id == 0x60) Serial.println(F(" = BME280"));
22    else if (id >= 0x56 && id <= 0x58) Serial.println(F(" = BMP280 (nem yok / no humidity)"));
23    else Serial.println(F(" = bilinmeyen / unknown"));
24  }
25}
26
27void loop() {
28}

Wiring: BME280 and OLED on the same I2C bus

Because every I2C device has its own address, the BME280 (0x76) and the OLED (0x3C) share the same two wires; the ESP32's default I2C pins are GPIO 21 (SDA) and GPIO 22 (SCL). Power both modules from the 3V3 pin so the I2C lines also stay at 3.3 V and the ESP32's pins are safe. The 4.7–10 kΩ pull-up resistors on the modules are enough for the bus, no extra resistors needed. How I2C works is explained in What is I2C?.

Module pinESP32 pinNote
BME280 VIN (VCC)3V3Don't feed 5 V; modules without a regulator will die
BME280 GNDGNDCommon ground
BME280 SDAGPIO 21Same line as OLED SDA
BME280 SCLGPIO 22Same line as OLED SCL
BME280 SDO (if present)GND or openGND: 0x76, 3V3: 0x77
OLED VCC / GND3V3 / GNDCheck the pin order printed on the board
OLED SDA / SCLGPIO 21 / GPIO 22Address 0x3C
Don't put the sensor right next to the ESP32 on the same breadboard. With Wi-Fi on, the ESP32 chip and its regulator warm up by a few degrees; the sensor measures that heat, so temperature reads 2–5 °C high and humidity reads low. Mount the BME280 away from the board on 10–20 cm wires, and since warm air rises, place it beside or below the board rather than above it. On 6-pin modules, make sure the CSB pin is tied to 3V3 (or pulled up on the module) for I2C.

Installing the libraries

  1. Make sure the ESP32 board package is installed in the Arduino IDE; the steps are in What is the ESP32?.
  2. In the Library Manager, search for Adafruit BME280 Library and install it, accepting the dependencies (Adafruit Unified Sensor and Adafruit BusIO) when asked.
  3. Install Adafruit SSD1306 the same way; Adafruit GFX Library comes along as a dependency.
  4. The WiFi and WebServer libraries ship with the ESP32 package, so there is nothing else to install.

Sea-level pressure and altitude

The value the BME280 reports is the station pressure where you are, and it drops as altitude rises: near sea level it falls by roughly 12 hPa every 100 meters. Weather reports and maps, however, always give pressure reduced to sea level so that places can be compared. Using your known altitude (h, meters) and the measured temperature (T, °C), you convert the measured pressure (P) to sea level with P0 = P × (1 − 0.0065·h / (T + 0.0065·h + 273.15))^−5.257. In Denver (1,609 m), for example, the sensor reads about 840 hPa while the sea-level value is around 1013 hPa. The other way round, if you know the sea-level pressure, altitude is h = 44330 × (1 − (P / P0)^0.1903); the readAltitude() function in the Adafruit library does exactly that.

AltitudeMeasured pressure (15 °C, approx.)Correction factor P0 / P
0 m1013 hPa1.000
500 m955 hPa1.061
1000 m901 hPa1.124
1500 m851 hPa1.191
2000 m803 hPa1.261
readAltitude(1013.25) calculates altitude against the standard atmosphere. Because air pressure can swing 10–20 hPa in a day, that altitude can be off by more than 100 meters; for an accurate value, pass the current sea-level pressure from a nearby weather station. Our station does the opposite: it takes the altitude as a fixed value and reduces the pressure to sea level.

The weather station sketch: OLED and web dashboard

The sketch below connects the ESP32 to your home network, has the BME280 take a reading in forced mode every 10 seconds, writes the results to the OLED and serves two addresses: / returns the dashboard page you open on your phone, and /data returns the readings as JSON. Every 5 seconds the page reads /data with JavaScript's fetch and updates the numbers and HTML's built-in meter gauges, so it needs neither internet access nor any external library. The sketch also stores the station pressure in an array every 10 minutes and calculates the change over the last 3 hours. Replace the Wi-Fi name, password and ALTITUDE_M with your own values.

C++ (Arduino IDE)
1// ESP32 + BME280 hava istasyonu: OLED ve web sayfası
2// ESP32 + BME280 weather station: OLED and web dashboard
3#include <WiFi.h>
4#include <WebServer.h>
5#include <Wire.h>
6#include <Adafruit_Sensor.h>
7#include <Adafruit_BME280.h>
8#include <Adafruit_GFX.h>
9#include <Adafruit_SSD1306.h>
10
11const char* WIFI_SSID = "AgAdi";        // Wi-Fi adın / your Wi-Fi name
12const char* WIFI_PASS = "Sifre123";     // Wi-Fi şifren / your Wi-Fi password
13const float ALTITUDE_M = 938.0;         // kendi rakımın (m) / your altitude (m)
14
15Adafruit_BME280 bme;
16Adafruit_SSD1306 display(128, 64, &Wire, -1);
17WebServer server(80);
18
19float tempC = 0, humidity = 0, pressHpa = 0, seaHpa = 0, altM = 0, trend3h = 0;
20bool trendReady = false;
21
22// 3 saatlik basınç geçmişi, 10 dakikada bir / 3-hour pressure history, every 10 minutes
23const int HIST = 19;                    // 18 aralık x 10 dk = 3 saat / 18 steps x 10 min = 3 h
24float history[HIST];
25int histCount = 0;
26unsigned long lastRead = 0, lastHist = 0;
27
28const char PAGE[] PROGMEM = R"rawliteral(
29<!DOCTYPE html><html><head><meta charset="utf-8">
30<meta name="viewport" content="width=device-width,initial-scale=1">
31<title>ESP32 BME280</title>
32<style>
33body{font-family:sans-serif;background:#0f172a;color:#e2e8f0;text-align:center;margin:0;padding:16px}
34.card{background:#1e293b;border-radius:12px;padding:12px;margin:10px auto;max-width:360px}
35.v{font-size:2.2em;font-weight:bold;margin:6px 0}
36meter{width:90%;height:18px}
37</style></head><body>
38<h2>ESP32 Hava İstasyonu / Weather Station</h2>
39<div class="card">Sıcaklık / Temperature<div class="v"><span id="t">-</span> °C</div>
40<meter id="mt" min="-10" max="40"></meter></div>
41<div class="card">Nem / Humidity<div class="v"><span id="h">-</span> %</div>
42<meter id="mh" min="0" max="100" low="30" high="70" optimum="50"></meter></div>
43<div class="card">Basınç, deniz seviyesi / Pressure, sea level<div class="v"><span id="p0">-</span> hPa</div>
44<meter id="mp" min="960" max="1050" low="1000" high="1025" optimum="1013"></meter>
45<div>İstasyon / station: <span id="p">-</span> hPa | Rakım / altitude: <span id="a">-</span> m</div></div>
46<div class="card">3 saatlik eğilim / 3-hour trend<div class="v"><span id="tr">-</span> hPa</div><div id="tx">-</div></div>
47<script>
48const $ = (id) => document.getElementById(id);
49async function update() {
50  const d = await (await fetch('/data')).json();
51  $('t').textContent = d.t; $('h').textContent = d.h; $('p0').textContent = d.p0;
52  $('p').textContent = d.p; $('a').textContent = d.alt;
53  $('mt').value = d.t; $('mh').value = d.h; $('mp').value = d.p0;
54  $('tr').textContent = d.ready ? (d.trend > 0 ? '+' : '') + d.trend : '-';
55  $('tx').textContent = d.txt;
56}
57update(); setInterval(update, 5000);
58</script></body></html>
59)rawliteral";
60
61// Deniz seviyesine indirgenmiş basınç / pressure reduced to sea level
62float seaLevel(float p, float t, float h) {
63  return p * pow(1.0 - (0.0065 * h) / (t + 0.0065 * h + 273.15), -5.257);
64}
65
66// 3 saatlik değişimin yorumu / meaning of the 3-hour change
67const char* trendText(float d) {
68  if (!trendReady) return "3 saat veri bekleniyor / collecting 3 h of data";
69  if (d <= -6.0) return "Firtina riski / storm risk";
70  if (d <= -3.6) return "Hizli dusus: yagis ve ruzgar / falling fast: rain and wind";
71  if (d <= -1.6) return "Dusuyor: bulutlanma / falling: clouds coming";
72  if (d <= -0.1) return "Yavas dusus / falling slowly";
73  if (d < 0.1)   return "Sabit / steady";
74  if (d < 1.6)   return "Yavas yukselis / rising slowly";
75  if (d < 3.6)   return "Yukseliyor: acilma / rising: clearing up";
76  return "Hizli yukselis, ruzgarli / rising fast, windy";
77}
78
79void readSensor() {
80  bme.takeForcedMeasurement();          // tek ölçüm al, sonra uyu / one reading, then sleep
81  tempC = bme.readTemperature();
82  humidity = bme.readHumidity();
83  pressHpa = bme.readPressure() / 100.0;
84  seaHpa = seaLevel(pressHpa, tempC, ALTITUDE_M);
85  altM = bme.readAltitude(1013.25);     // standart atmosfere göre / against the standard atmosphere
86}
87
88// Eğilim için ham istasyon basıncını sakla / keep raw station pressure for the trend
89void updateHistory() {
90  if (histCount < HIST) {
91    history[histCount++] = pressHpa;
92  } else {
93    for (int i = 1; i < HIST; i++) history[i - 1] = history[i];   // kaydır / shift
94    history[HIST - 1] = pressHpa;
95  }
96  trendReady = (histCount == HIST);
97  if (trendReady) trend3h = history[HIST - 1] - history[0];
98}
99
100void handleData() {
101  char json[256];
102  snprintf(json, sizeof(json),
103           "{\"t\":%.1f,\"h\":%.0f,\"p\":%.1f,\"p0\":%.1f,\"alt\":%.0f,\"trend\":%.1f,\"ready\":%s,\"txt\":\"%s\"}",
104           tempC, humidity, pressHpa, seaHpa, altM, trend3h, trendReady ? "true" : "false", trendText(trend3h));
105  server.send(200, "application/json", json);
106}
107
108void drawOled() {
109  display.clearDisplay();
110  display.setTextColor(SSD1306_WHITE);
111  display.setTextSize(2);
112  display.setCursor(0, 0);
113  display.print(tempC, 1);
114  display.print(" C");
115  display.setTextSize(1);
116  display.setCursor(0, 22);
117  display.print("Nem/Hum: ");  display.print(humidity, 0);  display.println(" %");
118  display.print("P0: ");       display.print(seaHpa, 1);    display.println(" hPa");
119  display.print("3sa/3h: ");
120  if (trendReady) { display.print(trend3h, 1); display.println(" hPa"); }
121  else display.println("...");
122  display.print(WiFi.localIP());
123  display.display();
124}
125
126void setup() {
127  Serial.begin(115200);
128  Wire.begin(21, 22);                                 // SDA, SCL
129  if (!bme.begin(0x76) && !bme.begin(0x77)) {
130    Serial.println(F("BME280 yok: kablo, adres ya da BMP280? / BME280 not found: wiring, address or BMP280?"));
131    while (true) delay(1000);
132  }
133  bme.setSampling(Adafruit_BME280::MODE_FORCED,       // hava istasyonu ayarı / weather station setting
134                  Adafruit_BME280::SAMPLING_X1,       // sıcaklık / temperature
135                  Adafruit_BME280::SAMPLING_X1,       // basınç / pressure
136                  Adafruit_BME280::SAMPLING_X1,       // nem / humidity
137                  Adafruit_BME280::FILTER_OFF);
138  if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
139    Serial.println(F("OLED yok / OLED not found"));
140  }
141
142  WiFi.begin(WIFI_SSID, WIFI_PASS);
143  Serial.print(F("Wi-Fi"));
144  while (WiFi.status() != WL_CONNECTED) {
145    delay(500);
146    Serial.print('.');
147  }
148  Serial.println();
149  Serial.println(WiFi.localIP());                     // bu adresi telefonda aç / open this address on your phone
150
151  server.on("/", []() { server.send(200, "text/html", PAGE); });
152  server.on("/data", handleData);
153  server.begin();
154
155  readSensor();
156  updateHistory();
157  lastRead = lastHist = millis();
158  drawOled();
159}
160
161void loop() {
162  server.handleClient();
163  if (millis() - lastRead >= 10000UL) {               // 10 sn'de bir ölç / measure every 10 s
164    lastRead = millis();
165    readSensor();
166    drawOled();
167  }
168  if (millis() - lastHist >= 600000UL) {              // 10 dk'da bir geçmişe ekle / add to history every 10 min
169    lastHist = millis();
170    updateHistory();
171  }
172}
PartWhat it does
setSampling(MODE_FORCED, X1, X1, X1, FILTER_OFF)Bosch's recommended weather-monitoring setting: the sensor sleeps after each reading and doesn't heat itself
takeForcedMeasurement()Starts a single reading and waits until it finishes
seaLevel()Calculates sea-level pressure with the formula
history[19]Keeps 3 hours of station pressure at 10-minute intervals
handleData()Sends the readings and the trend as JSON at /data
PAGEThe dashboard page for your phone, refreshing itself every 5 seconds
Open the IP address shown in the Serial Monitor and on the OLED's bottom line in the browser of a phone on the same Wi-Fi. If you don't want the IP to change, reserve a fixed address for the ESP32 in your router. If the connection fails, see ESP32 won't connect to Wi-Fi.

Forecasting the weather from the pressure trend

A barometer's real power is not a single reading but how the pressure changes. Meteorologists call the change over the last 3 hours the "pressure tendency" and classify it by speed. As a low-pressure system approaches, pressure falls and clouds and rain arrive; when high pressure builds, it rises and the sky clears. The table below is the basis of the comments the station shows on its web page. We calculate the trend from raw station pressure rather than the sea-level value, because the temperature in the reduction formula makes the sea-level value drift by a few hPa between day and night.

3-hour changeTendencyLikely weather
Falls of more than 6 hPaFalling very rapidlyStorm and strong wind close
−3.6 to −6 hPaFalling quicklyRain and wind within a few hours
−1.6 to −3.5 hPaFallingClouds building, rain more likely
−0.1 to −1.5 hPaFalling slowlyWeather may slowly worsen
Less than ±0.1 hPaSteadyCurrent weather continues
+0.1 to +1.5 hPaRising slowlySlow improvement
+1.6 to +3.5 hPaRisingClouds breaking up, clearing
+3.6 hPa or moreRising quicklyFast clearing, but often windy and short-lived

The absolute value is a clue too: above 1020 hPa at sea level you can usually expect clear, calm weather, below 1000 hPa wet and windy conditions. For a local forecast a few hours ahead, this method works about as well as a classic barometer, but because it knows nothing about wind direction or large-scale weather systems it does not replace a weather service. When the ESP32 restarts, the history is lost and the trend only reappears after 3 hours.

Placing the sensor correctly

  • Shade it from the sun: a sensor in direct sunlight can read 10 °C above the air temperature; outdoors, use a white, ventilated radiation shield.
  • Keep the rain off, not the air: don't seal the box; a housing that is open or slotted at the bottom lets humidity be measured correctly.
  • Stay away from heat sources: walls, windows, AC outdoor units and the ESP32 itself skew readings; keep the sensor at least 10 cm away.
  • Height above ground: weather stations measure temperature 1.25–2 m above the ground; a balcony railing is a good spot.
  • Careful with long wires: I2C isn't designed for long cables; stay under 1 meter and use a second ESP32 talking over ESP-NOW for an outdoor unit.

Project ideas: growing your station

  • Battery-powered outdoor unit: build a sensor that wakes from deep sleep every 10 minutes to send a reading; on a low-power board an 18650 cell can last for months.
  • Logging to Google Sheets: write the readings to Google Sheets and plot weekly charts.
  • Home Assistant: send the values over MQTT to Home Assistant and use them in automations.
  • Rain and light: extend the station with a rain sensor and a BH1750 light sensor.
  • Air quality: add PM2.5 to the page with a PMS5003 dust sensor.
  • Storm alert: send a Telegram message when the 3-hour drop exceeds 3.6 hPa.

Common mistakes and fixes

ProblemLikely causeFix
"BME280 not found"It's really a BMP280, wrong address or bad wiringRun the chip ID sketch; for a BMP280 use the Adafruit BMP280 library
Humidity stuck at 0 or 100It's a BMP280, or the sensor got wetCheck the chip ID; let a wet sensor dry out
Temperature 2–5 °C too highHeat from the ESP32 or sensor self-heatingMove the sensor away, use forced mode and infrequent readings
Pressure much lower than the forecastYou're reading station pressure, not sea-level pressureSet ALTITUDE_M correctly and compare the P0 value
Altitude changes 50–150 m from day to dayreadAltitude() assumes a fixed 1013.25 hPaTreat altitude as fixed; what's changing is the air pressure
OLED stays blankAddress is 0x3D or VCC and GND are swappedFind the address with an I2C scanner, check the pin order
Page won't openPhone on another network or the IP changedJoin the same Wi-Fi, use the current IP shown on the OLED

The station you built with an ESP32 and a BME280 teaches the three core steps of IoT in one go: reading data from a sensor, processing it and serving it over the network. You can add any sensor to the same structure and enrich the page with charts; for an example that draws a 24-hour chart with a DHT22, see ESP32 DHT22 web server. In the BlueGrays app you'll find projects such as the ESP32 weather display on an OLED and the ESP32 temperature logger step by step, with circuit diagrams and code.

Frequently asked questions

How do I build an ESP32 weather station with a BME280?

Connect a BME280 and, optionally, an OLED display to the ESP32 over I2C (GPIO 21 SDA, GPIO 22 SCL). Read temperature, humidity and pressure with the Adafruit BME280 library and serve them on a web page with the WebServer library. Keep the sensor away from the ESP32's heat.

How can I tell a BME280 from a BMP280?

The reliable way is to read the chip ID in register 0xD0: a BME280 returns 0x60, a BMP280 returns 0x58. The BMP280 has no humidity sensor and a rectangular lid, while the BME280's lid is almost square.

Why does my BME280 read too warm?

Usually it is picking up heat from the ESP32 or its regulator, which can add 2–5 °C with Wi-Fi on. Mount the sensor a few centimeters away on wires and use forced mode with infrequent readings to avoid self-heating.

How do you convert pressure to sea level?

Plug the measured pressure P, altitude h and temperature T into P0 = P × (1 − 0.0065·h / (T + 0.0065·h + 273.15))^−5.257. Near sea level, adding about 12 hPa per 100 m gives a rough result.

What does falling barometric pressure mean?

A fall of more than 1.6 hPa in 3 hours usually means a low-pressure system is approaching, with clouds and rain more likely; a drop beyond 6 hPa points to a storm. Rising pressure means the weather is improving.

Can the BME280 run on 5 V?

The BME280 chip itself is rated for at most 3.6 V. Some modules include a regulator and level shifter and accept 5 V, but modules without them are damaged by 5 V. With an ESP32, always power the module from the 3V3 pin.

See all projects
ESP32 HTTPClient + Weather API (with SSD1306 OLED Display)
ES-32Advanced
Premium

ESP32 HTTPClient + Weather API (with SSD1306 OLED Display)

In this project the ESP32 makes a REST API call over the internet to a weather API (wttr.in) using HTTPClient.h. Unlike the I2C LCD version, it uses an SSD1306 OLED (128×64) display, with large text and vector icons for a richer look. Seven weather icons (sunny, rainy, snowy and more) are drawn on the fly, with no bitmap files.

4.3(10)
22
ESP32 DHT22 Temperature and Humidity (with LCD Display)
ES-15Intermediate

ESP32 DHT22 Temperature and Humidity (with LCD Display)

This project measures ambient temperature and humidity using a DHT22 sensor and displays the data in real time on a 16x2 I2C LCD. Data is read from the sensor using the one-wire protocol via the Adafruit DHT library. This project serves as the foundation for IoT weather stations, smart home automation, or environmental monitoring systems in greenhouses. Communication with the DHT22 is established via the ESP32's GPIO 4 pin.

4.8(38)
57
ESP32 Temperature Data Logger (DHT22 + DS1307 RTC + microSD + OLED)
ES-40Advanced
Premium

ESP32 Temperature Data Logger (DHT22 + DS1307 RTC + microSD + OLED)

Build a timed temperature and humidity logger with the ESP32! A DHT22 sensor reads temperature and humidity once a minute, and each reading is saved to a microSD card in CSV format with a real-time stamp from the DS1307 RTC module. The OLED display shows the latest temperature, humidity, timestamp and total number of records live, in large text.

4.7(7)
12
ESP32 Asynchronous Web Server (with IP Display on LCD)
ES-27Advanced

ESP32 Asynchronous Web Server (with IP Display on LCD)

In this project, we’re turning the ESP32 into an asynchronous web server that you can control from your phone or computer on the same Wi-Fi network. Thanks to the ESPAsyncWebServer library, the server can process multiple requests simultaneously (unlike the classic WebServer.h, which blocks on a single request). You’ll be able to open the ESP32’s IP address in a browser and click the ON/OFF buttons (the /on and /off routes) to turn the LED connected to GPIO 5 on and off.

4.8(16)
27
ESP32 Deep Sleep — Battery Saving (OLED + RTC RAM Counter)
ES-33Advanced
Premium

ESP32 Deep Sleep — Battery Saving (OLED + RTC RAM Counter)

The ESP32's Deep Sleep mode shuts down the CPU and most peripherals, cutting current draw to about 10µA, which is vital for battery-powered IoT devices. This project uses three wake-up sources: a timer (15 s), an external pin (EXT0, the button on GPIO 33) and a touch pin (T0/GPIO 4). Counters marked with RTC_DATA_ATTR survive deep sleep.

4.3(10)
17
ESP32 WebSocket Counter (2 Buttons + LCD + Real-Time Web)
ES-28Advanced
Premium

ESP32 WebSocket Counter (2 Buttons + LCD + Real-Time Web)

In this project, two buttons wired to the ESP32 (GPIO 5 counts up, GPIO 4 counts down) change a counter. The value updates instantly both on a 16x2 I2C LCD and, through the WebSocket support of ESPAsyncWebServer, in every connected browser without reloading the page. Instead of HTTP polling a single persistent connection is used, and the ESP32 sends the new value to everyone with ws.textAll().

4.5(14)
23
ESP32 HTTPClient + Weather API (with LCD Screen)
ES-31Advanced
Premium

ESP32 HTTPClient + Weather API (with LCD Screen)

In this project the ESP32 makes a REST API call over the internet to a weather API (wttr.in) using HTTPClient.h. The JSON response is parsed with ArduinoJson v7, and the city, temperature, humidity, weather and wind are shown on an I2C LCD. wttr.in needs no API key; just type the name of any city.

4.7(13)
20
ESP32 Wi-Fi STA Connection (with LCD Screen)
ES-25Advanced

ESP32 Wi-Fi STA Connection (with LCD Screen)

In this project, we connect the ESP32 to the home Wi-Fi network in Station (STA) mode in a secure, fault-tolerant manner. We store the SSID and password in a separate secrets.h file to prevent leaking to Git, set up an auto-reconnect mechanism, and display the RSSI signal level and IP address on an I2C LCD screen. The internal LED works as a status indicator. It is a production-grade connection manager.

4.4(21)
40