Skip to content

cbelcher/RP2040PowerMonitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pico Power Monitor RP2040-Zero Micro Python Files

This the repo contains the files needed to run the hardware side of things, for the Pico Power Monitor.

Project is broken up into 4 sub-projects.

  • MicroPhython code to drive the hardware. - This Repo. This is the project that runs on the RP2040-Zero. Current MicroPython firmware 1.28.

  • KiCAD Custom PCB Design

    • Repo: /PicoPowerMonitor_KiCad (Direct link here)

    • PCBWay Shared Projects (Direct link here)

  • PicoPowerMonitor - This is the Windows 11 application, completely optional. The PicoPowerMonitor can and does run without this application.

    • Repo: /PicoPowerMonitor (Direct link here)
  • FreeCAD 3D Printed Case Design. (Direct link here)

Key Features

  • Instantiates I2C communications to OLED display and the TI INA260 Power Montior IC.
  • Sets up the TI INA260's OCL (Over Current Limit) register. Default 16 A. Configurable.
  • Reads the INA260's registers 100 times / second for Curent, Voltage and Power values.
  • Updates OLED Display with INA260 readings.
  • Interupt handler to shut down the Infineon BSC007N04LS6 N-Channel MOSFET during an OCL event and update the 2.4" OLED Display to notify user.
  • Interupt handler to take the input of momentary SPST reset button. Clears the INA260 ALERT and restarts main loop.
  • Streams current and voltage readings to native Windows 11 application.

Installation

  • Flash UF2 bootloader uf2 can be downloaded here)
  • Pick your IDE of choice, Thonny, VSC...
  • Upload the files to the RP-2040-Zero. If this is all new to you, Thonny is as easy as it gets.
    • Direct link here)
    • Need to maintain fonts directory structure. You don't, this will not run!
    • i2c_scan.py is not required, just there to verify the RP2040-Zero can see the display and the INA260 on the I2C bus.
    • main.py (named as such as to run on power-up) This is the core script.
    • ssd1309.py is the open-source SPI & I2C display driver by rdagger / micropython-ssd1309
    • xglcd_font.py handles the GLCD Fonts, not sure who to give credit for this work.
    • Make sure the script runs.
    • After that disconnect from PC and reconnect, main.py should fire up and the display should come to life.

Images

-Thonny screenshot

Screenshot 2026-06-22 05 42 31

  • OLED display

IMG_2811

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

About

RP2040 MicroPython code, running the hardware side of the Power Monitor

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages