Based on Raspberry RP2040 controller and the INA219 current sensor it is possible to get very precise measurements of current flowing through a shunt resistor. Additionally it is possible to measure the system voltage and get the calculated power.
Everything is shown on a 0.96" OLED display.
I will use it as a power meter for my power electronic development. With two of them I could use it to calculate the efficiency.
With the two header rows it is possible to use nearly all pins of the controller.
Maybe one could use it as a MPPT controller for solar charging batteries?
Or monitor the energy flow in a offgrid installation like a yacht or a camper van?
While I was measuring the consumption of other projects I realised that I really need to take care of the wiring. Especially the GND connection. Eventually I destroyed one chip through misconnection.
That led me to the point that the device needs to be isolated. Only this way it is safe to use two of them to perform efficiancy measurements.
There are two ways of isolating the PPPM:
Isolating the input USB connection.
Isolating the onboard power and I2C.
I decided to to the latter because I have no access to the USB-C connection on my PCB.
After a brief search online I found the I2C isolating chip: ISO1641B from TI. It is very easy to use and needs only two external bypass capacitors. The Clock is transmitted unidirectional and the data is bidirectional.
For the power isolation is was a bit harder to find a good space saving solution. Usually there are chips that drive a discrete transformer and on the secondary side you need a LDO to regulate the correct voltage. All that leads to a high BOM count and needed space.
But I was lucky and discovered that TI is coming up with a highly integrated, space saving and cheap chip that does all of this! It is the UCC33420.
To make space for the two additional chips I moved some components around. The shunt resistor and a couple of resistors moved to the back side of the PCB. Now they can be changed without removing the OLED. I should have done this before!
The layout is done and the PCBs are ordered! Now let's wait for it and that the transformer chip becomes public available.
During testing the Power Meter I discovered some minor things I wish I had done different.
First, and most important I wanted to get rid of the pin headers to solder the MCU module. This only adds costs and is unconvenient. I also added some TVS diodes for the measurement inputs and a mouse bite divideable protoboard for the controller headers.
Before, I got a message from PCBway that they would like to sponsor the next revision of PCBs.
That's a really nice circumstance and I used the offer for new PCBs. It was the first time I ordered there. The PCBs are really nice - like I expected. The HASL finish looks very even and the silkscreen is very clear and sharp. One thing I did not expect was the outer milling of the boards. Often the outline is not that important than the dimensions on top of the FR4. But nothing caught my eye that was not finished perfectly and all the dimensions are bang on! All in all a very good job! Thank you very much!
It looks already quite good but some dimensions are not correct. I also need to think about the different height of the components: headers, button, display.
Well a really nice GUI on 2cm² is hard to realize but at least I could make everything good readable.
Due to the lack of different fonts and sizes in the default micropython library I searched for something easy to implement.
And I found it! Peter Hinch has written a really nice library in micropython hat is based on the official drivers for the frame buffer and the SSD1306 OLED display I use.
With some modifications in the code it just runs perfectly on my Pi Pico!
So, if you need a good GUI library that offers some fonts in different sizes, nice widgeds and is portable to many microcontrollers check his repo!
Now, here are some pictures of my 'pages'. With a push button it is possible to move from one 'page' to another.
I love projects like these! Can this be expanded to measure -5, 3.3, 5, 12, & 24 volts? While readings amps/power would be great, it's not completely necessary.
The PPPM can measure up to 26V. -5V is not possible because the INA219 chip does not support negative voltages. You can change the accuracy in the code.
With the new isolated design it is possible to measure with a different reference than the power supply.
great project, there is a lot of need for power and voltage meters at industrial sites. I work at a plant where we want to reduce energy usage. It would be great if there would be an open hardware IOT device which can measure current or voltage and sent it to the cloud Just current could be helpful as well. The idea is that you can sent people a message to turn of a device that shouldnt be on or seems to be not functioning. Imagine that current is too high for the device being off and too low for thw device being working.
Reducing energy usage is an important thing nowadays.
I will think about an IoT PPPM. With some IOs left you could program to turn off the device also over WIFI. The device only needs to be attached to a (onboard) relay.
I love projects like these! Can this be expanded to measure -5, 3.3, 5, 12, & 24 volts? While readings amps/power would be great, it's not completely necessary.