Maker.io main logo

How to Select a Power Supply for Your Project

2023-08-24 | By Zach Hipps

In this article, I'm going to talk about how to pick a power supply for your project. Yes, I realize that's a lot of alliteration, but let's get started! I'm going to start by talking about batteries. The most common type of batteries are alkaline, and they come in different sizes like AA and AAA. Alkaline batteries are great if your project doesn't require more than 6V and it doesn't require a lot of power. The downside to these is that you can't charge them. If you want to be able to charge your batteries, you'll need to get nickel metal hydride. These are usually marketed simply as rechargeable batteries and have the same form factor as alkaline. They usually come in AA and AAA sizes. For projects that need higher current discharge rates, lithium polymer, and lithium-ion cells are a great choice. These are also rechargeable if you have the right equipment.

How to Select a Power Supply for Your Project

How to Select a Power Supply for Your Project

The cool thing about batteries is that if you need more capacity or voltage, you can arrange them in either series or parallel. I won't go into too much detail here because there is a DigiKey video that already explains this really well. But basically, all alkaline cells have a voltage of 1.5V, while NiMH have a voltage level of 1.2V. Meanwhile, lithium-based cells always have a voltage of 3.7 volts. These voltages are the nominal voltage. Of course, if the battery is fully charged, it will be a little bit higher than that. And when it's fully discharged, it'll be a little bit lower than that. If you need to increase the voltage of a cell, you can put two or more in series to increase the voltage. When you put batteries in series like this, the capacity will stay the same, but the voltage of each cell will add up. So, if you have two alkaline cells, for example, the voltages of each will add up to 3V. Or for example, if you have four alkaline cells, the voltage will add up to 6V. If you want to increase the capacity of your battery pack, you need to consider putting the battery cells in parallel. In this case, when you put batteries in parallel, the voltage will stay the same, but the capacity will add up. So, in theory, you could build a battery pack with cells in series and in parallel to increase the voltage and capacity.

How to Select a Power Supply for Your Project

How to Select a Power Supply for Your Project

In addition to the capacity rating, a battery will typically have a charge and a discharge rating as well. The capacity rating is usually measured in mAh, which stands for milliamp hours. If a battery has a capacity of 100 mAh and your project draws 10mA, then your project can last up to 10 hours on that battery. There is an awesome battery life resource on DigiKey’s website to help with these calculations. When selecting a battery for your project, it's really important to make sure that your project doesn't draw more current than the discharge rating of your battery. So, for example, if I have a 3-cell lipo battery, there are three lithium polymer cells in series, with a voltage that adds up to 11.1 volts. Now, let’s say this particular battery pack has a capacity of 5200 mAh and a discharge rating of 80C. That 80C means the battery can discharge continuously at 80x the capacity rating. So 80x5.2A equals a continuous discharge rating of 416 amps. If you ignore this rating and try to discharge at a higher rate, you run the risk of damaging the battery or causing excess heat or even a fire.

How to Select a Power Supply for Your Project

The next option when it comes to powering your project is an AC power supply. These are sometimes called “wall warts" because they can be unsightly, but they are a great option for powering your project. We all have these lying around our house. I have a box of power supplies from old routers and cell phone chargers. These types of power supplies will have a voltage rating just like a battery, and they will also have a continuous current rating. This means that under normal conditions when the supply is plugged into the wall, it will deliver a constant voltage of 5V or 12V or whatever it's rated for. When a load is connected to your power supply. In this scenario, the load in your project will determine how much current it requires from the power supply. When you're choosing a power supply, be sure that the discharge rating is at least as high as the current consumption of your project. For example, I have an old cell phone charger that is rated up to 2A at 5V. So that means I can use this to power any project that uses up to 2A. It doesn't matter if it uses less than 2A, it just can't use more than 2A. I tend to err on the safe side and choose a power supply that is rated for about 1.5x the current needs of my project. So, for example, if my project requires 5V and 500mA, any power supply that's rated up to 750mA will do.

How to Select a Power Supply for Your Project

What about if you're prototyping your project on a breadboard? What's the best way to supply power? One option is to take an old USB cable and strip the ends off and plug those into the power rails. My favorite option is dedicated breadboard power supplies built on a PCB. They plug right into the power of the breadboard. These breadboard power supplies can be powered by a USB cable or a barrel jack from a wall supply. Most have a little jumper where you can select the output voltage between 5V and 3.3V. Another option is to use a benchtop power supply. These are great if you need a large amount of current or you need to adjust the voltage. Benchtop power supplies can even safely limit the current going into a project. So, you can protect your circuit against too much current if something goes wrong.

