Balcony solar power monitor

Measures output and yield of a plug-in solar kit with a PZEM meter and shows it on a web page or in Home Assistant.

Power & batteries Board: ESP32 DevKit V1 (WROOM-32) Level: ●●○ ⏱ 2–4 h

⛔ High risk

Mains 220–230 V can kill. Work with the power off, use certified isolated modules in an enclosure, fuse the line, and ask a qualified electrician if you are not sure.

What did the panels give today?

A plug-in solar kit with a micro-inverter feeds your home circuit directly. The PZEM measures the power on the inverter’s output, and the ESP32 adds up the daily yield. Compared with the panel’s rated power, it shows quickly if a panel is shaded, dirty, or the inverter limits itself.

Rules and limits

Check the local regulations and your utility’s rules before connecting anything to the grid. In some countries small kits up to a set power are allowed with registration, in others they are not. The PZEM shows the absolute power, not the direction, so measure on the inverter output only, not on the main feed.

  • Fuse, enclosure and a clean connection are as important as in the energy meter project.
  • Compare the kWh per day with the weather: a clear day should produce a smooth curve, and dents show shading.
  • Publish the daily total and keep a monthly history; it is the number you will want when you decide to add panels.

Components

  • ESP32 DevKit V1 (30 pin, WROOM-32)
  • PZEM-004T v3.0 (100A, coil)
  • Inline fuse holder + fuses
  • Plastic project enclosure
  • Lever connectors (WAGO type) 2/3-pin

Wiring

Module Module pin ESP32 pin Note
PZEM-004T TX / RX UART GPIO16 (RX) / GPIO17 (TX) the PZEM board is optically isolated; 5V from the PZEM supply side only to the opto
PZEM-004T AC in L / N on the AC side of the micro-inverter plug in an enclosure, qualified person
Current coil around L one live wire only

Code

esphome:
  name: balcony-solar

esp32:
  board: esp32dev
  framework:
    type: arduino

logger:
api:
  encryption:
    key: !secret api_key
ota:
  - platform: esphome
    password: !secret ota_password
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

time:
  - platform: homeassistant
    id: ha_time

uart:
  tx_pin: GPIO17
  rx_pin: GPIO16
  baud_rate: 9600

modbus:

sensor:
  - platform: pzemac
    current:
      name: "Solar current"
    voltage:
      name: "Grid voltage"
    power:
      name: "Solar power"
      id: solar_power
    energy:
      name: "Solar energy total"
    frequency:
      name: "Grid frequency"
    power_factor:
      name: "Power factor"
    update_interval: 10s
  - platform: total_daily_energy
    name: "Solar yield today"
    power_id: solar_power
    unit_of_measurement: "kWh"
    accuracy_decimals: 2
    filters:
      - multiply: 0.001

Build tips

  • The PZEM goes on the AC side of the micro-inverter, not on the panels.
  • Check the registration and plug rules for plug-in solar in your country before connecting to the grid.

What you need

Buy the parts kit · Estimated total: $20.00

ESP32 DevKit V1 (30 pin, WROOM-32) × 1
$4.00
Buy at AliExpress Buy at Amazon.com
PZEM-004T v3.0 (100A, coil) × 1
$9.00
Buy at AliExpress Buy at Amazon.com
Inline fuse holder + fuses × 1
$1.50
Buy at AliExpress Buy at Amazon.com
Plastic project enclosure × 1
$3.00
Buy at AliExpress Buy at Amazon.com
Lever connectors (WAGO type) 2/3-pin × 1
$2.50
Buy at AliExpress Buy at Amazon.com
🇺🇦 Ukraine🌍 Other countries

Ukraine: we buy and sell these parts ourselves, order them on this site.

Some links are affiliate links: we may earn a commission at no extra cost to you.

Related ideas

⛔ High risk

Mains 220–230 V can kill. Work with the power off, use certified isolated modules in an enclosure, fuse the line, and ask a qualified electrician if you are not sure.

Smart energy meter

Reads voltage, current, power and kWh with PZEM-004T and publishes them to a web page, MQTT or Home Assistant.

  • Board ESP32 DevKit V1 (WROOM-32)
  • Level ●●○ Intermediate
  • Build time 2–4 h
Pick parts / kit
⛔ High risk

Mains 220–230 V can kill. Work with the power off, use certified isolated modules in an enclosure, fuse the line, and ask a qualified electrician if you are not sure.

Mains voltage monitor

Measures 220 V mains through an isolated ZMPT101B module and warns about sags, surges and blackouts in Telegram or Home Assistant.

  • Board ESP32 DevKit V1 (WROOM-32)
  • Level ●●○ Intermediate
  • Build time 2–3 h
Pick parts / kit
⛔ High risk

Mains 220–230 V can kill. Work with the power off, use certified isolated modules in an enclosure, fuse the line, and ask a qualified electrician if you are not sure.

Inverter load manager

Watches the inverter / battery current and switches off non-critical loads with a relay when the battery runs low.

  • Board ESP32 DevKit V1 (WROOM-32)
  • Level ●●● Advanced
  • Build time 3–5 h
Pick parts / kit

← All module ideas →

Comments

No comments yet. Share your experience or ask a question.

Comments are moderated.