ESP32 + BME280: Live Dashboard in 10 Minutes
Build a real-time environmental monitoring dashboard. Wire a BME280 sensor to an ESP32, upload a sketch, and see temperature, humidity, and pressure update live in your browser.
What You'll Build
A live-updating dashboard showing:
- Temperature (°C)
- Humidity (%)
- Barometric pressure (hPa)
All data is stored in Plexus for historical analysis, alerting, and sharing.
What You Need
| Item | Notes |
|---|---|
| ESP32 dev board | Any ESP32 with USB (DevKit V1, ESP32-S3, etc.) |
| BME280 sensor | I2C breakout (Adafruit, SparkFun, generic) |
| 4 jumper wires | SDA, SCL, 3.3V, GND |
| Arduino IDE | 2.x recommended |
| Plexus account | Free at app.plexus.company (opens in a new tab) |
Step 1: Wire the BME280
Connect the BME280 to your ESP32 using I2C:
| BME280 Pin | ESP32 Pin |
|---|---|
| SDA | GPIO 21 |
| SCL | GPIO 22 |
| VIN | 3.3V |
| GND | GND |
Most BME280 breakout boards include pull-up resistors, so no additional components are needed.
Step 2: Install Arduino Libraries
Open Arduino IDE and install two libraries via Sketch → Include Library → Manage Libraries:
- Search "Plexus SDK" → Install
- Search "Adafruit BME280" → Install (this also installs Adafruit Unified Sensor)
Make sure your board is set to ESP32 Dev Module (or your specific board) under Tools → Board.
Step 3: Get Your API Key
- Go to app.plexus.company (opens in a new tab)
- Click Add Device
- Copy the API key (starts with
plx_)
Step 4: Upload the Sketch
Open File → Examples → Plexus SDK → BME280_Dashboard or paste this sketch:
#include <WiFi.h>
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BME280.h>
#include "plexus.hpp"
const char* WIFI_SSID = "YourWiFiSSID"; // ← Change this
const char* WIFI_PASSWORD = "YourWiFiPassword"; // ← Change this
const char* PLEXUS_API_KEY = "plx_xxxxx"; // ← Paste your API key
const char* SOURCE_ID = "esp32-bme280";
PlexusClient plexus(PLEXUS_API_KEY, SOURCE_ID);
Adafruit_BME280 bme;
bool bmeFound = false;
unsigned long lastReadMs = 0;
void setup() {
Serial.begin(115200);
// Initialize BME280
Wire.begin();
bmeFound = bme.begin(0x76) || bme.begin(0x77);
Serial.println(bmeFound ? "BME280 found!" : "BME280 not found");
// Connect to WiFi
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
Serial.print("Connecting");
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.printf("\nConnected: %s\n", WiFi.localIP().toString().c_str());
}
void loop() {
if (millis() - lastReadMs >= 2000) {
lastReadMs = millis();
float temp = bme.readTemperature();
float humidity = bme.readHumidity();
float pressure = bme.readPressure() / 100.0F;
plexus.send("temperature", temp);
plexus.send("humidity", humidity);
plexus.send("pressure", pressure);
Serial.printf("T=%.1f°C H=%.1f%% P=%.1f hPa\n", temp, humidity, pressure);
}
plexus.tick();
delay(100);
}- Update
WIFI_SSID,WIFI_PASSWORD, andPLEXUS_API_KEY - Click Upload
- Open Serial Monitor at 115200 baud to verify readings
Step 5: See Your Dashboard
Open app.plexus.company (opens in a new tab). Your device esp32-bme280 appears on the Devices page. Click it to see live telemetry.
Add charts for temperature, humidity, and pressure to a dashboard. Data updates every 2 seconds.
How It Works
- The BME280 sensor reads temperature, humidity, and pressure over I2C
plexus.send()queues each reading in a local bufferplexus.tick()checks if 5 seconds have elapsed and sends all buffered data in a single HTTP POST to the Plexus API- Plexus stores the data in ClickHouse and broadcasts it to connected dashboards via WebSocket
The entire payload is a single JSON request — no MQTT broker, no special protocols. Just HTTP.
Troubleshooting
"BME280 not found" — Check your wiring. Try address 0x77 if 0x76 doesn't work (some boards use a different default). Run an I2C scanner sketch to verify the address.
No data in dashboard — Check Serial Monitor for errors. Verify your API key is correct and starts with plx_. Ensure WiFi is connected.
Intermittent data — WiFi signal may be weak. Move closer to your router or add WiFi reconnection logic (see the WiFiReconnect example).
Next Steps
- Session Recording — Group data into test runs
- Memory Configuration — Reduce RAM usage for constrained boards
- Alerts — Get notified when temperature exceeds a threshold
- Python Agent — Add a Raspberry Pi to the same dashboard