
USMU v10
joeltroughton/uSMU
Credit card-sized, USB-powered 4 quadrant source-measure unit hardware and firmware

Multi-paradigm power usage monitoring board for ESP32 devkit
Esphome powermon is an open-source printed circuit board by michd, from the michd/esphome-powermon repository on GitHub, published under the CERN-OHL-P-2.0 licence. It is a 2-layer board of 32 × 55.8 mm with 61 parts on 44 nets, routed with 225 tracks and 15 vias.
It is built around the ADS1115IDGS. Its parts include 10 connectors, 3 resistors, 2 capacitors and 1 IC. It belongs with the home automation and IoT boards of this library.
Device meant to monitor power usage of a house or circuit. Supports both blinking LED (e.g. 800 blinks per kWh consumed) with a detector, or interfacing with a Current Transformer (CT) clamp.
Fits an ESP32Devkit1 board. Please carefully compare the markings on the board with the ESP32 board.
See [Releases] for fabrication files. I generally order from jlcpcb.com, so that's what the files are tailored for.
Some soldering is required to start using the board.
The PWR IN jumper connectos the "Vin" connector pin either to the "Vin" pin of the ESP32 board, or to the 3.3V pin of same.
If you are supplying power via the connector (Vin and GND), select 3.3V or 5V depending on your power source.
If you are powering the ESP32 board directly via a USB cable, then you might use Vin the other way around. In that case the jumper selection can be used to decide whether to supply 3.3V or 5V to that pin. In my case, I'm using this connector to feed a pulse detector 3.3V.
The board features a 4-channel analog to digital converter, the ADS1115IDGS. Its first input A0 can be wired to the CT Clamp circuit, or to a connector on the other end of the board, AI0.
The remaining ADC channels are also made available. 3 Jumpers are provided to make the connections to the ADC chip by the bottom of the board. If they are left unconnected, these pads can be used for other purposes. Note that all of these inputs should be kept within a 0-3.3V range.
For using with a meter that blinks and LED or otherwise provides a pulse with every x amount of energy consumption, wire the pulse to "Blink" on the connector. It expects a 3.3V logic pulse, going directly to pin D27 on the ESP32.
Current Transformer clamps clip around a conductor carrying an alternating current and induce a smaller current themselves as a result.
See this introduction to using CT Sensors
The important part is that you need to provide your own resistor to connect across the CT Clamp. Through ohm's law, the current through that resistor, multiplied by the resistance value results in a measurable voltage. This resistor is called the burden resistor and I'll talk more about it shortly.
Trimming potentiometer is used to set 50% midpoint at 1.65 V, to centre the CT Clamp signal around. Without a CT-Clamp connected, but with the board powered up, use a multimeter to measure the DC voltage from GND to the CT clamp pin furthest from the board edge. Tweak RV1 until this voltage is 1.65 V.
Use this table to select a resistor to use as burden resistor for your CT Clamp.
Info you'll need:
$I_{live_{RMS}}$
The maximum current you expect to go through the conductor you put the clamp around
$n$
Number of windings of the current transformer in the CT Clamp. For example: 100 A : 50mA -> 2000
In the table, $R$ is the approximate ideal resistance value to get maximum range out of it, and E12/E24/E48 give a resistor value available in the E-series of preferred numbers - that is, a resistor you can actually buy.
| $I_{live_{RMS}}$ | $n$ | $R$ | E12 | E24 | E48 |
|---|---|---|---|---|---|
| 200 A | 2000 | 11.67 Ω | 10 Ω | 11 Ω | 11.5 Ω |
| 100 A | 2000 | 23.33 Ω | 22 Ω | 22 Ω | 22.6 Ω |
| 60 A | 2000 | 38.89 Ω | 33 Ω | 36 Ω | 38.3 Ω |
| 50 A | 2000 | 46.67 Ω | 39 Ω | 43 Ω | 46.4 Ω |
| 32 A | 2000 | 72.92 Ω | 68 Ω | 68 Ω | 71.5 Ω |
| 16 A | 2000 | 145.84 Ω | 120 Ω | 130 Ω | 140 Ω |
| 10 A | 2000 | 233.35 Ω | 220 Ω | 220 Ω | 226 Ω |
| 5 A | 2000 | 466.69 Ω | 390 Ω | 430 Ω | 464 Ω |
| 2 A | 2000 | 1,166.73 Ω | 1 kΩ | 1.1 kΩ | 1.15 kΩ |
| 1 A | 2000 | 2,333.45 Ω | 2.2 kΩ | 2.2 kΩ | 2.26 kΩ |
| 200 A | 1000 | 5.83 Ω | 5.6 Ω | 5.6 Ω | 5.62 Ω |
| 100 A | 1000 | 11.67 Ω | 10 Ω | 11 Ω | 11.5 Ω |
| 60 A | 1000 | 19.45 Ω | 18 Ω | 18 Ω | 18.7 Ω |
| 50 A | 1000 | 23.33 Ω | 22 Ω | 22 Ω | 22.6 Ω |
| 32 A | 1000 | 36.46 Ω | 33 Ω | 36 Ω | 34.8 Ω |
| 16 A | 1000 | 72.92 Ω | 68 Ω | 68 Ω | 71.5 Ω |
| 10 A | 1000 | 116.67 Ω | 100 Ω | 110 Ω | 115 Ω |
| 5 A | 1000 | 233.35 Ω | 220 Ω | 220 Ω | 226 Ω |
| 2 A | 1000 | 583.36 Ω | 560 Ω | 560 Ω | 562 Ω |
| 1 A | 1000 | 1,166.73 Ω | 1 kΩ | 1.1 kΩ | 1.15 kΩ |
These are more details about how this burden resistance is selected.
There are three factors at play to select the burden resistor.
The last two combine into the maximum expected current through the current transformer winding and thus through the burden resistor.
The desired output voltage range happens to be fixed. Based on the operating voltage of the ESP32 and the analog to digital converter (ADC) used in this design, the DC output voltage should never be higher than 3.3 V.
The voltage across the burden resistor will be in the form of a sine wave, so to remain between 0V and 3.3V, it is superimposed on a 1.65 V offset. From that, the peak voltage across the burden resistor ($V_{pk}$) should be 1.65 V.
To play it safe, this should probably match or exceed the current rating of the breaker on this circuit, or any lower-rated fuse that's in line with it.
For example, this could be 32 A.
A CT Clamp will typically have a marking like 100 A : 50 mA or something similar. Divide those by one another to get the ratio or number of windings. In this example that's
n = \frac{100 A}{0.05 A} = 2000Our max expected current through the burden resistor becomes the maximum expected current through the live conductor, divided by the number of windings. Taking our example:
I_{burden_{rms}} = 32 A \div 2000 = 16 mAThis 32 A rating is typically an RMS value, that is, not the actual peak value. To get the peak value, multiply by $\sqrt2$:
I_{burden_{pk}} = 16 mA \times \sqrt{2} \approx 22.63 mANow we can pick a burden resistance value:
R_{burden} = V_{burden_{pk}} \div I_{burden_{pk}}Example:
R_{burden} = 1.65 V \div 22.63 mA \approx 72.91 \ohmFor convenience, here's the equation from base values:
R_{burden} = V_{burden_{pk}} \div \frac{I_{live_{RMS}} \times \sqrt{2}}{n}Where $V_{burden_{pk}} = 1.65V$.
You'll then want to pick a resistor that actually exists. Round the value down, since rounding up will result in higher voltages than those calculated.
All pins of the ESP32 have an additional open pad next to them to directly wire things to them as desired. All ADC inputs have a directly connected pad, near the center of the board (A0-A3). Each connector on the board has duplicate pads to wire directly to them.
Lastly, there is a "playground" area with 5 pads for the 5V*, 3.3V, and GND rails. A set of further pads, all spaced 2.54mm (0.1") apart is available as a sort of mini proto-board.These pads are not connected to anything unless marked otherwise on the board.
TODO.
Pertinent info if you already know what you're doing:
Pulse input pin: 27
ADC:
ads111513120x48A0_GND (CT Clamp or AI0)A1_GNDA2_GNDA3_GNDHelpful esphome stuff:
| Qty | Value | Footprint | References |
|---|---|---|---|
| 39 | , , , , , , , , , , , , , , , +23 | ||
| 3 | Conn_01x04_Pin | Connector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_Vertical | J5, J13, J15 |
| 3 | Jumper_2_Bridged | Jumper:SolderJumper-2_P1.3mm_Open_TrianglePad1.0x1.5mm | JP3, JP4, JP5 |
| 2 | 100n | Capacitor_SMD:C_0603_1608Metric | C1, C2 |
| 2 | 47k | Resistor_SMD:R_0603_1608Metric | R4, R5 |
| 2 | Conn_01x15_Female | Connector_PinSocket_2.54mm:PinSocket_1x15_P2.54mm_Vertical | J1, J2 |
| 2 | Conn_01x15_Male | Connector_PinHeader_2.54mm:PinHeader_1x15_P2.54mm_Vertical | J11, J12 |
| 2 | Jumper_3_Bridged12 | Jumper:SolderJumper-3_P2.0mm_Open_TrianglePad1.0x1.5mm | JP1, JP2 |
| 1 | 10k | esphome-powermon:Potentiometer_Bourns_3313J_Vertical | RV1 |
| 1 | 220 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R6 |
| 1 | ADS1115IDGS | Package_SO:VSSOP-10_3x3mm_P0.5mm | U1 |
| 1 | Conn_01x02_Pin | Connector_JST:JST_PH_S2B-PH-K_1x02_P2.00mm_Horizontal | J4 |
| 1 | Conn_01x02_Pin | Connector_PinHeader_2.54mm:PinHeader_1x02_P2.54mm_Vertical | J14 |
| 1 | Conn_01x04_Pin | Connector_JST:JST_PH_S4B-PH-K_1x04_P2.00mm_Horizontal | J3 |
It measures 32 × 55.8 mm and has 2 copper layers, 1.6 mm thick.
61 parts, built around the ADS1115IDGS. 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.
From the michd/esphome-powermon repository on GitHub, at the commit this page was made from: the board is esphome-powermon.kicad_pcb and its schematic esphome-powermon.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Its repository publishes it under the CERN-OHL-P-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).

joeltroughton/uSMU
Credit card-sized, USB-powered 4 quadrant source-measure unit hardware and firmware

dridri/bcflight
Raspberry Pi based drone flight controller and remote control

Bylin-code/Stradex1
STRADEX1 Documentation and Build Instructions ============== I've always wanted to put my violin skills to use in a MIDI environment, but there really isn't a controller on the market that can emulate the feel of a…


luftaquila/monolith
DIY wireless real-time datalogging platform for Student Formula and Baja.

doppelgrau/esp32-f9p-io-board
An IO-PCB (two motor-driver/H-bridge, CAN, RS232, ADS1115, relay, ethernet, ardusimple f9p compatible connector) with an ESP32 for 12V power, three 15V tolerant analog inputs, three 5V tolerant inputs.


joeltroughton/nanoAmmeter
A small ammeter for measuring printed glucose biosensors