This is a Python module for the HIOKI 3334 power meter in SEELab.
Download the desired version from the corresponding branch (master
for Python >= 3.7, py2.7
for Python >= 2.7) and decompress it. cd
into it, then:
# for v1.0 and Python 2.7
pip2 install .
# or for v2.0 and Python 3.5
pip3 install .
By default, the module will be installed to your packages library for Python. However, if you do want to install the module in "editable" mode, which will be based on the code in the current directory:
# for v1.0 and Python 2.7
pip2 install -e .
# or for v2.0 and Python 3.5
pip3 install -e .
There are several handy demos included in the demo
folder:
This demo shows how to create a separate thread for power monitoring and how to receive data with a callback
function. The measured traces ([time(s), power(mW)] pairs) will be logged into a text file.
This demo assumes two RPis in the setup: one RPi for running the workloads, and the other RPi for measuring the power of that RPi. Two RPis are connected via an Ethernet cable, where simple signals are sent to indicate the start and the end of the workload.
This demo shows how to create a simple animation to view the power traces in real-time.
This demo provides a processing script to calculate the energy for each phase based on the record time stamp.
-
The automatically generated log file
PWR_FILE
when creating the powermeter aspm = PowerMeter(PWR_FILE)
, adopts the following format:time_stamp,volt,curr,pf,mul 1651386186231,123.4,0.0625,0.512,3.9488000000000003 1651386186276,123.4,0.0625,0.512,3.9488000000000003 ...
time_stamp
: the system sampling time in millisecondvolt
: the votage in Vcurr
: the current in Apf
: the power factor which is a specific parameter for HIOKI 3334mul
: the measured power in W, which results fromvolt*curr*pf
@misc{hioki3334,
title = {{Hioki3334 Powermeter}},
howpublished = {\url{https://www.hioki.com/en/products/detail/?product_key=5812}},
}