Measuring undervoltage, my new power shield

This is a really quick and dirty set of measurements from my new shield, using it to see when undervoltage is happening. This happened while 'backpowering' my shield- instead of using it to provide power to the Pi, I was just using it to measure the voltage supplied to the Pi. That's why the power usage numbers are negative.

Bus Voltage:    4.864 V
Supply voltage: 4.816 V
Bus Current:    -2.287 mA
Power:          39.634 mW
Shunt voltage:  -0.050 mV

 False <class 'bool'>
lowest:             4.61597
lowest unthrottled: 4.65595
highest throttled:  4.86797

The system was right on the edge of being throttled, so it was bounching from 5000 to 5005 all the time. What's interesting to me is the "lowest unthrottled" / "highest throttled" voltages overlap by quite a bit. It must be the difference between what is sitting on the bus and what is seen inside the chip.

Here are two copies of the power shield. I'm only connecting 6 pins on the bottom because I'm lazy and it requires a lot more soldering to do so. The next iterations will add a fan controller and re-add MOSFETs for controlling some lights.

FWIW, here are the measurements when running on my shield. Pretty much perfect- I designed it to give 5.2v.

Bus Voltage:    5.192 V
Supply voltage: 5.201 V
Bus Current:    434.451 mA
Power:          2371.951 mW
Shunt voltage:  10.170 mV

printed enclosure to accommodate the pi with shield and a fan duct for a 4-pin fan:

1 Like

So I take it that you power all this from the top (5.2V?) and let your board regulate, right?

That's innovative with the fan cowl. I'm not sure what design I'd cook up for the enclosure but I like this so far. I might have to have you sell me one of these.

Power in needs to be 8-30v (stolen from printer or any other DC source), 5.2v out, over GPIO, to the Pi. No USB power needed. The 5.2v is monitored as seen above.

Next version adds two line voltage outputs back (for LED lighting in my case) and wires up the PWM fan. We'll see how those work out when the boards come back.

Nice project! Will you put boards up for sale on Tindie or similar?

How about a battery pack connector for a LiPo or similar and some charge control? A mini UPS? My biggest gripe with the Pi's is that a sudden power loss can wreck havoc on the file system making it unbootable.

And a button for safe power off (that will be automatically triggered if the power is out and the battery is getting low) Also, if there's an RGB LED strip connected, do short flashes of red to alert the user! :rotating_light:

For now I'm not using an RPi for octoprint, but an Up Squared that is way too powerful for the job. I'd like to use the Up for other, more demanding tasks :slight_smile:

I'll put 'em on Tindie if they are popular, but they aren't cheap, either. That's part of why the Pi doesn't have this built-in.

UPS prob needs to be external to this project, there are 18650-style PiUPSes out there.

I had three buttons .. and a few neopixel-style LEDs .. and a 16-LED bar graph in various versions. Just too many things to go wrong. I will probably add the buttons back- it takes three to properly handle "shut down Pi", "start up Pi" and "cancel print". On the bright side it's easy to add those on without this board.

Are you running Ubuntu on that or Yocto (for OctoPrint)?

It's plain Ubuntu 18.04 LTS. When I installed it was just for testing, to see how octoprint performed on that hardware. So it's not running the custom Linux kernels that would give me access to all the cool hardware features on that board.

1 Like

I like that it's got USB 3. Soon enough, one of these printer boards will start supporting that and it would be good to do some early testing.

Next iteration in this pic, though I have a test board enroute and will have another iteration coming after that before it is even possibly ready- the fan pins and level converters were wrong and the MOSFETs were wrong. doh. So I'm doing a "test board" with a few designs on it.

But anyhow, you can see the shield mounted, the fan mounted, and the whole thing on a bracket that sits on the back of a Prusa.

There's a lot of lolworthy colors in it, and there are a lot of layers, but it's a quick snapshot.


At least it's color-coordinated with your Ethernet cable.

I mean, considering the time of year a bit of an Easter egg colour scheme is just fitting. :smile:

Good job !

I like it. It's just the sort of thing I could find useful in quite a number of instances

1 Like

I've been using the previous version on one of my printers for a few weeks, and a waaay earlier version in my off-the-grid shed, which has a Pi connected to its solar panel. But thye are just power shields, with the one on the printer having voltage/current measurement. My experimenter board was helpful for me to explore a few things:

  • I got the MOSFETs sorted out. They'll be really nice for LED control.
  • I got the 4-pin fan figured out in many ways: I can control it and safely sense the rpm using the 3.3v GPIO, it is 5v powered, and I've verified that I can push a pwm signal with a 25khz "carrier" from the GPIO and can read the fan speed pulses in Python. (see oscilloscope screenshots below)
  • I'd experimented with a 4-channel LED controller and can turn them on/off/dim/blink but .. is it worth anything? I don't think so. Initially I thought I'd use it to do some level shifting for the fan.

Things I'm pondering:

  • screw terminals are kinda iffy, and I don't really like many other board connectors. Maybe I should just use screw terminals for the power and use dupont headers for the rest? They are easy to plug/unplug, at least. Or a DC barrel jack for power?

sale plan:

  • finish up some proof-of-concept standalone scripts
  • create a rudimentary octoprint plugin (display power+rpm, set fan speed)
  • I'll publish the plans and the BOM along with the pricing I pay to get a couple of them done.
  • Sell a 'base model' with all the SMD soldering done (~$20?)
  • add-ons:
    • all soldering done ($5?)
    • MOSFETs added+voltage/current monitor added ($10?)

Between R&D, low quantities, and yield I will never make a profit, but I'd be happy if there are more than two or three people using it.

You might be able to tell from the 'options' I don't like soldering :slight_smile:

'scope shots

1 Like

I kind of like the green variety of DC screw terminals, to be honest. They just need to accept the gauge of wire that's appropriate for the circuitry on the high side.

Phoenix makes a type of plug/connector in this space. It's not really connector-compatible with a lot of the boards we use... or is it? :thinking:

I wouldn't trust a Dupont connector for the power you might see.

I think the green ones in the back would be the ones that are the most useful to someone like me.

At least one of the OSEPP motor shields has connectors which are compatible with that. Unfortunately, they don't appear to sell the stand-alone plug; it just comes in their robotic kits in number. I dunno, maybe this is a Phoenix-style plug we're talking about. Whatever they are, I do love them.

Also, I tend to use this guy when someone presents me with the standard DC barrel connector jack. I can't say that I love this arrangement, though. To me, it presents an amazing leverage point where that soldered-down connector can be destroyed from its soldering to the board.

To anyone adding a DC barrel jack to a board: why not move that barrel connector to the center of the board and free up some space where the plug/cable can live and further, include two rectangular cutouts so that we might then zip-tie the cable to the board (preventing accidents)?

Definitely not talking about using Dupont for incoming power- even though Ohms Law is forgiving with a voltage being 2x-5x higher, just.. no. Though for the others it is cheap and space efficient.

Barrel jack- 3d print a stay :grinning:

BTW can you find me a part number for the Phoenix connector? I'll probably try to support My Way and leave space for an alternate.


Manufacturer: Phoenix Contact
2-pin connector: 260518
Open style: 260463
Filtered search: (active) dc connectors by Phoenix

You can always just mark the board, add the loose parts and let the consumer solder to their heart's content.

Thanks for the part. I'm mobile but I've looked for hours on BOMs for this.

That's a 5.08 spacing, so a good example of what I meant by "my way or space for an alternate". The current board uses 2.54 spacing for the screw terminals but that's waaaay too close for any stranded wire.

I can vouch for Digikey if you've not used them before. I always buy in bulk from them to make the value-versus-shipping work out.