Skip to main content
Version: FILS English

Energy monitor

A device that analyzes electric power consumption

info

Author: Țăranu Vladimir-Teodor
GitHub Project Link: https://github.com/UPB-PMRust-Students/fils-project-2026-domnulvlad

Description

The project involves a measurement device installed within a distribution box, which monitors AC power consumption in real-time, and a portable dashboard which displays live data.

It operates by continuously sampling voltage and current sensors, to calculate the real power being consumed. The device processes analog data to determine the phase shift between the sine waves of voltage and current, which allows it to compute the power factor.

The main (measurement) device features a built-in LCD, but considering distribution boxes may not be easily accessible, a secondary (dashboard) device, with a larger touchscreen LCD, communicates with the power meter to provide the user with the same data in a more convenient format and logs to an SD card.

Both devices are based around the ESP32-C6, and they communicate wirelessly via the proprietary ESP-NOW protocol. It is bidirectional, features fast data rates, low latency, and operates in the 2.4 GHz spectrum using Wi-Fi hardware.

Motivation

I have always been interested in the efficiency of the devices we use every day, and the power factor is a very important part of this. Also, by having a system that provides a good estimate of your electricity consumption, you can stay aware of your habits and optimize them, to conserve energy and save some money on your bills.

Architecture

Components

The system is divided into two independent devices which communicate wirelessly.

ComponentInterface
MicrocontrollersESP-NOW
Current sensorvariable voltage
Voltage sensorvariable voltage
DisplaysMIPI-DSI
TouchscreenSPI
SD cardSPI

Diagram

Diagram

Log

Week 4-5

  • Research
  • Ordered parts
  • Started working on software

Week 6-8

Implemented on dashboard:

  • simple code for an 8080-parallel LCD I had laying around, will be replaced with MIPI-DSI once the new display arrives
  • only for testing, I implemented ESP-NOW communication in Arduino; will port to Rust

Implemented on measurement device:

  • data processing algorithm (untested, sensors haven't arrived yet)
  • basic ESP-NOW communication
  • graphical gauge on the round LCD

Gauge

Week 9

Started working on this documentation.

Hardware

Both the measurement device and the dashboard are based on the ESP32-C6 microcontroller. They have built-in ST7789 displays of different sizes.

The measurement device samples an SCT-013 non-invasive current clamp a ZMPT101B isolated transformer module.

The dashboard's interface is controller by a resistive touchscreen processed by an XPT2046. For data storage, a standard SD card is used.

Bill of Materials

DeviceUsagePrice
ESP32-C6Microcontrollers2 * 20 RON
SCT-013Non-invasive current clamp25 RON
ZMPT101BIsolated voltage transformer module15 RON
0.96in ST7789Display on measurement device25 RON (2 years ago)
2.8in ST7789+XPT2046Display on dashboard50 RON

Schematics

TODO

Photos

TODO

Software

Crates

CrateDescriptionUsage
esp-halno-std hardware abstraction layer for ESP32Support for the ESP32-C6
embassyAsync frameworkCooperative multitasking
mipidsiGeneric MIPI-DSI driverDriver for the ST7789 displays
embedded-graphics2D graphics libraryDrawing graphics on the displays
u8g2-fontsU8g2 font systemBetter fonts for embedded-graphics
micromathMath libraryTrigonometric functions
bytemuckSafe byte operationsSerialization and deserialization for ESP-NOW data

Design

TODO

  1. LCD tutorial
  2. SD card tutorial
  3. ESP-NOW example
  4. Old Arduino library for energy monitoring