Skip to the content
2 layers31 × 39 mmDesk power monitor mini32 ac, the printed circuit board in 3D

Desk power monitor mini32 ac

netrondev/netron_esp32_lora_ac1

A mains current monitor built on an ESP32 and an SX1262 radio. It measures AC current through an ACS712 hall-effect sensor and reports it over LoRaWAN as an OTAA Class A device.

Size
31 × 39 mm
Copper layers
2
Thickness
1.6 mm
Parts
25
Nets
50
Pads
90
Tracks, vias
143, 5
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
5 Oct 2026
Updated
5 Oct 2026

Overview

Desk power monitor mini32 ac is an open-source printed circuit board by netrondev, from the netrondev/netron_esp32_lora_ac repository on GitHub, published under the Apache-2.0 licence. It is a 2-layer board of 31 × 39 mm with 25 parts on 50 nets, routed with 143 tracks and 5 vias.

It is built around the 220UF 10V 5*7, CY75-220UH and MB10S(46MIL), with the US1M among its other parts. Its parts include 5 capacitors, 5 resistors, 5 connectors, 4 diodes and 2 ICs. It belongs with the ESP32 and RISC-V boards of this library.

Main components

4

README

README.md

ESP32 LoRaWAN AC current monitor

A mains current monitor built on an ESP32 and an SX1262 radio. It measures AC current through an ACS712 hall-effect sensor and reports it over LoRaWAN as an OTAA Class A device. The repo also includes a small network server so you can receive the reports and configure devices remotely, plus the KiCad hardware.

Everything is written in Rust except the payload codec, which is plain JavaScript so it can be pasted into ChirpStack, The Things Network or Node-RED.

How the pieces fit together

text
ACS712 current sensor
  └─ ESP32 + SX1262           firmware/           OTAA Class A device
       ~ 868.1 MHz SF7 ~
  └─ Milesight UG63 gateway                       Semtech UDP packet forwarder
       └─ software/lorans                         network server: joins, keys,
                                                  uplink decode, downlink queue

The gateway's own network server is not used. It has no usable downlink route: there's no HTTP endpoint, and its MQTT application forwarder reboots the gateway. Without downlinks there's no remote configuration. So the gateway runs as a plain packet forwarder, and software/lorans does the network server's job. software/lorans/README.md has the details.

Any gateway that speaks the Semtech UDP protocol should work in place of the UG63. Alternatively, the devices can join a standard network server such as ChirpStack, using the codec in software/loradecode.

DirectoryWhat it is
firmware/ESP32 firmware. Measures current, joins by OTAA, reports aggregated min/avg/max, applies configuration downlinks
software/lorans/Network server. Run this to receive uplinks and send commands
software/loradecode/JavaScript payload decoder and command encoder for ChirpStack, TTN or Node-RED
software/milesight_d4/Milesight gateway HTTP client: status, device list, forwarder mode, payload decode/encode
software/loramqtt/Minimal MQTT broker, kept for diagnosing the gateway's MQTT forwarding
docs/PROTOCOL.mdUplink channel map and downlink command set
diagram/System overview: power supply, sensing, MCU and radio
hardware/KiCad schematics, PCBs and JLCPCB fabrication outputs
scripts/Build, flash and monitor helpers

Hardware

  • MCU: ESP32 Mini32 (Wemos D1 Mini ESP32 form factor)
  • Radio: Ai-Thinker Ra-01SH (SX1262), 868 MHz
  • Sensor: ACS712-20A on GPIO34 through a voltage divider. RMS current is computed over one 50 Hz cycle of oversampled ADC readings
  • Power: MB10S bridge rectifier into a BP2525 non-isolated buck, 5 V from 230 V mains
SX1262ESP32
NSSGPIO5
RESETGPIO27
DIO1GPIO26
SCKGPIO18
MISOGPIO19
MOSIGPIO23

BUSY isn't wired to the ESP32. The driver waits a fixed settling time after each command instead, and detects TxDone/RxDone from DIO1. The status LED is on GPIO2.

Warning: the power supply is non-isolated, so the whole board sits at mains potential. Don't touch it or connect USB while it's powered from mains.

Device identity and keys

DevEUIDerived from the ESP32's MAC: OUI FF FE NIC
JoinEUI0000000000000000
AppKeyThe DevEUI repeated, e.g. E08CFEFFFE34C3AC → E08CFEFFFE34C3ACE08CFEFFFE34C3AC

