elecgen · Dom1 panelUA

Novi Bezradychi · railway grid line · queue 1.1

A mains sensor for the Dom1 switchboard

Three meters sit on the incoming phases before the transfer switch, and the ESP32 runs on the inverter. So the sensor can tell a grid outage from a lost connection. Below is the panel built from the model, with every install step shown on it.

phases watched
L1 · L2 · L3
errors in the build
0
DIN modules
18/24
inside the box
~37 °C
Go to the install plan
Sensor panel front view: breakers, neutral terminals, power supply, three PZEM meters, ESP32 and wiringQF1 C2Живлення PZEMQF2 C2Живлення БЖNN мережі (до АВР)N~N інвертора5 VБЖ 5 В від інвертораL1·1PZEM фаза L1L2·2PZEM фаза L2L3·3PZEM фаза L3SELVШина 3V3 / GND / TX / RXESP32ESP32 (ESPHome)Діод TX PZEM 1Діод TX PZEM 2Діод TX PZEM 3grid pre-ATSщит Дом1: вихідні клеми вводного SEZ PR63 C32 3P, до контактора АВР CNN 32after ATSщит Дом1: вихід контактора CNN 32 — сюди датчик НЕ підключаютьinverterгрупа від виходу інвертора Дом1, автомат C16 1P
The panel is drawn from the same description the engine checks: rail slots, terminals and wire colours. PZEM board and holder sizes are approximate.

Install plan

Each step highlights its parts on the panel. Marked steps are live or next to live parts and are done by the electrician.

Before the visit: firmware and addresses on the bench
  1. P1. Flash the ESP32 on the bench

    • Connect the ESP32 to a laptop over USB (no 230 V on the bench yet).
    • Create secrets.yaml from secrets.example.yaml (panel-room Wi-Fi, OTA password, two Healthchecks links).
    • Flash esphome/pzem-set-address.yaml with esphome run.
  2. P2. Set the PZEM addresses one at a time

    • Bench: extension lead with a 30 mA RCD, PZEM in a closed box, L/N terminals covered. One meter at a time.
    • TTL side: 3V3, GND, ESP32 TX → meter RX, meter TX → diode → ESP32 RX.
    • Enter the new address on the page: A1 → L1 = 1, A2 → L2 = 2, A3 → L3 = 3.
    • Unplug, mark the meter (phase and address), next one.
  3. P3. Flash the working config

    • Run esphome/dom1-sensor.yaml with esphome run over USB.
  1. S1 electrician

    Isolate the supply and prove it dead

    • Switch off the grid main breaker in the Dom1 panel (SEZ PR63 C32 3P “city”). Its line-side terminals stay live — do not touch. Generator off; leave the Hager SFT 340 switch to the electrician.
    • Switch off the inverter group breaker (C16 1P): the inverter output is live even without grid!
    • Hang a “Do not switch on — work in progress” tag, lock the panel or tape the breakers.
    • With a two-pole voltage tester: prove the tester on a known source → check for no voltage L1–N, L2–N, L3–N, L1–L2, L2–L3, L1–L3, L–PE at the tap point and on the inverter group → prove the tester again.
    • No voltage at any point we will work on (tester good before and after).
  2. S2

    Mount the box and rails

    • Surface box 2 × 12 modules, IP40, plastic: on the wall next to the Dom1 panel, cable entries at the top.
    • Conduit from the panel to the box no longer than 3 m (the tap is unprotected at its start).
    • Box level, fixings hold, cover needs a tool to open.
  3. S3

    Top row: breakers, neutral terminals, power supply

    • QF1 (3P C2) feeds the meters; QF2 (1P C2) feeds the power supply.
    • Two separate N terminals: grid before ATS and inverter output. NO bridge between them.
    • G1 — Mean Well HDR-15-5 on the right.
    • Rail labels: “grid N”, “inverter N”.
  4. S4

    Bottom row: meters, low-voltage terminals, ESP32

    • PZEM boards on DIN PCB holders: L1, L2, L3 left to right, 230 V terminals up.
    • 3V3 / GND / TX / RX terminal block and ESP32 on the right, apart from the 230 V terminals.
    • Gap between the PZEM boards and the ESP32; PZEM 230 V terminals can't reach the low-voltage wires.
  5. S5

    Mains to the meters: L1/L2/L3 and N

    • From QF1: L1 brown, L2 black, L3 grey; N blue.
    • PV-3 1.0 mm² with ferrules, screws torqued to the maker's value.
    • Each PZEM on the phase written on it and in the config.
    • Continuity: each PZEM L terminal ↔ its breaker pole; all three N ↔ “grid N”.
  6. S6

    Power supply from the inverter

    • QF2 → power supply L, “inverter N” → power supply N.
    • Continuity: power supply N does NOT ring through to “grid N”.
  7. S7

    Low voltage: ESP32 power, bus, diodes

    • PSU +V → ESP32 VIN, −V → GND. ESP32 3V3 and GND → terminal block → VCC/GND of each PZEM.
    • ESP32 TX (GPIO17) → TX terminal → RX of all three PZEM.
    • TX of each PZEM → cathode of a 1N4148 (band to the meter), the three anodes → RX terminal → GPIO16.
    • NV 0.5 mm² 600 V wire, not Dupont jumpers; keep the harness apart from 230 V wires.
    • Multimeter: diode conducts from RX to meter TX, not back. 3V3 not shorted to GND.
  8. S8 electrician

    Checks before energising

    • Visual: all screws, ferrules, phase marking, PZEM terminal covers.
    • 500 V insulation tester on the tap cables (meters and PSU disconnected!): ≥ 1 MΩ between L1, L2, L3, N.
    • Insulation ≥ 1 MΩ; record it.
  9. S9 electrician

    Connect the taps in the Dom1 panel

    • Grid: load terminals of the SEZ PR63 C32 3P grid main, before the ATS contactor CNN 32 — where only the railway line is present.
    • Inverter: the C16 1P inverter output group.
    • The electrician confirmed: grid point before the ATS, inverter point after the inverter.
  10. S10 electrician

    Energise and verify phases

    • Remove tags, switch on the inverter group, then QF2: ESP32 boots, Healthchecks “link” is green.
    • Switch on the grid main, then QF1: three voltages on the ESP32 page.
    • Multimeter L1–N, L2–N, L3–N at the PZEM terminals — matches its phase reading (±2 V).
    • All three phases within 207–253 V and match the multimeter phase by phase.
  11. S11

    Test the alarms

    • Switch QF1 off: within ~30 s “L1, L2, L3 lost”, ESP32 stays up, Healthchecks “grid” turns red.
    • Switch QF1 on: the alarm clears.
    • Turn off the router or Wi-Fi: within 180 s Healthchecks “link” turns red.
    • Both alerts arrived and differ: “grid” ≠ “link”.
  12. S12

    Close the box and document

    • Cover on, diagram inside the door, QF1/QF2 labels, “Dom1 mains sensor”.
    • Photo of the box into the house project folder.
    • Cover closed, boards reachable only with a tool.

