Skip to the content
2 layers130.2 × 72.9 mmMicrogrid Home Energy Monitor, the printed circuit board in 3D

Microgrid Home Energy Monitor

dish-glitch/Microgrid-Home-Energy-Monitor1

I want to understand how power is measured, how the grid sees demand so I will try to build a custom PCB that clips non-invasive current transformer sensors around wires and measure real-time power usage I would like it to measure Watts. Apparent power (VA) and Power factor.

Size
130.2 × 72.9 mm
Copper layers
2
Thickness
1.6 mm
Parts
41
Nets
55
Pads
178
Tracks, vias
332, 34
Pours
2
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
10 Jun 2026
Updated
2 Nov 2026

Overview

Microgrid Home Energy Monitor is an open-source printed circuit board by dish-glitch, from the dish-glitch/Microgrid-Home-Energy-Monitor repository on GitHub, published under the MIT licence. It is a 2-layer board of 130.2 × 72.9 mm with 41 parts on 55 nets, routed with 332 tracks and 34 vias.

It is built around the ESP32-WROOM-32 and AMS1117-3.3. Its parts include 14 resistors, 9 capacitors, 6 connectors, 3 ICs and 2 diodes. It belongs with the sensors and measurement boards and the ESP32 boards of this library.

Main components

2

README

hardware/README.md

Hardware

Custom 2-layer PCB designed in KiCad 9. Measures real-time household power consumption using non-invasive current transformer sensors.


PCB Specifications

