How to Power a Project

Pages
Contributors: JordanDee
Favorited Favorite 71

Overview

This tutorial will cover the various ways you can power your electronic projects. It will go into some detail about voltage and current considerations you may want to make. It will also go into the extra considerations you have to make if your project is mobile/remote or, in other words, not going to be sitting next to a wall power outlet.

If this is truly your first electronic project, you have the option of reading through this tutorial or sticking with the recommended supply for the project or development board of your choice. The SparkFun Inventor’s Kit contains the USB cable you need for power and works fine for all the projects in the kit as well as many more advanced projects. If you're feeling overwhelmed, that kit is the best place to start.

Suggested Reading

Here are related tutorials you may want to check out before reading this one:

Ways to Power a Project

Here are some of the most common methods used for powering a project:

  • USB Power
  • Variable DC Benchtop Power Supply
  • AC to DC Wall Adapter (like a computer or laptop would use)
  • Batteries

Left to Right: AC/DC power adapter, bench supply, battery, USB cable

Four common ways to supply power to your project

Which Option Should I Pick to Power My Project?

The answer to this question largely depends on your project specific requirements.

USB Power

If you're starting off with the SparkFun Inventor's Kit or another basic development board, you will likely just need a USB cable. The Arduino Uno is an example that requires only a USB A to B cable to supply the power to run the example circuits in the kit. Here are a few USB cables from our catalog to power your project from a USB port.

USB Cable A to B - 6 Foot

USB Cable A to B - 6 Foot

CAB-00512
$4.50
1
USB Micro-B Cable - 6 Foot

USB Micro-B Cable - 6 Foot

CAB-10215
$5.50
15
USB 3.1 Cable A to C - 3 Foot

USB 3.1 Cable A to C - 3 Foot

CAB-14743
$5.50
4
SparkFun USB Mini-B Cable - 6 Foot

SparkFun USB Mini-B Cable - 6 Foot

CAB-11301
$4.50
3

Variable DC Benchtop Power Supply

If you're in the business of building projects and testing circuits regularly, acquiring a variable DC bench power supply is highly recommended. This will allow you to set the voltage to a specific value depending on what you need for your project. It also buys you some protection as you can set a maximum current allowed. Then, if there is a short circuit in your project, the bench supply will shut down hopefully preventing harm to some components in your project.

Here are a few variable DC benchtop power supplies from our catalog.

Power Supply - Multi-Range DC 84V, 10A

Power Supply - Multi-Range DC 84V, 10A

TOL-14926
Retired

Power Supply - Multi-Range DC 42V, 20A

TOL-14927
Retired

Switching Power Supply - DC 36V, 3A

TOL-14928
Retired
Switching Power Supply - DC 20V, 5A

Switching Power Supply - DC 20V, 5A

TOL-14929
3 Retired

AC to DC Wall Adapters

A specific AC to DC power supply is often used after a circuit is proven. This option is also great if you often use the same development board again and again in your projects. These wall adapters usually have a set voltage and current output, so it's important to make sure that the adapter you choose has the correct specifications as the project you will be powering and to not exceed those specifications. Here are a few wall adapters from the catalog that offer a few amps.

Wall Adapter Power Supply - 12VDC, 600mA (Barrel Jack)

Wall Adapter Power Supply - 12VDC, 600mA (Barrel Jack)

TOL-15313
$6.50
Wall Adapter Power Supply - 9VDC, 650mA (Barrel Jack)

Wall Adapter Power Supply - 9VDC, 650mA (Barrel Jack)

TOL-15314
$6.50
1
USB Wall Charger - 5V, 1A (Black)

USB Wall Charger - 5V, 1A (Black)

TOL-11456
$4.50
2
Wall Adapter Power Supply - 5VDC, 2A (USB Micro-B)

Wall Adapter Power Supply - 5VDC, 2A (USB Micro-B)

TOL-15311
$6.50

For more current hungry projects, check out some of these power supplies from our catalog. Just make sure to get the appropriate cable for your region from product page's recommended products.

Mean Well LED Switching Power Supply - 5VDC, 5A

TOL-14601
Retired
Mean Well Switching Power Supply - 24VDC, 18.8A

Mean Well Switching Power Supply - 24VDC, 18.8A

TOL-16265
Retired
Mean Well Switching Power Supply - 12VDC, 12.5A

Mean Well Switching Power Supply - 12VDC, 12.5A

TOL-16266
Retired
Mean Well Switching Power Supply - 5VDC, 18A

