A while ago, I wrote an article called A Closer Look Inside the Arduino Uno. In the article, I glossed over powering the Arduino.
The post also gives a brief history lesson on the board, goes over the layout and some of the main components, discusses the Arduino pin out, and finally, talks about a few nuances of the Arduino Uno which may cause some seemingly weird errors to occur.
In that post, I made the promise to go into more detail on some of the often overlooked, but important nuances of the Uno.
This time around, we’ll delve a bit deeper into powering the Arduino Uno and talk about some of its limitations and best practices for doing so.
Let’s get started!
Powering the Arduino
Powering the Arduino is something many of us put little thought into. Most of us simply grab our wall wart, jam it into the Arduino’s DC jack and go to town on what ever it is we’re working on.
The Arduino Uno’s built-in power supply is one of the least appreciated, but most important parts of the board.
In fact, if your Arduino-based creation is giving you weird or spurious errors and you can’t figure out why, there’s a good chance the power supply may be the culprit.
Powering the Arduino: A Quick Overview
Figure 1 shows the power supply section of the Arduino Uno board.
As we can see, the input power can come from a few different sources:
- The DC jack (center positive)
- USB connector
- Vin header socket
- 5 V header socket
Figure 1: the power supply portion of the Arduino board.
If you plug in both a DC power adapter (like a wall wart) and a USB cable, the board automatically draws power from the source with the higher voltage. There is a small FET (field effect transistor) to the left of the crystal that isolates the USB power from the DC jack to prevent it from back feeding into your PC’s USB port.
Also, there is a series diode that prevents reverse polarity from the DC jack. Inadvertently reversing the polarity can destroy the board.
The Arduino headers include three power outputs:
- Vin raw DC
- 5 V regulated
- 3 V regulated
The Vin socket connects to the 5 V regulator which powers the 5 V header socket and the rest of the board.
A word of caution is in order here. Vin is NOT protected by the series diode we mentioned earlier (it connects downstream of it). This means swapping ground (GND) and Vin will ruin the board.
Powering the Arduino: More Detail and a Possible Hack
When powering the Arduino, there is more than meets the eye, at least at first glance.
You’ll notice two capacitors near the DC jack in figure 1.
The one on the right stores energy for power arriving through the DC jack.
The specifications on the Uno say that you can use up to 20 V to power the board. The problem is these capacitors are only rated for 16 V. As you may have already discovered, electrolytic capacitors can fail rather catastrophically when polarity is reversed or when pushed beyond their voltage limit.
Low quality wall warts often have unregulated outputs that can exceed the ratings on the case — especially at lower currents, so be careful here.
One possible hack would be to replace the Uno’s capacitors with ones that boast a higher rating, say, 25 V. The caps are 47 µF electrolytic capacitors. This could be a good beginner’s Arduino project and also a good insurance policy on your board. Note that some boards, like the SMD version of the Uno I have, already come with higher rated capacitors.
Or you can just use a decent quality wall wart within the voltage specs of the capacitors the board comes with.
Just above the DC power jack lies the Arduino’s 5 V regulator. This device has a dropout voltage of around 1 V – 1.2 V depending on the current load. This requires a DC input of at least 6.5 V to ensure 5 V comes out, even though the Arduino specs on the voltage limits say 6 V (on the low end) is ok. Note, however, that the recommended voltage range starts at 7 V.
The power related specs (from the Arduino website) for the Uno are shown in figure 2.
Figure 2: Arduino Uno power specs.
That’s Too Much Power, Scotty!
The Arduino specs don’t say a lot about it, but if you use more than 12 V to power the device the regulator could overheat, damaging the board.
The voltage regulator does have its own internal over-temperature protection. This will shut it down when the temperature goes above 350° F (175° C).
Once the temperature drops, the regulator will automatically resume operation. This means that powering the board improperly can not only damage it, but cause strange errors and failures as the ATMega328P microcontroller restarts.
For most of us, when we put a finger on an object of about 150° F (65° C), we will only be able to keep our finger on it for a few seconds before the pain sets in. This is a good rule of thumb for hobbyist electronics in general: if you can’t touch it for more than a few seconds, it’s too hot.
The rules may be different if you’re designing a commercial or industrial widget, which often have to stand up to harsher environments, like under the hood of your car.
The Arduino, being a low-cost open-source platform aimed at hobbyists, is not meant to stand up to temperatures much greater than that for very long.
For a 12 V input, the maximum regulator current (using the rule above) is only about 70 mA.
How did I come up with that number?
I won’t bore you here, but if you read the data sheet for the regulator and do a bit of math (making a few rough assumptions) you should get something close.
With a 12 V supply, the max current (using our rule) isn’t much. The microcontroller itself draws about 10 mA at 16 MHz, the USB interface takes another 15 mA, and the rest of circuitry on the board (like the LEDs etc.) eat up another 10 mA or so. Not much room for anything else here.
The take-away: use a power supply less than 12 V.
For example, using the same thinking that gave us a limit of 70 mA for a 12 V power supply, we can raise that to about 250 mA if we use a 7 V power supply. Don’t have a 7 V supply? Grab the closest thing to it.
This type of precaution not only protects the 5 V regulator, it also protects the 3.3 V regulator.
Another word of caution is in order: watch your sources.
Since Arduino boards are open-source, anyone can copy the design and alter it as they see fit. For example, some Arduino look-alikes don’t have thermal vias (little copper-lined holes to conduct heat between the layers. You can see a lot of them in figure 1.) so the regulator is likely to run hotter.
Powering the Arduino: Keeping Your Cool
One trick some people employ is to add a heatsink to the regulator. While this can help a bit, the case is made of plastic and doesn’t conduct heat away very well.
A minute ago, we talked about using a 7 V (or something close) power supply. But what if your project requires 12 V or more?
One way around this is to use a separate power supply for the project. You could also feed another voltage regulator that produces a lower voltage with that 12 V supply (with a heatsink, if needed) and feed the Arduino with its output. For example, a LM317 regulator with a few resistors would produce 7 V.
Here’s another good rule of thumb for those wishing to venture into this territory: when your power supply becomes more expensive than your Arduino board, it’s time to rethink things.
Going back to figure 2, we can see that the DC current limit for any digital pin is 20 mA. This is barely enough to drive one LED.
This is important because the microcontroller’s output pin drivers have no current limiters. We’ll talk more about I/O pin specs and characteristics in another post.
It’s been said that too much power often corrupts people. Too much power can also corrupt your project and ruin your board, as we have seen.
There is definitely more than meets the eye to powering the Arduino.
You may be able to bend or even break some of the rules and guidelines we’ve discussed a few times, but if done often enough, it will catch up to you. You’ll know it when the magic smoke appears or the board simply ceases to work.
We’d love to know what your favorite trick is when it comes to powering the Arduino. Leave a comment and tell us. Who knows, maybe your way works even better than the ones mentioned here!
Like this post? You’ll love the electronics Facebook Group. Request to join today