How to Select a Power Supply for Your Project

Sometimes you might be working with components on a PCB (printed circuit board). Components often need power supplies with tighter tolerances than the other options that I've discussed. A common type of PCB power supply is the linear regulator. These ICs are very easy to use and often just have three pins: ground, voltage in, and voltage out. Let's say I have a two-cell lithium polymer battery with a voltage of 7.4V, but the humidity sensor I’m using needs 5V. I can connect the 7.4V battery to ground and the input, and I’ll get 5V between ground and the output. The big downside to using linear voltage regulators is that they are very inefficient. The extra unused voltage has to pass through the internal resistance of the linear regulator. This power is being used to generate heat inside the regulator instead of being used to power something useful. This problem gets worse when the amount of voltage drop increases. Let's say, for example, you connected a 12V battery to the same regulator. That means that 7 of those volts are being wasted to generate heat. Unless your intention is to build a heater, this is not good! Alternatively, there are switch-mode power supplies. These ICs use internal transistors and several external components, including a diode, an inductor, and a capacitor. With this design, a switch mode power supply can create an output voltage very efficiently with very little wasted energy or heat. When a switch mode power supply is used to convert a higher voltage to a lower voltage, it's called a buck converter. On the other hand, it's called a boost converter when the output voltage is higher than the input voltage. I designed a PCB that uses a 1.5V coin cell battery and boosts the voltage up to 5V using a switch mode power supply. So it would be considered a boost converter because the output voltage is higher than the input voltage.

How to Select a Power Supply for Your Project

How to Select a Power Supply for Your Project

Which of these options you choose will depend on how and where you use this project. I know it seems obvious, but sometimes we overlook this important question. If your project needs to be mobile and cannot be tethered to a wall, you'll want to consider one of these battery options. If your project doesn't absolutely need to be mobile, then using an AC power source from the wall is the way to go. It often comes down to just having experience with each of these power supply options to know which one will best fit the needs of your project. So, start building projects and try out these different options, and you'll start learning the pros and cons of each one!

Parts mentioned can be found here:

Non-rechargeable batteries: https://www.digikey.com/en/products/filter/batteries-non-rechargeable-primary/90

Rechargeable batteries: https://www.digikey.com/en/products/filter/batteries-rechargeable-secondary/91

Wall adapters: https://www.digikey.com/en/products/filter/ac-dc-desktop-wall-adapters/130

Linear voltage regulators: https://www.digikey.com/en/products/filter/power-management-pmic/voltage-regulators-linear-low-drop-out-ldo-regulators/699

Switching voltage regulators: https://www.digikey.com/en/products/filter/power-management-pmic/voltage-regulators-dc-dc-switching-regulators/739

Benchtop power supplies: https://www.digikey.com/short/34pqhvnt

Recommended Reading

How to Connect Batteries in Series and Parallel Configurations - Another Teaching Moment | DigiKey Electronics

What is an Amp Hour? - Another Teaching Moment | DigiKey

制造商零件编号 WPM467
BREADBOARD 3.3V/5V POWER SUPPLY
Pimoroni Ltd
¥57.63
Details
制造商零件编号 PRT-21297
SPARKFUN BREADBOARD POWER SUPPLY
SparkFun Electronics
¥121.69
Details
制造商零件编号 DFR0140
BREADBOARD POWER SUPPLY 5V/3.3V
DFRobot
¥37.04
Details
制造商零件编号 184
ADJUSTABLE BREADBOARD POWER SUPP
Adafruit Industries LLC
¥121.69
Details
制造商零件编号 PRT-00114
SPARKFUN BREADBOARD POWER SUPPLY
SparkFun Electronics
¥97.27
Details
制造商零件编号 PRT-08376
SPARKFUN BREADBOARD POWER SUPPLY
SparkFun Electronics
¥109.89
Details
制造商零件编号 FIT0506
PURE COPPER HEATSINK PACK OF 5 (
DFRobot
¥36.63
Details
制造商零件编号 FIT0367
RASPBERRY PI COPPER HEATSINK
DFRobot
¥8.06
Details
制造商零件编号 DFR0244-B
AMMETER 0-9.99A LED PANEL MOUNT
DFRobot
¥57.29
Details
制造商零件编号 FIT0504
ALUMINUM HEATSINK COOLING FAN FO
DFRobot
¥97.68
Details
Add all DigiKey Parts to Cart
TechForum

Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.

Visit TechForum