What stops the install

Typical mistakes. The engine passes none of them: each one is an error with an explanation, not a warning. Engine output is in Ukrainian.

What the engine checked

Calculations and assumptions for this build. There are no errors, so only notes and warnings are listed. Engine output is in Ukrainian.

What the sensor reports

Limits follow EN 50160. The grid alarm and the link alarm are separate Healthchecks checks, so they can't be confused.

Phase lostmeter silent for over 30 s
Voltage out of range207–253 V
Frequency out of range49.5–50.5 Hz
Phase unbalance≤ 2 %
No link to the panel180 s

Where to buy

Prices and stock checked on 2026-11-14. Nothing is bought until the owner says yes. Item names are in Ukrainian.

ItemUkrainePriceStockAbroad
Вимірювач PZEM-004T v4.0 100 А з трансформатором струму × 3Prom.ua395 UAHнемаєAliExpress
Плата ESP32 DevKit 30 pin з CH340CProm.ua245 UAHв наявностіAliExpress
Блок живлення Mean Well HDR-15-5 на DIN-рейкуmeanwell.kiev.ua524 UAHв наявностіAliExpress
Автоматичний вимикач 3P C2, 6 кА220volt1,024 UAHв наявності—
Автоматичний вимикач 1P C2, 6 кА220volt343 UAHв наявності—
Щит навісний пластиковий 24 модулі (2×12), IP40220volt926 UAHв наявності—
Діоди 1N4148 (10 шт.), варіант — Шотткі BAT85 × 10Mini-Tech1 UAHв наявності—
Тримач друкованої плати на DIN-рейку × 4arduino.ua53 UAHв наявностіAliExpress
Провід ПВ-3 2,5 мм² (коричневий, чорний, сірий, синій) × 4Prom.ua32 UAHв наявності—
Провід ПВ-3 1,0 мм² × 5Епіцентр15 UAHв наявності—
Провід НВ 0,5 мм² 600 В або МГШВ 0,5 × 5Prom.ua6 UAHв наявності—
Кабель ПВС 3×1,5 × 3Епіцентр73 UAHв наявності—
Клеми на DIN, наконечники НШВІ, гофра 16 ммProm.ua7 UAHв наявності—

What we don't know yet

The electrician's brief (Word, Ukrainian) is in the elecgen project: docs/TZ-ELECTRICIAN-DOM1.docx. The owner hands it over.