Mean Well Switching Power Supply - 5VDC, 18A

TOL-16607
Retired

Batteries

If you want your project to be mobile or based in a remote location away from where you can gather AC wall power from the grid, batteries are the answer you're looking for. Batteries come in a huge variety, so be sure to check out the later parts of this tutorial so you can figure out precisely what to choose. Common choices include alkaline, rechargeable NiMH AA's, and lithium polymer ion. Here are a few batteries from the catalog.

Lithium Ion Battery - 2Ah

Lithium Ion Battery - 2Ah

PRT-13855
$13.95
9
2500 mAh NiMH Battery - AA

2500 mAh NiMH Battery - AA

PRT-00335
$3.25
9V Alkaline Battery

9V Alkaline Battery

PRT-10218
$2.25
1

Low Current Lithium Ion Battery Pack - 2.5Ah (USB)

TOL-15204
3 Retired

If your project needs a certain voltage or a bit more current from a battery, try adding a boost converter or switching regulator. You can take the varying voltage from your battery and output a set voltage 5V. Depending on the board and components used with your project, you could potentially output 9V or 10V depending on the configuration. You'll just need make sure to get the necessary components to build your circuit in order to output voltages higher than 5V. Here are a few converters from our catalog.

SparkFun Buck-Boost Converter

SparkFun Buck-Boost Converter

COM-15208
$10.95
2
SparkFun LiPo Charger/Booster - 5V/1A

SparkFun LiPo Charger/Booster - 5V/1A

PRT-14411
$17.50
3
LiPower - Boost Converter

LiPower - Boost Converter

PRT-10255
$17.50
5

Step Up/Down Inverting Switching Regulator

COM-00317
Retired

Voltage/Current Considerations

How Much Voltage Do I Need for Project X?

This depends largely on the circuit, so there is no easy answer to this question. However, most microprocessor development boards like the Arduino Uno have a voltage regulator on board. This allows us to supply a voltage in a specified range above the regulated voltage. A lot of microprocessors and IC's on development boards run at 3.3V or 5V but have voltage regulators that can handle anywhere from 6V to 12V.

The power comes from a power supply and is then regulated closely by a voltage regulator so that each chip is powered at a consistent voltage even when the current draw may fluctuate at different times. Here at SparkFun, we use 9V power supplies for many of our products that operate in the 3.3V to 5V range. However, to verify what voltages are safe, it is recommended that you check the datasheet for the voltage regulator on the development board to see what voltage range is recommended by the manufacturer.

How Much Current Do I Need for Project X?

This question also depends on the development board and microprocessor you're using as well as what circuits you plan on connecting to it. If your power supply cannot give you the amount of juice the project needs, the circuit may start acting in a strange, unpredictable way. This is also known as a brown-out.

As with voltage, it's recommended to check the datasheets and estimate what the different bits and pieces of the circuit might need. It's also better practice to round up and assume your circuit will need more current than to not provide enough current. If your circuit includes elements that require massive amounts of current, like motors or large amounts of LEDs, you may need a large supply or even separate supplies for the microprocessor and the extra motors. Otherwise, the dips in power may cause the microprocessor to reset, not provide enough torque from your motor, or your LEDs may not fully light up. Again, it's always in your best interest to get a power supply rated for a higher current and not use the extra compared to having a supply that can't provide enough.

https://cdn.sparkfun.com/assets/learn_tutorials/7/7/9/Brown_Out_with_Addressable_LED_Strips.jpg

Brown-Outs with Daisy Chained LED Strips

Have No Idea How Much Current Your Project Draws?

Once you've been playing with circuits for a while, it will be easier to estimate the amount of current your project requires. However, the common ways to figure it out experimentally are to either use a variable DC benchtop power supply that has a readout for current or to use a digital multimeter to measure the current going to your circuit while it's running. This will give you a general idea of what kind of power supply to choose for your project.

If you don't know how to measure current with a multimeter, please see our multimeter tutorial.

How to Use a Multimeter

January 9, 2015

Learn the basics of using a multimeter to measure continuity, voltage, resistance and current.

We highly recommend having a DMM in your electronics toolbox. It's great for measuring current or voltage.

Connections

How Do I Connect My Battery or Power Supply to My Circuit?

There are many ways to actually connect a power supply to your project.

Left to right: banana jacks, wire hookup, barrel jack, battery case, JST

Common ways to connect a power to your circuit

Variable benchtop power supplies commonly connect to circuits using banana jacks or wires directly. These are also similar to the connectors found on the multimeter probe cables.

