Overview
This project is a complete IoT weather station, built from the sensor all the way to the web dashboard. An ESP32 reads environmental data from a BME280 sensor and publishes it to the cloud over MQTT. A Node.js backend receives the data and pushes it to a React dashboard in real time, so the readings update live in the browser without a page refresh.
I built every layer myself: hardware, firmware, cloud connection, backend and frontend.
How it works
- Sensor: The BME280 measures temperature, humidity and air pressure. It talks to the ESP32 over I2C.
- Firmware: The ESP32 reads the sensor at a fixed interval, formats the data as JSON, and connects to Wi-Fi.
- Cloud (MQTT): The ESP32 publishes the readings to a topic on HiveMQ Cloud, a hosted MQTT broker, over a secure TLS connection.
- Backend: A Node.js server subscribes to the MQTT topic and forwards each new message to connected clients over WebSockets.
- Dashboard: A React frontend shows the current values and live charts (built with Recharts) that update as new data comes in.
Hardware
- ESP32 development board
- BME280 temperature, humidity and pressure sensor (I2C)
- Breadboard and jumper wires, powered over USB
Tech stack
- Firmware: C++ (Arduino framework), PlatformIO
- Protocols: I2C, Wi-Fi, MQTT over TLS
- Cloud: HiveMQ Cloud
- Backend: Node.js, WebSockets
- Frontend: React, Recharts
Challenges
- Toolchain setup: Getting PlatformIO working on Windows took a lot of debugging (drivers, upload and serial port issues) before the board would flash reliably.
- Hardware debugging: I had to check wiring and I2C communication carefully to get the sensor responding with correct values.
- Secure cloud connection: Connecting the ESP32 to HiveMQ Cloud needed TLS and the correct credentials and port settings.
- Real-time data flow: Linking MQTT on one side and WebSockets on the other meant the backend had to pass messages through cleanly without delay.
What I learned
- How a full IoT pipeline fits together, from the device to the browser
- Working with I2C sensors and reading datasheets
- Using MQTT and the publish/subscribe model with a cloud broker
- Building a real-time backend with WebSockets
- Debugging both the hardware and the software side of an embedded project
Next steps
- Store the data in a database to show history and trends
- Add deep sleep so it can run on battery
- Move from breadboard to a soldered board in a proper enclosure
- Add alerts when values go above or below a set limit