Introduction: Power Monitor for Electronic Prototypes and Devices

About: I like to make stuff.

Hi all,

since I m planning to use solar modules and accumulators to provide energy for some of my next projects, I have to find out how much power every circuit needs.

One way is to connect a multimeter in series with the load to measure the current. With the help of the current I would be able to calculate the power and work. But the connection of the multimeter for every circuit needs time for wiring. Furthermore I would have to observe the measurement all time and would be difficult to get a overall picture from many single measurements.

Therefore I build a power monitor to measure the power consumption of my components fast and easy.

Supplies

Components:

  • INA219 shunt sensor
  • 3.5 display with an ILI9488 display controller and a XPT2046 touch controller
  • Raspberry Pico
  • Case from old charging station (any other case large enough should work)

Tools:

  • Soldering iron
  • Dremel (depending on the used case, I had to rebuild mine)
  • Hot glue gun (or anything else to attach the components)
  • Wiring tools
  • Matching screwdrivers

Step 1: Construction

I like to upcycle old components. In this case I found an old charging station, which was large enough for the used components. And it had hardware interfaces I could use for the application. Every other case that is large enough can be used.

Step 2: Connection of Components

Because the display had an interface to attach the Raspberry Pico directly, this saved me the work from doing the wiring between them.

The remaining wiring isnt much or complex, because of this I have drawn a rudimentary circuit diagram.

Step 3: Software

I wrote the code for this project in MicroPython. You can find the sourcecode here:

github

Step 4: Configuration and Parameters

There are some points I must mention:

  • Only positive current is displayed, negative current will be ignored in the software. This is enough for my application to find out how many power a device needs.
  • The GUI is refreshed every 2 seconds. The INA219 is configured to do an average from 128 measurements, and needs 68.1 ms for conversion. During the time between the display updates, the application reads a measurement every 80 ms, and does another average from this values. Through the averages its possible that fast current changes will be smoothed out. A modification of this behavior is possible if needed.
  • The maximum measurable current is 3.2 A. This is also the maximum measurable current of the INA219 sensor, and results in the smallest resolution. For higher resolutions smaller current values can be configured for the INA219.
  • The allowed input voltage range is 2-5V, because the voltage is used as direct supply for the Raspberry Pico.

Step 5: The Displayed Values and Control

After the power supply and the load are connected, a measurement session can be started through touching the "START" button in the corner top right. After starting the button text changes to "STOP", touching the button now stops the active session and all measured data will be cleared.


Displayed measurements:

  • I - Current from recent measurement.
  • Imax - Maximum current measured in the running session.
  • U - Voltage from recent measurement.
  • P - Power from recent measurement.
  • W - Consumed work of consumer in the running session.

The graph shows only the possible time frame, after reaching the end the oldest measurements will be shifted backwards and the shown time will be increased. Imax and W applies to all measurements in the active session.

The graph scales automatically depending on the maximum current.

Step 6: Conclusion

  • A possible modification would be to implement a menu where the user can configure the parameters like average number, sampling time and some other stuff. One has to consider what is needed, I like to keep such applications as simple as possible, that I can handle them fast and easy even if I use it after some time again.
  • Another modification could be an option for different voltages with a voltage converter. For my case the range of 2 - 5 V is enough, the most of my circuits use 5V for supply.
  • Providing of different interfaces to connect to load would also be imaginable.
  • If the user needs to keep the measured values for later tasks, a wireless connection or a SD card could be used.


Thanks for reading.