Banana to IC Hook Cables

Banana to IC Hook Cables

CAB-00506
$5.50
7
Banana to Banana Cables

Banana to Banana Cables

CAB-00507
$5.50
2
Banana to Alligator Cable

Banana to Alligator Cable

CAB-00509
$4.50
3
Banana to Alligator Coax Cable

Banana to Alligator Coax Cable

CAB-00508
$5.50
1

Many projects are built on a breadboard first with wires as a prototype, before they become a final product. There are numerous ways to power your breadboard circuit, many of them involving the same connectors mentioned here.

Breadboard - Self-Adhesive (White)

Breadboard - Self-Adhesive (White)

PRT-12002
$5.50
48
Hook-Up Wire - Assortment (Solid Core, 22 AWG)

Hook-Up Wire - Assortment (Solid Core, 22 AWG)

PRT-11367
$21.50
38
Jumper Wires Premium 6" M/M Pack of 10

Jumper Wires Premium 6" M/M Pack of 10

PRT-08431
$4.50
2
Breadboard - Mini Modular (Red)

Breadboard - Mini Modular (Red)

PRT-12044
$4.50

Once a project is past the prototyping phase, it will usually end up on a PCB. If you plan on making the circuit once or twice, one can transfer the circuit to a prototyping board and wire the circuit up manually to secure project. If you plan on making the circuit more than a few times, you may want to look into designing the circuit with a CAD software (i.e. Eagle) to save time wiring the project or if you plan on shrinking the size of the overall circuit.

SparkFun Solder-able Breadboard

SparkFun Solder-able Breadboard

PRT-12070
$5.50
20
SparkFun ProtoShield Kit

SparkFun ProtoShield Kit

DEV-13820
$12.50
3
SparkFun Snappable Protoboard

SparkFun Snappable Protoboard

PRT-13268
$8.95
21
SparkFun Big Red Box Proto Board

SparkFun Big Red Box Proto Board

DEV-13317
$8.95
1

One of the most common power connectors used on a finished PCB, in both consumer electronics and hobby electronics alike, is the barrel connector, also know as a barrel jack. These can vary in size, but they all function the same and provide a simply, reliable way to power your project. Depending on your design, you can also pull power from a computer or wall adapter's USB port.

SparkFun USB-C Breakout - Horizontal

SparkFun USB-C Breakout - Horizontal

BOB-15100
$4.95
6
DC Barrel Jack Adapter - Female

DC Barrel Jack Adapter - Female

PRT-10288
$3.50
1
SparkFun microB USB Breakout

SparkFun microB USB Breakout

BOB-12035
$2.95
12
DC Barrel Jack Adapter - Breadboard Compatible

DC Barrel Jack Adapter - Breadboard Compatible

PRT-10811
$1.05
8

Batteries are generally held in a case that holds the batteries and connects the the circuit via wires or a barrel jack. Some batteries like Lithium Polymer Ion batteries often use a JST connector. Here are a few from our catalog.

9V Battery Holder

9V Battery Holder

PRT-10512
$3.50
3
Battery Holder 2xAA with Cover and Switch

Battery Holder 2xAA with Cover and Switch

PRT-09547
$1.60
Coin Cell Battery Holder - 2xCR2032 (Enclosed)

Coin Cell Battery Holder - 2xCR2032 (Enclosed)

PRT-12618
$2.10
1
JST Right-Angle Connector - Through-Hole 2-Pin

JST Right-Angle Connector - Through-Hole 2-Pin

PRT-09749
$1.05
2

To learn more about different power connectors, please see our connectors tutorial.

Connector Basics

January 18, 2013

Connectors are a major source of confusion for people just beginning electronics. The number of different options, terms, and names of connectors can make selecting one, or finding the one you need, daunting. This article will help you get a jump on the world of connectors.

Remote/Mobile Power

Which Battery Should I Choose?

When you're powering a remote circuit, the same issues of finding a battery that delivers the proper voltage and current still apply. Battery life, or capacity, is a measure of total charge the battery contains. The capacity of a battery is usually rated in ampere-hours (Ah) or milliampere-hours (mAh), and it tells you how many amps a fully charged battery can supply over a period of one hour. For example, a 2000mAh battery can supply up to 2A (2000mA) for one hour.

Battery size, shape, and weight is also something to consider when making your project mobile, especially if it's going to be on something that flies like a small quad-copter. You can get a rough idea of the variety by visiting this Wikipedia list. Learn more about battery types in our battery technology tutorial.

