DEV Community

MiniDigitalC
MiniDigitalC

Posted on

Logging Appliance Current with a Clamp Meter and a Few Lines of Python

I work with MiniDigitalC (minidigitalc.co.uk), a UK store for clamp meters and electrical test tools. This post shares a practical measurement + logging workflow; the product link at the end is to a tool we sell.

If you build home-automation or energy-monitoring projects, you need real numbers before you size relays, fuses or current sensors. A handheld clamp meter is the quickest way to get them: no cutting wires, no series shunt. Here is a simple workflow for capturing manual readings and turning them into useful data.

Why measure first?

Datasheet power figures are often nominal. Motors have inrush, LED drivers and switch-mode supplies draw distorted, non-sinusoidal current. A True RMS clamp meter reports the effective value, which is what your relays and cables actually experience.

Safe measurement setup

  • Never open mains equipment unless you are competent to do so.
  • Use a line splitter between the socket and appliance so you can clamp a single conductor. Clamping the whole flex reads roughly zero because live and neutral cancel.
  • For DC projects (12V LED strips, battery banks), select DC amps and zero the meter first.

Capture readings

Take a reading every minute through the appliance's cycle and log them:

import csv, datetime

with open("current_log.csv", "a", newline="") as f:
    w = csv.writer(f)
    while True:
        val = input("Amps (blank to stop): ").strip()
        if not val:
            break
        w.writerow([datetime.datetime.now().isoformat(), float(val)])
Enter fullscreen mode Exit fullscreen mode

Analyse

import pandas as pd
df = pd.read_csv("current_log.csv", names=["ts", "amps"], parse_dates=["ts"])
print("peak:", df.amps.max(), "A")
print("mean:", round(df.amps.mean(), 2), "A")
print("est. kWh:", round((df.amps.mean() * 230 / 1000) *
      (df.ts.max() - df.ts.min()).total_seconds() / 3600, 3))
Enter fullscreen mode Exit fullscreen mode

The kWh estimate assumes 230V and unity power factor, so treat it as a rough guide.

Use the data

  • Size your relay with headroom above the observed peak.
  • Choose a CT sensor range for your ESP32/Raspberry Pi monitor that covers the peak without wasting resolution.
  • Compare against your smart plug's reported values to calibrate it.

Tooling note

A compact AC/DC True RMS meter such as the UNI-T UT210E mini clamp meter is handy here because it fits small enclosures and covers DC for low-voltage builds.

Measure, log, then design. Your projects will be safer and better sized.

Top comments (0)