Skip to the content
2 layers32.1 × 40.8 mmPower Monitor Version 1, the printed circuit board in 3D

Power Monitor Version 1

alcar21/WemosEM122

Cheap power monitor (STC013) with Home Assistant Discover and Wemos D1 Mini / PRO (esp8266)

Size
32.1 × 40.8 mm
Copper layers
2
Thickness
1.6 mm
Parts
8
Nets
6
Pads
38
Tracks, vias
47, 38
Pours
2
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
14 Sep 2019
Updated
4 Apr 2021

Overview

Power Monitor Version 1 is an open-source printed circuit board by alcar21, from the alcar21/WemosEM repository on GitHub. It is a 2-layer board of 32.1 × 40.8 mm with 8 parts on 6 nets, routed with 47 tracks and 38 vias.

It is built around the WEMOS D1 MINI. Its parts include 4 resistors, 1 capacitor, 1 diode and 1 connector. It belongs with the ESP8266 boards of this library.

Main components

1

README

README.md

WemosEM

:warning::warning::warning: Sorry, I have no time to work on this project. I am involved in new projects :warning::warning::warning:

This is a fork of @nephiel and @Mottramlabs projects

Thanks to Dawies www.domology.es for his contributions and his tutorial

The sensor uses a Wemos D1 Mini and PRO and a Non-invasive Split Core Current Transformer type 100A SCT-013-000, available on eBay. You can use Current Transformer type calibrated SCT-013-030 (30A), SCT-013-050 (50A) and others. Recomended Clamp 30A or higger.

The sensor samples the current value every 10 seconds and publishes it to a topic via an MQTT broker. you can change this value up to 5 seconds If the connection fails, it attempts to reconnect to the WiFi and/or the MQTT Broker as needed.

Original Gerber files for the PCB layout and the source files for Kicad are included, although there may be issues with the custom libraries used.

Software features:

  • Easy setup.
  • Responsive design.
  • Home Asisstant Discovery.
  • All setup in web browser: Wifi, MQTT, Calibrate, timezone, update and system.
  • Update Voltaje by MQTT topic.
  • NTP to setup timezone.
  • Blynk Integration
  • ThingSpeak integration
  • OTA updates
  • Optional reset Kwh counter one day of the month
  • Reset Kwh in MQTT Topic
Components:

WARNING: If you use calibrated clamp, REMOVE resistance R1 from mains current sensor.

Firmware installation and first setup

Flashing:
installation01

