A lightweight hardware + software toolkit for high-resolution power monitoring on Xilinx Zynq UltraScale+ evaluation boards.
The system pairs a tiny Arduino® Nano 33 BLE (or a compatible 3 V MCU) with TI INA226 current/voltage monitors—multiplexed through a PCA9544A—to capture rail-power data and stream it as CSV to a host PC.
Why? When benchmarking FPGA workloads you often need a cheap, non-intrusive way to correlate board power with software events.
This project lets you do that with off-the-shelf parts and a single Python command.
Item | Notes |
---|---|
Xilinx ZCU102 / ZCU106 | Other boards may work with minor register tweaks. |
Arduino Nano 33 BLE | Any 3 V MCU supported by arduino-cli should work. |
Misc. cabling | SDA/SCL + External Trigger + GND from Nano to mux / sensors. |
Nano 33 BLE ZCU10x Pmod I²C Notes
--------------------- ------------------------------- ------------------------------
GND ─────────────► GND
SDA (A4) ─────────────► SDA
SCL (A5) ─────────────► SCL
D2 ─────────────► EXT_TRIG (optional) Align logs with PS/PL events
- arduino-cli ≥ 0.35 in your
$PATH
- Arduino core for your board (e.g.
arduino:mbed:nano33ble
) - Python ≥ 3.8 with:
pip install pyserial
git clone https://github.com/vlsi-lab/power-logger.git
cd power-logger
python power_log.py --target-board ZCU106 --arduino-board arduino:mbed:nano33ble
Use --port
to override auto-detection, and --ext-trigger
if you wired D2 to an external 3 V-logic source.
# Continuous logging to power_log_<timestamp>.csv
python power_log.py
When --ext-trigger
is active the logger works only if pin D2 is HIGH.
import pandas as pd, matplotlib.pyplot as plt
df = pd.read_csv("power_log_2025-06-07_12-15-42.csv")
df.plot()
plt.show()
When running the script with the --ext-trigger
flag, the logger listens on a dedicated input pin and manages log files as follows:
- Signal goes HIGH (
#START
)
As soon as the trigger pin is detected as HIGH, the script creates a new CSV file in the output directory. The filename format is:
power_log_<YYYY-MM-DD_HH-MM-SS.mmm>.csv
where <YYYY-MM-DD_HH-MM-SS.mmm>
is the timestamp of the rising edge.
-
Data recording
All non-empty lines received from the serial port are written to the active CSV file while the trigger remains HIGH. -
Signal goes LOW (
#STOP
)
When the trigger pin returns to LOW, the script closes the current CSV file. -
Subsequent HIGH pulses
If the pin goes HIGH again later, the script opens a new CSV file with an updated timestamp and repeats the process.
Each HIGH pulse on the external pin therefore corresponds to a separate log file, making it easy to analyze individual events.
- The sketch prints tab-separated values (
\t
). - Headers (
value1 … valueN
) are autogenerated and grow if later rows get wider.
Default calibration words and LSBs for each rail/board live in INA226.h
.
Adjust them if you replace the shunt resistors.
- Fork the repo and create your branch (
git checkout -b feature/foo
). - Commit changes with meaningful messages.
- Open a pull request – tests and log snippets are welcome!
- GNU GPL v3 or later.
- Texas Instruments INA226 data-sheet
- Xilinx SCUI calibration values