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?
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.
A custom PCB is a nice feature to move from the protoboard to reliable connections.
My goal is to make a nice small and space saving PCB. Thus, I will not just plug breakout boards to their headers on the PCB but will solder them directly to the PCB.
With one exeption: The RP2040. I don't want to face any trouble doing the connections on my PCB - Controller - Crystal - Flash. I would like to take an off the shelf part - like the Pi Pico. But as already meantioned it is to large for my application.
My research led me to the RP2050 Femto which is a pretty nice approach to shrink the size. With a form factor of only 11x11mm it is just bearly bigger than the Controller itself. But unfortunately I coundn't find it to buy.
I heard also of the RP2040 stamp which is also a very nice board because it contains some extra features the Pico doesn't have. But 25x25mm is an unlikely formfactor for my project.
Next, coincidental I came across the RP2040 Nano which has a formfactor that suits my needs! Yes, not all pins are easy accessible but I don't need all the pins. It contains also some extra features like an reset button, a Neopixel LED and is future proof with a USB-C connector.
That's the board I take!
Next the PCB design wich is quite easy. I added another user button and two user LEDs. To make use of the (so far) unused pins I added two rows of female headers. Their distance is in multiple of 2.54mm to easy stack-up another PCB.
The INA219 chip is addressable with all 16 addresses. One just need to change the position of the pull-up resistor. In default assembly only one 2512 sized 100mOhm shunt is populated, but with higher currents in mind I added a second unpopulated footprint in parallel.
The screw terminal is the biggest component but also very robust and can hold wires up to 2.5mm².
Everything important is labeled in the silkscreen.
The PCB has a size of 75x30mm.
All files will be available on my github when everything is confirmed.
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.
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.