IoT Room Safety Dashboard
- Hardware
- ESP32 (dual-core FreeRTOS)
- Protocol
- MQTT over HiveMQ Cloud
- Frontend
- Vite + React
A room safety monitoring system built as a final IoT project. The ESP32 firmware reads environmental sensors and streams data to a React dashboard via MQTT. Telegram notifications fire when sensor values cross safety thresholds.
Firmware architecture
The ESP32 runs two FreeRTOS tasks on separate cores — one handles sensor polling, the other manages MQTT publishing and actuator control. This keeps the sensor read loop from blocking on network latency.
// Core 0: sensors + actuators
xTaskCreatePinnedToCore(sensorTask, "sensors", 4096, NULL, 1, NULL, 0);
// Core 1: MQTT + Telegram + OTA
xTaskCreatePinnedToCore(networkTask, "network", 8192, NULL, 1, NULL, 1);Sensors monitored
- DHT22 — temperature and humidity
- MQ-2 — smoke / combustible gas
- PIR — motion detection
- HC-SR04 — ultrasonic distance (door status)
Web dashboard
The React frontend connects directly to HiveMQ Cloud via WebSocket MQTT. No backend server — the browser subscribes to the same topics the ESP32 publishes to. History is charted with Recharts and exportable as CSV.
OTA firmware updates are handled via ArduinoOTA, so reflashing doesn’t require physical access to the device.