SpecValue
Layers2 (F.Cu / B.Cu)
Board dimensions~130mm × 75mm
Min trace width0.2mm signal / 0.4mm power
Min clearance0.15mm (accommodates the USB-C footprint's pad spacing; JLCPCB handles down to 0.127mm)
Copper pourGND flood on F.Cu + solid GND plane on B.Cu, joined by stitching vias
Via drill0.3mm min
Surface finishHASL (lead-free)
FabricationJLCPCB

Design Overview

Power Path

USB-C (5V VBUS) → AMS1117-3.3 linear regulator → 3.3V rail → ESP32 + all peripherals

CC1 and CC2 resistors (5.1kΩ to GND) identify the board as a USB device to the host charger, enabling 5V/500mA delivery per USB-C spec.

CT Sensor Signal Conditioning (per channel)

Each channel processes the AC output of an SCT-013-000 current transformer:

text
SCT-013 → 33Ω burden resistor → 10µF coupling cap → MCP6002 op-amp buffer → ESP32 ADC
                                    ↑
                          10kΩ/10kΩ bias divider (1.65V midpoint)
  1. Burden resistor (33Ω): The SCT-013 outputs a small currecnt but the ESP32 measures the voltage. The 33 ohm burden resisotr converts that currecnt into a voltage using Ohm's law. At the senors's max rated current, this produeces 1.65 V RMS 2.33 V peak.

  2. Bias divider (2× 10kΩ): Becuase the ESP32 ADC can't read negative voltages, 2 10k ohm resistors create a 1.65 V bais point.

  3. Coupling capacitor (10µF): Blocks DC from the burden resistor, and passes the 60Hz AC signal.

  4. MCP6002 buffer: Unity-gain op-amp buffer to keep the bais network independent from the ESP32 ADC. Its high imput impedance prevents the bais voltage from shifting.

Voltage Sensing

ZMPT101B voltage transformer connects to J6. its output is routed to GPIO36 which is an input-only ADC pin with no internal pull resistors, chosen to minimize noise on the analog signal.

I2C Bus

SDA (GPIO21) and SCL (GPIO22) pulled up to 3.3V via 4.7kΩ resistors. Pull-up value chosen for standard-mode I2C (100 kHz) with expected bus capacitance under 50pF.

ESP32 Boot Circuit

  • EN pulled high via 10kΩ (R7) + 100nF to GND for clean power-on reset
  • GPIO0 held high by the ESP32's internal pull-up; SW2 pulls GPIO0 low for bootloader entry (R10 was meant as an external pull-up, but rev 1 wires it EN ↔ GPIO0 — leave it unfitted, see Assembly Notes)
  • SW1 pulls EN low for hard reset

Schematic

See Microgrid-Home-Energy-Monitor.kicad_sch

Schematic


PCB Layout

See Microgrid-Home-Energy-Monitor.kicad_pcb

Key layout decisions:

  • Analog front-end (J1, J2, U2, bias resistors) grouped bottom-right, away from ESP32 WiFi antenna
  • ESP32 antenna overhangs the keepout zone — no copper pour under antenna area
  • AMS1117 decoupling caps (C3–C6) placed within 2mm of regulator pins
  • ESP32 VDD decoupling (C7, C8) placed directly below VDD pin
  • USB-C connector (J4) edge-mounted on right wall for direct cable access
  • Ground pour floods entire F.Cu layer

Bill of Materials

RefComponentValuePackageMPNSupplier
U1ESP32-WROOM-32—ModuleESP32-WROOM-32E-N4Mouser 356-ESP32WROOM32EN4
U2MCP6002 Op-Amp—DIP-8MCP6002-I/PDigikey MCP6002-I/P-ND
U3AMS1117-3.33.3V LDOSOT-223AMS1117-3.3Digikey 1665-1016-1-ND
J1, J2CT Sensor Input3.5mm jackSMDSJ-3523-SMTDigikey CP-3523SJCT-ND
J3OLED Connector4-pin2.54mm header—generic
J4USB-C Receptacle (optional, see notes)USB 2.0THT 16PGCT USB4085-GF-ADigikey 2073-USB4085-GF-ACT-ND
J5Programming Header6-pin2.54mm header—generic
J6ZMPT101B Connector3-pin2.54mm header—generic
R1, R4Burden Resistor (CH1, CH2)33Ω 1%0603—generic
R2, R3, R5, R6Bias Resistor (R2/R3 CH1, R5/R6 CH2)10kΩ0603—generic
R7EN Pull-up10kΩ0603—generic
R8, R9I2C Pull-up4.7kΩ0603—generic
R10GPIO0 Pull-up — do not fit on rev 1, see notes10kΩ0603—generic
R11, R12CC Pull-down (only needed with J4)5.1kΩ0603—generic
R13, R14LED Current Limit150Ω0603—generic
C1, C2Coupling Cap10µF0805—generic
C3, C6LDO Bulk Cap10µF0805—generic
C4, C5LDO Bypass Cap100nF0603—generic
C7ESP32 Bypass100nF0603—generic
C8ESP32 Bulk10µF0805—generic
C9EN Filter Cap100nF0603—generic
D1Power LEDRed3mm THT—generic
D2Status LEDGreen3mm THT—generic
SW1Reset Button—6mm THT—generic
SW2Boot Button—6mm THT—generic
CT1, CT2CT SensorSCT-013-000ClampSCT-013-000Amazon/AliExpress
VT1Voltage Sensor Module (plugs into J6)ZMPT101BModuleZMPT101BAmazon/AliExpress

Assembly Notes (rev 1)

Lessons from assembling the first board (solder paste + hot plate for SMD, iron for THT):

  • Read the 0603 resistor markings. The 10kΩ bias resistors are marked 01C (EIA-96) or 103. A part marked 01X is 10Ω — fitting those in R2/R3/R5/R6 puts two 20Ω paths across the 3.3V rail and looks exactly like a short (supply drops into CC, the resistors near U2 get warm).
  • R10 — do not fit. The BOM calls it a GPIO0 pull-up, but on the rev 1 PCB it is wired EN ↔ GPIO0, which drags GPIO0 low whenever RESET is pressed and can drop the ESP32 into download mode. The ESP32's internal pull-up on GPIO0 is enough, and SW2 still pulls it low to flash. Fix for rev 2: connect R10 between GPIO0 and +3.3V.
  • J1/J2 sit too far in from the board edge. The SCT-013's molded plug body hits the PCB before the plug seats fully, and the plug's metal collar scrapes the solder mask in front of each jack. On rev 1, trim about 1–2 mm off the underside of each plug body (sandpaper or a file, not a soldering iron), seal any exposed wire with nail polish or CA glue, and protect the board in front of the jacks with Kapton tape. Fix for rev 2: move J1/J2 so their openings are flush with, or slightly past, the board edge.
  • J2 is CH1 and J1 is CH2. J2 feeds R1/C1 → GPIO34 (PIN_CT1, real power + PF), J1 feeds R4/C2 → GPIO35 (PIN_CT2). Plug the clamp for the main load into J2.
  • J4 (USB-C) is optional. It is power-only (D+/D− are not connected). Without it, power the board from a 5V bench supply into the J4 VBUS and GND holes or TP1 (VBUS) / TP3 (GND), and leave R11/R12 off. In each J4 row the outermost small hole is GND and the next one in is VBUS; the four large oval slots are the shield and are not connected.
  • U2 orientation: pin 1 is the square pad, at the notch end next to TP2. A socket is worth it — the chip is easy to damage when desoldering.
  • Do the SMD reflow before any THT parts — headers, buttons and LEDs have plastic that will not survive the hot plate.
  • Programming: J5 needs only 3 wires to a CP2102 — GND→pin 1, TXD→pin 4 (RX0), RXD→pin 3 (TX0). Leave the adapter's 3V3/5V unconnected when the board has its own supply. There is no auto-reset circuit: hold BOOT (SW2), tap RESET (SW1), release BOOT, upload, then press RESET.
  • OLED pin order: many SSD1306 modules are GND, VCC, SCL, SDA, while J3 is 3.3V, GND, SCL, SDA. Wire by label with jumpers instead of plugging the module straight in.

Bring-up checklist

CheckExpected
TP2 (3.3V) ↔ TP3 (GND), continuity, unpoweredNo beep
5V supply, ESP32 with factory firmwareCV, ~0.11 A, D1 lit
TP23.3V
board-test sketch, no sensors connectedCT1 ≈ CT2 ≈ 1650 mV (bias midpoint), D2 blinking, BOOT button reported
OLED on J3I2C scan finds 0x3C

Design Verification

All fixes from the 2026-07-02 DRC audit are complete (verified with kicad-cli):

  • ERC: 0 errors. DRC: 0 violations, 0 unconnected items.
  • GND split-pour islands eliminated by adding a solid B.Cu ground plane with stitching vias — front pour fragments all tie to it, so pinch-offs can't strand a ground pin
  • ESP32 thermal vias enlarged to 0.3mm drill (JLCPCB 2-layer minimum)
  • Minimum clearance set to 0.15mm to fit the USB-C footprint's actual pad spacing

Fabrication Files

Gerber files for JLCPCB are in gerbers/ — exported from the DRC-clean board, ready to upload.

JLCPCB order settings:

  • Layers: 2
  • Dimensions: per gerber
  • PCB Qty: 5
  • PCB Color: Black
  • Surface Finish: HASL(lead-free)
  • Copper Weight: 1oz
  • All other settings: default

Parts

41
QtyValueFootprintReferences
610kResistor_SMD:R_0603_1608MetricR2, R3, R5, R6, R7, R10
5TestPointTestPoint:TestPoint_Pad_D1.5mmTP1, TP2, TP3, TP4, TP5
3100nFCapacitor_SMD:C_0603_1608MetricC4, C5, C9
310uCapacitor_SMD:C_0805_2012MetricC1, C2, C8
210uFCapacitor_SMD:C_0805_2012MetricC3, C6
2150Resistor_SMD:R_0603_1608MetricR13, R14
233Resistor_SMD:R_0603_1608MetricR1, R4
24.7kResistor_SMD:R_0603_1608MetricR8, R9
25.1kResistor_SMD:R_0603_1608MetricR11, R12
2AudioJack2Connector_Audio:Jack_3.5mm_CUI_SJ-3523-SMT_HorizontalJ1, J2
2LEDLED_THT:LED_D3.0mmD1, D2
2SW_PushButton_Switch_THT:SW_PUSH_6mm_H4.3mmSW1, SW2
10.1uCapacitor_SMD:C_0603_1608MetricC7
1AMS1117-3.3Package_TO_SOT_SMD:SOT-223-3_TabPin2U3
1Conn_01x03Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ6
1Conn_01x04Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalJ3
1Conn_01x06Connector_PinHeader_2.54mm:PinHeader_1x06_P2.54mm_VerticalJ5
1ESP32-WROOM-32RF_Module:ESP32-WROOM-32U1
1MCP6002-xPPackage_DIP:DIP-8_W7.62mmU2
1USB_C_Receptacle_USB2.0_16PConnector_USB:USB_C_Receptacle_GCT_USB4085J4

Similar boards

  • 2 layers90 × 76.5 mmLCDZapperPro, the printed circuit board in 3D

    LCDZapperPro

    charcole/LCDZapper

    Device for making light gun games playable on LCD TVs

    126 parts163
  • 2 layers85 × 56 mmHB RF ETH, the printed circuit board in 3D

    HB RF ETH

    alexreinert/PCB

    Some of my PCBs

    96 parts104
  • 2 layers62.2 × 30.5 mmWLED ESP32 Controller, the printed circuit board in 3D

    WLED ESP32 Controller

    Hasenpups/WLED_ESP32_Controller

    This work is licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License][cc-by-nc-sa].

    24 parts44
  • 2 layers150 × 50 mmEsp32-led smps, the printed circuit board in 3D

    Esp32-led smps

    lucysrausch/esp32-led-smps

    230V main LED smps. 2x30W Constant Current.

    179 parts30
  • 2 layers40 × 68 mmMULTIGW, the printed circuit board in 3D

    MULTIGW

    nuclearcat/ESP32ETH

    Simple ESP32 with native ethernet using LAN8720 phy, Arduino compatible

    32 parts30LGPL-2.1
  • 2 layers259.5 × 60.7 mm1512hh control, the printed circuit board in 3D

    1512hh control

    larryqiann/AP1512HH-ESP32

    Coway AP1512HH Main Board replacement with ESP32

    71 parts29CERN-OHL-P-2.0
  • 2 layers139.7 × 88.9 mmCharge Controller, the printed circuit board in 3D

    Charge Controller

    jharvey/Charge_Controller

    MPPT hardware which uses FUGU firmware

    163 parts24

Questions

How big is the Microgrid Home Energy Monitor PCB?

It measures 130.2 × 72.9 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Microgrid Home Energy Monitor use?

41 parts, built around the ESP32-WROOM-32 and AMS1117-3.3. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Microgrid Home Energy Monitor KiCad files?

From the dish-glitch/Microgrid-Home-Energy-Monitor repository on GitHub, at the commit this page was made from: the board is hardware/Microgrid-Home-Energy-Monitor.kicad_pcb and its schematic hardware/Microgrid-Home-Energy-Monitor.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Microgrid Home Energy Monitor design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).