How techsmithlab/embedded-iot-energy-monitoring-esp32 works
This is an ESP32 smart-energy monitor and load controller. Its principal workflow samples AC voltage and current, calibrates and converts them to RMS readings, derives apparent power, accumulates energy, then presents readings locally and uploads telemetry over Wi-Fi; relay control is an additional load-control capability. The graph preserves calibration, persistence, and both cloud options. The main sketch is present in the tree but was not excerpted, so orchestration edges follow the README’s documented workflow rather than claims about unsampled calls.
Main entry points: smart_energy_monitor.ino Firmware workflow · cloud.cpp Cloud telemetry · sensors.cpp Sensor acquisition · calibration.cpp Calibration routine
Components 16
Measurement
- Sensor acquisition
firmware/smart_energy_monitor/sensors.cpp - Calibration routine
firmware/smart_energy_monitor/calibration.cpp
Processing
- Firmware workflow
firmware/smart_energy_monitor/smart_energy_monitor.ino - Energy accumulation
firmware/smart_energy_monitor/energy.cpp - ESP32 NVS
Device I/O
- LCD display
firmware/smart_energy_monitor/display.cpp - I2C LCD
- Relay control
firmware/smart_energy_monitor/relay_control.cpp - Connected load
Connectivity
- Wi-Fi manager
firmware/smart_energy_monitor/wifi_manager.cpp - Wi-Fi network
- Cloud telemetry
firmware/smart_energy_monitor/cloud.cpp - ThingSpeak
- Blynk
Other components
- AC system
- Serial operator
Connections 17
- AC system → Sensor acquisition: provides signals
README.md - Firmware workflow → Sensor acquisition: reads measurements
README.md - Firmware workflow → Energy accumulation: updates energy
README.md - Sensor acquisition → Calibration routine: measures offsets
firmware/smart_energy_monitor/calibration.cpp - Firmware workflow → Calibration routine: runs calibration
README.md - Energy accumulation → ESP32 NVS: persists energy
firmware/smart_energy_monitor/energy.cpp - Firmware workflow → LCD display: shows readings
README.md - LCD display → I2C LCD: writes display
firmware/smart_energy_monitor/display.cpp - Firmware workflow → Relay control: controls relay
README.md - Relay control → Connected load: switches load
README.md - Firmware workflow → Wi-Fi manager: manages connection
README.md - Wi-Fi manager → Wi-Fi network: connects to
firmware/smart_energy_monitor/wifi_manager.cpp - Firmware workflow → Cloud telemetry: uploads telemetry
README.md - Cloud telemetry → Wi-Fi network: checks connection
firmware/smart_energy_monitor/cloud.cpp - Cloud telemetry → ThingSpeak: sends HTTP update
firmware/smart_energy_monitor/cloud.cpp - Cloud telemetry → Blynk: runs integration
firmware/smart_energy_monitor/cloud.cpp - Serial operator → Calibration routine: starts routine