PowerPi
While developing low-powered MCU systems (battery-powered), I wanted to figure out how much power my system is using and at what times.
I came across this video and in it, the Nordic Power Profiler Kit II.
Having a RPi and INA219 at hand, I decided to build my own power profiler.
- Measure and show current draw, voltage stability and overall power usage
- Control, visualize and analyze easily from a web browser
- "Ultra Fast" measurements (uS) (e.g. to show power spikes in MCUs)
- "Slow" measurements (seconds, minutes) for long-term power system analysis (e.g. battery charging and solar systems)
- Save measurements to CSV
- Integration with CC/CV source to make it a more powerful lab tool
- Move to better visualization platform
- Add script to configure as a boot service using systemd
- Clean the code
- Create short overview video
- Compare to professional equipment
- Better exceptions handling and show problems on dashboard
- Raspberry Pi 3B+ (plus has WiFi built-in) connected to INA219 using I2C
- INA219 in series (high side) between power source and load
- Up to 26VDC
- Up to 3.2A
- Common ground between measured circuit and PowerPi
- Based on pi-ina219 library
- Uses Panel and Holoviews for web server and visualization
- This probably not the best way, but it's the only tool I feel comfortable with for now
-
Burn a Raspbian image on a MicroSD card, connect to a WiFi and get the IP address
-
Install pigpio - used for get_current_tick() to get micro-seconds precision
wget https://github.com/joan2937/pigpio/archive/master.zip
unzip master.zip
cd pigpio-master
make
sudo make install -
Install pip (to download python libraries) -
sudo apt install python-pip
-
Download Python libraries
pip install holoviz panel holoviews pi-ina219
-
Start pigpio daemon (every reboot)
sudo pigpiod
-
Clone repo
-
Start server
panel serve panel.py --allow-websocket-origin=* --port=8080
-
Locate your RPi IP address and open a browser to http://IP:8080 or if hostname is powerpi - http://powerpi.local:8080
Please read further here
Tabs for different modes
- Data Logger - Start data logging to CSV for long-term measurements and later analysis
- Live View - Live visualization of current and voltage
- Data Explorer - Visualize and analyze data from CSV files


