IoT Environmental Monitoring Station with OLED & Secure Telemetry
Build a low-power wireless weather node displaying local metrics on an OLED while streaming structured JSON telemetry via MQTT.
2. Prerequisites & Background Theory:
TCP/IP networking, MQTT publish-subscribe architecture, I2C bus sharing, and FreeRTOS task synchronization.
Goal & Engineering Objectives
Design a self-contained environmental sensing station measuring temperature, humidity, and barometric pressure, rendering live charts on an SSD1306 OLED and publishing authenticated telemetry over Wi-Fi.
Governing Mathematical Formulation & Physics
System Architecture & Block Flow Diagram
[BME280 Sensor (0x76)] --+
|--(Shared I2C Bus: 400 kHz)--> [ESP32 Dual-Core MCU]
[SSD1306 OLED (0x3C)] --+ |
v
[FreeRTOS Telemetry Task]
|
(Wi-Fi 802.11 b/g/n)
v
[MQTT Broker / Cloud 360]
Required Hardware Bill of Materials (BOM)
| Hardware Component | Qty | Engineering Specification |
|---|---|---|
| ESP32-WROOM-32 Development Board | 1 | 240 MHz Dual-Core, 4MB Flash, Integrated Wi-Fi/BLE |
| BME280 Atmospheric Sensor | 1 | Temperature, relative humidity, barometric pressure |
| SSD1306 0.96" Monochrome I2C OLED (128x64) | 1 | 128x64 pixel graphic display, address 0x3C |
| AMS1117-3.3 Linear Voltage Regulator | 1 | Clean 3.3V rail regulation with 10µF tantalum caps |
| 3.7V 18650 Li-Ion Rechargeable Battery (2600mAh) | 1 | Autonomous node power source |
Wiring, Pinout & Schematics Mapping
Firmware Implementation & Algorithms
// Non-blocking FreeRTOS Sensor & Display Task
#include <Wire.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 display(128, 64, &Wire, -1);
void vTelemetryTask(void *pvParameters) {
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
Wire.setClock(400000); // 400 kHz Fast Mode
while (1) {
float tempC = 24.85f; // Read from BME280
float pressure = 1013.2f; // Read from BME280
display.clearDisplay();
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
display.setCursor(0, 0);
display.println("Cloud 360 Weather");
display.printf("Temp: %.2f C\n", tempC);
display.printf("Pres: %.1f hPa\n", pressure);
display.display();
vTaskDelay(pdMS_TO_TICKS(1000));
}
}