Download latest release You can flash using software nodemcu-pyflasher

  1. Select Serial port (COM# port) where your serial-to-USB or NodeMCU/D1 mini is connected. Leave on auto-select if not sure.
  2. Browse to the binary you downloaded from WemosEM releases.
  3. Set Baud rate to 115200 and Flash mode to DOUT. Erase flash to yes if it is the first time flashing WemosEM on the device or you're experiencing issues with existing flash. If you're upgrading WemosEM set to no.
  4. Click Flash NodeMCU and watch the progress in console.

If the flash was successful the console will display: Firmware successfully flashed. unplug/replug or reset device to switch back to normal boot mode

Unplug your adapter or device and plug it back in or connect to another power source. Your device is now ready for Initial configuration.

You can see in Tasmota project other options to flash: https://github.com/arendst/Sonoff-Tasmota/wiki/Flashing

Initial configuration

WemosEM provides a wireless access point for easy Wi-Fi configuration.

installation02 installation03 installation04

Connect your device to a power source and grab your smartphone (or tablet or laptop or any other web and Wi-Fi capable device). Search for a Wi-Fi AP named wemosEM-xxxxxx (where x is a last part of MAC) and connect to it with password infinito&masalla. In this example the Wi-Fi AP is named wemosEM-AB128A. When it connects to the network, you may get a warning that there is no Internet connection and be prompted to connect to a different network. Do not allow the mobile device to select a different network.

After you have connected to the WemosEM Wi-Fi AP, open http://192.168.4.1 in a web browser on the smartphone (or whatever device you used). Some devices might prompt you to sign in to Wi-Fi network which should also open the above address.

At this page you can have WemosEM scan for available Wi-Fi networks. Select and setup you wifi network. Click save and you wemos will connect to your wifi.

installation05 Finally, connect with IP or http://wemosem-xxxxxx.local/ and enter default user and passwor:
  • Default user: wemosem
  • Default password: infinito&masalla

Password is updatable in configuration system tab.

Ical Value

you can view the ICAL value in http://lechacal.com/wiki/index.php/Current_Transformer_Conditioner

CTOutput TypeRburdenRgain (for 5V)ICAL (for 5V)Rgain (for 3.3V)ICAL (for 3.3V)
SCT-013-005VoltageNone130 kΩ2.83None*5.0
SCT-013-010VoltageNone130 kΩ5.66None*10.0
SCT-013-015VoltageNone130 kΩ8.49None*15.0
SCT-013-020VoltageNone130 kΩ11.31None*20.0
SCT-013-025VoltageNone130 kΩ14.14None*25.0
SCT-013-030VoltageNone130 kΩ16.96None*30.0
SCT-013-050VoltageNone130 kΩ28.28None*50.0
SCT-013-060VoltageNone130 kΩ33.94None*60.0
     
SCT-006Current10 Ω17 kΩ11.6228 kΩ17.5
SCT-013-000Current10 Ω40 kΩ56.5775 kΩ85.71
SCT-019Current10 Ω24 kΩ116.1340 kΩ171.43

Setup in Home Assistant (without MQTT autodiscovery)

text
sensor:
- platform: mqtt
  state_topic: "wemos/wemosEM-XXXXXX/power"
  name: WemosEM-Amperaje
  icon: mdi:current-ac
  unit_of_measurement: "A"
  value_template: "{{ value_json.current }}"
- platform: mqtt
  state_topic: "wemos/wemosEM-XXXXXX/power"
  name: WemosEM-Consumo Actual
  icon: mdi:power-plug
  unit_of_measurement: "W"
  value_template: "{{ value_json.watios }}"
- platform: mqtt
  state_topic: "wemos/wemosEM-XXXXXX/power"
  name: WemosEM-KWh
  icon: mdi:power-plug
  unit_of_measurement: "KWh"
  value_template: "{{ value_json.kwh }}"nt Cell  | Content Cell  |

Update Voltaje with Home Assistant

if you have a Shelly EM, add a automation in Home assistant:

text
  - alias: Update voltage WemosEM
    initial_state: 'on'
    trigger:
    - platform: mqtt
      topic: shellies/shellyem-B9E2E9/emeter/0/voltage

    action:
    - service: mqtt.publish
      data_template:
        topic: "wemos-cmd/wemosEM-XXXXXX/voltage"
        payload: '{{ trigger.payload }}'

if you have a device with Tasmota, add a automation in Home assistant:

text
  - alias: Update voltage Tasmota-WemosEM
    initial_state: 'on'
    trigger:
    - platform: mqtt
      topic: tele/sonoff01/SENSOR

    action:
    - service: mqtt.publish
      data_template:
        topic: "wemos-cmd/wemosEM-XXXXXX/voltage"
        payload: "{{ trigger.payload_json['ENERGY'].Voltage }}"

Blynk Integration

Go to Blynk app on your phone and layout the blynk project with virtual pin number according:

  • Virtual PIN V0: Voltage (V)
  • Virtual PIN V1: Current (A)
  • Virtual PIN V2: Live Watios (w)
  • Virtual PIN V3: Energy (kwh)
  • Virtual PIN V4: Energy before last reset (kwh)

Setup in web interface token auth, optional you can setup server and port server.

Thingspeak Integration

Setup in web interface token auth (Write API Key) and Channel number.

  • Field 1: Voltage (V)
  • Field 2: Current (A)
  • Field 3: Live Watios (w)
  • Field 4: Energy (kwh)
  • Field 5: Energy before last reset (kwh)

MQTT Topics

TopicDescription
wemos-cmd/wemosEM-XXXXXX/voltageSet/update voltage (from sonoff, shelly or other devices)
wemos-cmd/wemosEM-XXXXXX/statusGet Status of wemosEM
wemos-cmd/wemosEM-XXXXXX/resetkwhreset kwh and store and beforeResetkwh variable

OTA Updates

OTA updates from platformio windows with espota: ~/.platformio/packages/tool-espotapy/espota.py --progress --ip 192.168.4.1 --auth "infinito&masalla" --file wemosEM-1.3.1_core-2.4.bin

Developers

This project is developed with platformio. WemosEM not compile with core 2.3 because blynk library require core 2.4.0 or higher.

  • Recomended compile this project with Arduino Core 2.4.2.

Commands:

  • Compile: pio run
  • Compile and upload Wemos D1: pio run -t upload

Other options:

  • Compile with core 2.5: pio run -t upload -e d1_mini_2_5
  • Compile for Wemos D1 Mini PRO (only core 2.4): pio run -t upload -e d1_mini_pro_2_4

Tests

Screenshots

Parts

8
QtyValueFootprintReferences
210KDRM_Parts_General:Resistor_THTR2, R3
110uF 10VDRM_Parts_General:Cap_5mm_THTC1
11KDRM_Parts_General:Resistor_THTR4
122RDRM_Parts_General:Resistor_THTR1
13.5mm Jack Socket - PJ-307DRM_Connectors:Jack_3.5_PJ-307J1
1LEDDRM_LED_Display:LED 5mmD1
1Wemos_D1_MiniDRM_ESP8266:Wemos D1 MiniM1

Similar boards

  • 2 layers70.1 × 43.2 mmIaq device, the printed circuit board in 3D

    Iaq device

    nkitanov/iaq_board

    IAQ Board is a DIY (Do-It-Yourself) device for measuring internal air quality

    19 parts396
  • 2 layers91 × 49 mmWled, the printed circuit board in 3D

    Wled

    wladwnt/wled

    Simple WLED Board (SW: https://github.com/Aircoookie/WLED)

    9 parts102
  • 2 layers97.5 × 59.3 mmControl Board, the printed circuit board in 3D

    Control Board

    kholia/Easy-Digital-Beacons-v1

    A simple and easy Arduino / Pi Pico / ESP8266-powered WSPR, FT8, and FT4 beacon system which uses NTP + DS3231 RTC for timing. Super extensible! Now comes with optional GPS support.

    17 parts89
  • 2 layers64.6 × 36.9 mmNavien latest, the printed circuit board in 3D

    Navien latest

    htumanyan/navien

    Navien water heater wire protocol for communication with NaviLink and other attached devices

    30 parts65
  • 2 layers49.5 × 30 mmAirpcb smd old, the printed circuit board in 3D

    Airpcb smd old

    issalig/toshiba_air_cond

    AB protocol decoder for toshiba air conditioners

    30 parts65
  • 2 layersTcsmonitor pcb, the printed circuit board in 3D

    Tcsmonitor pcb

    Syralist/tcs-monitor

    ein Bus-Monitor für TCS Klingelanlagen

    14 parts37MIT
  • 2 layers83.8 × 120.7 mmAtu100wifi, the printed circuit board in 3D

    Atu100wifi

    ftl/atu100wifi

    A wifi adapter device for David Fainitski's ATU-100 antenna tuner (https://github.com/Dfinitski/N7DDC-ATU-100-mini-and-extended-boards)

    31 parts28MIT

Questions

How big is the Power Monitor Version 1 PCB?

It measures 32.1 × 40.8 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Power Monitor Version 1 use?

8 parts, built around the WEMOS D1 MINI. 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 Power Monitor Version 1 KiCad files?

From the alcar21/WemosEM repository on GitHub, at the commit this page was made from: the board is KiCad PCB Files/Power Monitor Version 1.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the Power Monitor Version 1 design in my own project?

Its repository states no licence, so its author keeps all rights: ask alcar21 before reusing the design.