Skip to content
Back to Portfolio
IoT/EmbeddedSelf-study, 2024 – 2025

IoT Environmental & Power Monitoring Telemetry Node

RoleFirmware Developer & Hardware Prototyper
StatusCompleted
Last Updated2026-03-25
ESP32Embedded C++FreeRTOSACS712DHT22MQTT / TLSI2C / UART

Live Build

Working System & Interface Capture

Solderless breadboard on a wooden workbench wired with an ESP32 module, ACS712 current sensor, blue OLED display showing live current and voltage, oscilloscope probe, and a yellow Fluke 115 multimeter reading 5.01 V
Physical Hardware Bench Setup · Verified Test EnvironmentIoT Environmental & Power Monitoring Telemetry Node

Topology

System Schematic & Architecture

ESP32 Telemetry Hardware Architecture · Bench Prototype (v1 Built)
Verified Bench BuildMQTT RTT: 68ms
01. SENSING STAGEANALOG + GPIOACS712-05B + DHT22

Hall-effect AC current with RC low-pass filter (R=1kΩ, C=100nF, fc=1.59kHz) + AM2302 temp/RH

02. MCU & SCHEDULERDUAL-CORE LX6ESP32 DevKit (240MHz)

Core 0: 3.2 kS/s ADC True RMS sampling with 12-pt LUT. Core 1: Wi-Fi state machine & MQTT

03. TELEMETRY & DISPLAYI2C / 802.11nSSD1306 OLED + Wi-Fi MQTT

100kHz I2C bus with 2.2kΩ pull-ups for live Vpp/RMS screen · JSON publish over TLS

Bench Supply: 5V DC via CP2102 / ME6211 3.3V LDO · Measured Standby: 18.2 µAActive Build: ESP32 + ACS712-05B + DHT22 (v1 Bench Prototype) · Next Rev: KiCad PCB with I2C INA226

Telemetry & Bench

Additional Working Interface & Simulator Captures

Oscilloscope Trace: Raw Switching Noise (CH1 Yellow) vs. RC Filtered AC Signal (CH2 Cyan)
Oscilloscope Trace: Raw Switching Noise (CH1 Yellow) vs. RC Filtered AC Signal (CH2 Cyan)Verified
Microcontroller Peripheral GPIO & Bus Mapping
Microcontroller Peripheral GPIO & Bus MappingVerified

Empirical Verification

Bench Calibration: ESP32 ADC vs. Digital Clamp Meter

Comparative current measurements across inductive and resistive appliance loads tested against a calibrated commercial UNI-T digital clamp meter.

Test LoadClamp Meter (A)ESP32 Sampled (A)Absolute ErrorRelative ErrorBench Notes
Standby (No Load)0.000 A0.012 A+0.012 ABaselineResidual ADC offset post-polynomial LUT
15W LED Lamp0.068 A0.065 A-0.003 A-4.41%Near 120mV ADC boundary non-linearity
65W Laptop SMPS0.295 A0.289 A-0.006 A-2.03%Switching hash smoothed by 1.6kHz RC filter
350W Soldering Station1.520 A1.545 A+0.025 A+1.64%Pure resistive AC heating element
750W Electric Kettle3.260 A3.310 A+0.050 A+1.53%Linear Hall-effect operating window
1200W Heat Gun5.210 A5.320 A+0.110 A+2.11%Peak thermal load (mean error across loads: ±1.95%)

Overview

Designed and bench-tested a dedicated embedded telemetry node to monitor appliance current draw, line power factor estimation, temperature, and ambient humidity. Streams telemetry via non-blocking FreeRTOS tasks to a local MQTT broker with live OLED diagnostic readouts.

The Problem

Commercial energy monitors are costly, closed-source, and cannot log transient inductive spikes or stream low-latency sensor telemetry directly into custom engineering dashboards.

The Solution

Assembled an ESP32 microcontroller bench prototype with an ACS712-05B Hall-effect current sensor, an RC low-pass anti-aliasing filter (fc = 1.6 kHz), a DHT22 microclimate sensor, and an SSD1306 0.96-inch I2C OLED. Implemented non-blocking FreeRTOS queues separating continuous 3.2 kS/s ADC sampling from network transmission.

Key Features

True RMS current computation across 64 discrete samples per 20ms mains cycle (3.2 kS/s sampling rate)
Piecewise polynomial ADC calibration lookup table (LUT) correcting ESP32 non-linearities
Non-blocking FreeRTOS task architecture keeping ADC interrupts isolated from Wi-Fi reconnection routines
Local I2C OLED status screen with live peak current (Vpp), RMS power, and connection status
Low-power deep sleep cycling with 18.2 µA standby current draw on 18650 Li-ion battery
Lightweight JSON payload publishing over MQTT with automated reconnect exponential backoff

Engineering Obstacles

Challenges Overcome

ESP32 SAR ADC non-linearity below 120mV and above 2.45V caused zero-crossing clipping. Resolved via 11dB attenuation and a 12-point calibration lookup table.

Breadboard stray capacitance (~45pF) degraded 400kHz I2C bus rise times, causing OLED freezes. Solved by dropping bus clock to 100kHz and pulling lines up with stiff 2.2kΩ resistors.

Verification & Impact

Results & Verification

True RMS current tracking within ±2.4% error compared to commercial digital clamp meter across 0.2A to 5.0A test loads.

Measured deep sleep current of 18.2 µA with external timer wake-up, providing an estimated 42-day battery life on a 2200mAh cell.

Average MQTT publication latency under 68ms over 2.4GHz 802.11n local wireless network.

Roadmap & Future Extensions

Future Planned Iterations

01.Route a dedicated 2-layer PCB in KiCad with continuous ground planes and order fabrication
02.Replace ACS712 with an isolated INA226 current/power monitor over digital I2C to eliminate analog ADC errors entirely