This follows the Milesight convention, so a device can be onboarded from nothing but its join request. It also means the AppKey is not a secret. That's fine for a private network on a private gateway. If you need real over-the-air security, give each device a random AppKey. docs/PROTOCOL.md covers this, along with the payload format.

Getting started

Toolchain

The ESP32 needs Rust's Xtensa toolchain. Install it with espup, which writes ~/export-esp.sh, then install espflash:

bash
cargo install espup espflash
espup install

Alternatively, build inside Docker with the image in firmware/. scripts/build.sh and scripts/flash.sh use it:

bash
docker build -t esp32-rust firmware/

Flash and monitor a device

The scripts find the serial port automatically, or you can pass it explicitly:

bash
./scripts/flash_native.sh            # host toolchain: build, flash, print the MAC
./scripts/flash.sh /dev/ttyUSB0      # same, building in Docker
./scripts/monitor.sh                 # serial monitor in Docker (CTRL+R resets, CTRL+C exits)

Run the network server

Point the gateway's packet forwarder at this host on UDP port 1700, then start the network server:

bash
cargo run --manifest-path software/lorans/Cargo.toml

It accepts joins, decodes uplinks and queues downlinks. Commands go to a control socket on 127.0.0.1:7788. A queued downlink is sent in the receive window after the device's next uplink. Intervals are in seconds:

bash
echo 'downlink E08CFEFFFE34C3AC report=60 sample=5 jitter=10' | nc -q1 127.0.0.1 7788
echo 'list' | nc -q1 127.0.0.1 7788

Milesight gateway

Copy software/milesight_d4/config.json.example to config.json and add the gateway's address and login. Then:

bash
cargo run --manifest-path software/milesight_d4/Cargo.toml -- status
cargo run --manifest-path software/milesight_d4/Cargo.toml -- set-forwarder semtech 192.168.1.100

Firmware behaviour

  • Joins by OTAA, retrying with exponential backoff
  • Samples current every sample seconds and accumulates min/avg/max
  • Sends one confirmed, aggregated report every report seconds, offset by a random ± jitter seconds so devices don't collide. An unacknowledged report is retried once
  • Re-joins if the network stops acknowledging
  • Applies configuration downlinks (intervals, jitter, reboot) and echoes each applied setting back as confirmation
  • Keeps cumulative energy (mAh), frame counters, the join nonce and its configuration in flash across power cycles

LED

PatternMeaning
Short blink every ~0.5 sNot joined yet, trying to join
Short blink per sampleJoined and measuring normally
Rapid triple blinkADC error: sensor disconnected, or the reading saturated at 0 or 4095

Troubleshooting

  • xtensa-esp32-elf-gcc not found: run source ~/export-esp.sh first.
  • Permission denied on the serial port: add yourself to the dialout group, or sudo chmod 666 /dev/ttyUSB0.
  • Device not found: check ls /dev/ttyUSB* /dev/ttyACM*.
  • espflash asks for a chip or port inside Docker: pass --chip esp32 -p <port> explicitly.
  • Flashing fails to connect: hold BOOT while flashing, and release it after "Connecting...".

License

Licensed under either of

at your option.

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Parts

25
QtyValueFootprintReferences
2100nFCapacitor_SMD:C_0805_2012MetricC1, C5
210kResistor_SMD:R_0805_2012MetricR1, R2
21KResistor_SMD:R_0805_2012MetricR3, R5
10.68RResistor_SMD:R_0805_2012MetricR4
11N4148WS-C57759easyeda2kicad:SOD-323_L1.8-W1.3-LS2.5-RD-1D2
11nFCapacitor_SMD:C_0805_2012MetricC2
1220uF/10VCapacitor_SMD:CP_Elec_6.3x7.7C4
14.7µF / 400V electrolyticCapacitor_THT:CP_Radial_D8.0mm_P3.50mmC3
1AC Live INConnector_Wire:SolderWire-2.5sqmm_1x01_D2.4mm_OD3.6mmJ4
1AC Live OUTConnector_Wire:SolderWire-2.5sqmm_1x01_D2.4mm_OD3.6mmJ3
1AC Neutral INConnector_Wire:SolderWire-2.5sqmm_1x01_D2.4mm_OD3.6mmJ5
1ACS712xLCTR-20APackage_SO:SOIC-8_3.9x4.9mm_P1.27mmU2
1CY75-220UHeasyeda2kicad:IND-SMD_L7.8-W7.0-AL2
1FuseFuse:Fuse_1206_3216MetricF1
1LEDDiode_SMD:D_0805_2012MetricD1
1MB10S(46MIL)easyeda2kicad:MBS_L4.7-W4.0-P2.50-LS7.0-BLD4
1US1MDiode_SMD:D_SMAD3
1esp32-pins-header-leftConnector_PinHeader_2.54mm:PinHeader_2x10_P2.54mm_VerticalJ1
1esp32-pins-header-rightConnector_PinHeader_2.54mm:PinHeader_2x10_P2.54mm_VerticalJ2
1~easyeda2kicad:SOT33-5A_L3.9-W2.6-P0.90-BP2525DU1

The 23 most common of 25 parts.

More from netrondev/netron_esp32_lora_ac

2
  • 2 layers31 × 39 mmDesk power monitor mini32 ac, the printed circuit board in 3D

    Desk power monitor mini32 ac

    netrondev/netron_esp32_lora_ac

    A mains current monitor built on an ESP32 and an SX1262 radio. It measures AC current through an ACS712 hall-effect sensor and reports it over LoRaWAN as an OTAA Class A device.

    14 parts1Apache-2.0
  • 2 layers31 × 39 mmDesk power monitor mini32 lora, the printed circuit board in 3D

    Desk power monitor mini32 lora

    netrondev/netron_esp32_lora_ac

    A mains current monitor built on an ESP32 and an SX1262 radio. It measures AC current through an ACS712 hall-effect sensor and reports it over LoRaWAN as an OTAA Class A device.

    8 parts1Apache-2.0

Similar boards

  • 2 layers89.2 × 103.5 mmOas, the printed circuit board in 3D

    Oas

    hubertciebiada/open-ambient-sensor

    OAS — Open Ambient Sensor: DIY multi-sensor indoor environmental monitor (CO2, PM, VOC/NOx, temperature/humidity, mmWave presence) on ESP32-C6 with ESPHome / Home Assistant integration

    64 parts44GPL-3.0
  • 4 layers95 × 76.2 mmDeWille Control, the printed circuit board in 3D

    DeWille Control

    zmeiresearch/DeWille

    A high-performance DIY audio DAC

    171 parts23
  • 4 layers170 × 101 mmFreeDSP G, the printed circuit board in 3D

    FreeDSP G

    freeDSP/FreeDSP-G

    ADAU1467 DSP Board for Electric Guitar Players

    377 parts7CC0-1.0
  • 2 layers66 × 58.4 mmCC SSD 02, the printed circuit board in 3D

    CC SSD 02

    attachix/ukit-pcb

    The PCBs needed to create the U:Kit sensor kit.

    42 parts1
  • 2 layers98.5 × 16 mmPCB design Course, the printed circuit board in 3D

    PCB design Course

    AvishkaVishwa/12V-to-5V-DC-Conveter

    12 parts1
  • 2 layers65 × 56 mmRpi with supply, the printed circuit board in 3D

    Rpi with supply

    cnlohr/cnpihats

    My various pi hats.

    48 parts1MIT
  • 4 layers78.5 × 91 mmFuSa1, the printed circuit board in 3D

    FuSa1

    engrtech/STM32_RC01_PCB

    PCB on KiKad 9

    119 parts1
  • 2 layers270 × 140 mmDigiSlatePlus, the printed circuit board in 3D

    DigiSlatePlus

    digislateplus/digislateplus.github.io

    DigiSlate+ is based on the DigiSlate and is inspired by the DIY timecode generator from mitkunz. The aim for the DigiSlate+ is not only to be able to read and display timecode, but also to generate it itself.

    130 parts

Questions

How big is the Desk power monitor mini32 ac PCB?

It measures 31 × 39 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Desk power monitor mini32 ac use?

25 parts, built around the 220UF 10V 5*7, CY75-220UH, MB10S(46MIL) and US1M. 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 Desk power monitor mini32 ac KiCad files?

From the netrondev/netron_esp32_lora_ac repository on GitHub, at the commit this page was made from: the board is hardware/desk_power_monitor_mini32_ac-2026-02-23_102841/desk_power_monitor_mini32_ac.kicad_pcb and its schematic hardware/desk_power_monitor_mini32_ac-2026-02-23_102841/desk_power_monitor_mini32_ac.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Desk power monitor mini32 ac design in my own project?

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