Battery Technologies

February 6, 2013

The basics behind the batteries used in portable electronic devices: LiPo, NiMH, coin cells, and alkaline.

Batteries in Series and Parallel

You can add batteries in series or parallel to produce the desired voltage and current needed for your project. When two or more batteries are placed in series, the voltages of the batteries are added together. For example, lead-acid car batteries are actually made out of six single-cell lead acid batteries tied together in series; the six 2.1V cells add up to produce 12.6V. When tying two batteries in series, it's recommended that they be of the same chemistry. Also, be wary of charging batteries in series as many chargers are limited to single-cell charging.

alt text

When you connect two or more batteries in parallel, the capacities add. For example, four AA batteries connected in parallel will still produce 1.5V, however the capacity of the batteries will be quadrupled.

alt text

How Much Battery Capacity Do I Need For My Project?

This question is easier to answer once you have determined the amount of current that your circuit normally draws. In the following example, we will use estimation. However, it is encouraged that you measure current draw of your circuit using a Digital Multimeter to get accurate results.

As an example, let’s start with a circuit, estimate its current output, then select a battery and calculate how long it the circuit will run on battery power. Let’s choose a ATmega 328 microcontroller to be our brains for the circuit. It draws about 20mA under normal conditions. Let’s now connect three red LED’s and the standard 330 ohm current limiting resistors to digital I/O pins of the microcontroller. In that configuration, each LED added makes the circuit draw about 10mA more current. Now let’s connect two Micro Metal motors to the microcontroller as well. Each one of these uses approximately 25mA when turned on. Our total possible current draw is now:

Calculating Circuit Current Draw

Let’s choose a standard alkaline AA battery for this because it has more than enough current capability (up to 1A), has a decent battery capacity (usually in the range of 1.5 Ah to 2.5Ah), and is very common. We'll assume the average is 2Ah for this example. The downside to using a AA is it only has a 1.5V output, and, since the rest of our components will run on 5V, we need to step up the voltage. We can use this 5V step-up breakout to get the voltage we need, or we can use three AA batteries in series to get us close to the voltage we need. Three AA’s in series gives us a voltage of 4.5 V (3 times 1.5V). You could also add another battery for a total of 6V and regulate the voltage down to what your circuit requires.

To calculate how long a circuit will last on battery power, we use the following equation:

The equation for calculating battery life

For a circuit powered by 3 AA's in parallel that's connected to a circuit with a constant 100mA current draw, this translates to:

We would ideally get 60 hours of battery life out of these three alkaline AA’s in this parallel configuration. However, it’s good practice to ‘derate’ batteries, which means to assume you’re going to get less than ideal battery life. Let’s conservatively say that we’ll get 75% of the ideal battery life, and therefore about 45 hours of battery life for our project.

Battery life can also vary based on the actual current draw amount. Here's a graph from an Energizer AA battery showing its expected battery life based on constant current draw.

Energizer AA E91 Specifications

Energizer AA, Current vs Battery Life

This is just one of the numerous configurations you could use to power your project remotely.

Stress Testing

Now that you have chosen your power supply and connector, make sure to test your project out and observe its behavior. Depending on the manufacturer, power supplies may have varying performances. Make sure to test the wall adapter over a certain period of time to ensure that the microcontroller won't brownout, and power supply won't reset under a load. For certain projects using capacitive touch sensors, make sure to test to see if there are any latencies caused by noisy power supplies.

If you are powering your project remotely, make sure to always test it with the battery. Batteries can provide varying outputs depending on the load attached and battery chemistry. This can also cause the microcontroller to brownout or stop providing power.

Resources and Going Further

You should now know the most common ways to power your circuit and how to figure out which way is best for you depending on your your project’s specific requirements. You can make a better judgment now based on current, voltage, connector, and mobility considerations for your project. Check out these other great tutorials to monitor, control, or power your project!

Alternating Current (AC) vs. Direct Current (DC)

Learn the differences between AC and DC, the history, different ways to generate AC and DC, and examples of applications.

What is a Battery?

An overview of the inner workings of a battery and how it was invented.

Wireless Joystick Hookup Guide

A hookup guide for the SparkFun Wireless Joystick Kit.

SparkFun Qwiic Quad Solid State Relay Kit Hookup Guide

A Hookup Guide to get you started with the SparkFun Qwiic Quad Solid State Relay Kit (say that five times fast!).

Or check out some of these blog posts for ideas: