Using multiple power supplies, maybe some of them USB

A lot of times, it really helps to have multiple power supplies. Pretty much, unless you are making something that’s small enough to be powered from the same USB port your microcontroller is programmed from, you already have multiple power rails.

I hope to get you all… well… trained up, on the subject with this.

Multiple power rails

If you have an Arduino-esque device getting power from the USB port, that’s a power rail.

If you have a second power supply for the LEDS, that’s another power rail.

Having multiple power rails is super-helpful. If the microcontroller is powered separately from the LEDs, it’s going to have a lot less electrical noise on its power rail.

This also means that you can handle multiple voltages. Say, you are dealing with 12V or 24V LED strips. You might have a tiny little 3.3V or 5V power supply to drive your microcontroller and then connect a beefy 24V power supply for the LEDs. There’s a wide assortment of power supply modules with two or more voltages because this happens a lot.

It turns out that it’s easier to split a project into multiple pieces each with an individual power rail than it is to try and combine the output of multiple power supplies into one giant Voltron power supply able to handle the complete load of the project.

A ground rule

Multiple power rails

The grounds for each of the power rails need to be all connected, in such a way that doesn’t create grounding problems like a ground loop. I talk a lot about ground loops in the section on grounding, but if you just have a power supply or two connected to the same outlet and the project is small, this shouldn’t bother you.

You should not connect two power supplies anywhere else than the ground. If you have two 5v power supplies and you try to get a more powerful 5v power supply, unless they are specifically designed to do this, it won’t work.

The care and feeding of the USB port

Your USB port has some blob of fancy power electronics driving it. Too impressively designed of a blob and your computer costs too much. Too cheaply designed of a blob and there’s a lot of warranty service calls because some random USB thing you plugged in zapped your computer… and mind you, there’s some wild and crazy stuff available that happens to plug into USB ports.

I do know, looking at the schematics for most of the microcontroller boards out there, that the sorts of stuff that sells well doesn’t have many protections on the USB port, so if you are using any of the popular development boards, it’s safe to assume that your only protection comes from whatever your computer has.

That being said, there’s not a whole pile of stories of people zapping their computers making cute little microcontroller projects. I accidentally shorted power to ground on a project and didn’t fry my USB port, but it did cause me to suddenly develop an interest in avoiding that happening in the future.

There are two things to stay aware of:

First, your USB port isn’t designed to feed power backwards. Cheap old stuff may just fry itself if you back-power the USB port. Most newer computers will pop up an error message and tell you to stop messing with the USB port if they sense back-power.

Restating for clarity: If you have a device that’s receiving power over USB like an Arduino or similar and you’ve added a second power supply to power LEDs, you should not connect the two power lines directly but you should connect the ground lines.

I have found some development boards that have diodes or MOSFET arrangements set such that they won’t backfeed the USB port, but it’s an easy way to make a cheaper board so even very legitimate manufacturers won’t add those parts.

Second, your USB port has some power budget and most of the time the common hobbyist grade microcontroller boards aren’t set up to actually talk to the computer about the power budget.

Because this is a very common problem and actual electrical engineers generally want to buy a chip or two to make the problem go away, there are a variety of products available to make your device safer.

One example device is a USB-oriented load switch like the AP22815, which is designed to shut the device down if there’s a short circuit or overload before the computer’s USB port sees it as well as protecting against voltage flowing backwards over the USB power lines.

A second example device is a polyfuse, set to go off at a reasonable power level.

If you are looking at a USB battery pack or a USB power adapter, note that there’s generally one rating that represents the overall power that it will provide and a second rating for each port. Thus, a lot of power problems can be made a little bit more tractable by splitting your loads into two or three power rails powered by individual USB power ports.

The OR-it’s-gone trail

Multiple power rails with diodes

It’s handy to OR power supplies.

For example, you might want to have a device powered by the USB port if it’s being programmed or by the external power supply otherwise.

You want a diode, ideal or otherwise.

The cheap-and-power-inefficient option is a plain old diode, generally a Schottky diode, which will let power pass one way. If you have two power supplies, the higher voltage wins. This comes at the cost of heat and voltage. You might have 5V in and only see 4.5V on the other side of the diode and the diode might melt after an amp or two.

Example diodes would be something like a 1N5819 diode, which is available in all sorts of packages including through-hole and can handle an amp or a variety of even larger diodes.

An “ideal diode” constructed from one or more MOSFETs will improve on the voltage drop problem and waste less energy, but you need to select one that’s appropriate for the design. They’ve been packaged into analog ICs so you don’t generally need to design it yourself.

One example device is the MAX40200, which is an ideal diode for 1 amp of power. A beefier and more feature-full version is a AP22815, which acts as an ideal diode plus it acts as a switch.

Throwing a Schottky diode in is a great way to solve simple problems that don’t use much power, like a microcontroller being programmed. Ideal diodes and other complex power switching networks are good for actually powering things.

Power switches and point-of-load regulators

I’ve got a whole separate section that’s just talking about power switches and turning the power on and off.

In general, you want to avoid the rainbow forest of having a power supply that provides ten voltages. A 3.3v microcontroller needs a separate 3.3v power supply from 5v USB, but you can usually just throw in a tiny regulator that’ll convert a little bit of power from 5v. This is called a point-of-load regulator.

Switching power supplies are handy here as well. Note that a massive application of regulators and switching power supplies these days is providing a myriad of different voltages off of the 12v power supply in a PC so there’s a wide variety there.

It’s also pretty reasonable to power the microcontroller with a plain old linear regulator because it’s not actually using up that much power.

At least for LED stuff, the two voltages to hit is 5v (because it’s everywhere) and something in the 12v to 36v range, where the lower-voltage strips tend to be 12v and the beefy COB LEDs can hit 36v or so.

It turns out that it’s a lot easier to step voltages down instead of up, so it’s generally easier to have a power supply providing the highest voltage you would need and then use a switching point-of-load regulator to provide the rest.

Switching power supply plus linear regulator

Each switching power supply is a lot of circuitry.

One thing you can do sometimes is use a switching power supply to get the voltage fairly close and then use a linear regulator to drop the remaining power.

The big example is if you are feeding some big RGB lights, you might find some constant-current linear power supplies that have a 0.2v or so dropout and then use a switching power supply to get the voltage such that the blue LED (which requires the most voltage) is just barely dropping the 0.2v voltage and therefore is not using up that much energy and the red LED might be dropping more like a volt or two… but that’s still less than three linear controllers that are each dropping several volts.

Remote power rails: Galvonic isolation, RS485, and DMX512

Multiple power rails

This gets into stuff that the “Grounding” section covers.

If you are making a project that is big or isn’t that big but just is going to have you plugging in a power supply over here and over there where there’s some distance, you probably need to think about this, because if you just connect all of the grounds, you are going to have a ground loop.

There are solutions for this, all of which require you to have a galvanically isolated protocol.

One easy answer is DMX512. I looked at the various options and it seems like the cheapest easy way to get galvonic isolation for DMX512 is to find a 1:1 DC/DC power supply to provide the galvanic isolation for the ground line and then use an isolated RS485 transceiver to provide the galvanically isolated signal lines, although there are also chips out there that will do everything for you.

Another easy answer is Ethernet. Or WiFi.

Where to go from here?


Posted:

Updated: