Powering an Arduino Uno

Hey guys,

Been trying to find some answers for these questions (which I'm sure are very basic) but I'm getting a little overwhelmed with everything I'm reading. Want to know a few things about powering an Arduino Uno:

  1. When powered by the USB port, how many volts is the Arduino receiving? I understand each pin provides 40 mA, but how many volts do they provide?

  2. I have 9V adaptor for my Arduino that outputs 0.66A. If I power my Arduino using this, does the Arduino regulate the voltage and drop it down or will each pin now provide 9V?

  3. How does the Arduino handle power sources with varying voltages? Does it regulate these down 5V or 3.3V depending on which pin you connect to? Will the VIN pin provide the full voltage of your power source?

Basically I'm just getting confused. When I try to look this stuff up I find dizzying amounts of stuff about MOSFETs and voltage regulatoes and buck regulators, etc.. Just need to figure out how the Arduino handles all this. Thanks so much.

Fennel Rye

  1. 5v
  2. 5v
  3. 5v

!

It will not provide 9V. It is a 5V maximum processor.

Does it regulate these down 5V or 3.3V depending on which pin you connect to?

Those pins are, generally speaking, outputs. Don't try to shove stuff into them.

Will the VIN pin provide the full voltage of your power source?

The Vin pin is after the reverse polarity protection diode so it would provide what you plugged into the power jack, less about 0.7V.

If you are running from USB I wouldn't be using the Vin pin. I don't think it is supposed to be a source of power from that. I might be wrong.

I understand each pin provides 40 mA ...

That's the absolute maximum rating. I wouldn't design around that. Also there are limits for groups of pins.

This might help:

Thanks for the quick reply, guys. So, just to clarify: If I plug a 9V wall wart into the Arduino, each pin will still only give off 5V. But if I come out of the VIN pin for power, I will be getting 9V? I guess I should make things a little clearer by explaining what I'm trying to accomplish.

I am making a cicle of 14 LEDs that have the following specs:

Ultraviolet LEDs
FW Current: 20mA
FW supply: 3.3V

I want to program this ring to create different patterns of LEDs blinking on an off, etc. Since I will have 14 LEDs at 20 mA each, I will need to provide 280 mA for them to function, right? Or will I need a bit more to power Arduino as well, and, if so, how much more? I am also trying to make this portable, so I am looking for a battery alternative. What would the specs of the battery pack need to be (minimum) to provide enough power for the Arduino and these 14 LEDs? Anything higher than 5V the Arduino just burns off as heat to keep it at 5V, is this right?

Is there a book or website that would explain all this? I have been reading all the Arduino stuff I can find but it seems hard to find a good, solid explanation of how it handles various power sources.

Thanks again guys.

The entire chip has a limit of 200 mA, so some sort of external switching will be needed. For example, transistors.

Do you need each LED to be individually addressable? (controllable)

You only have 20 pins which can be used to control stuff (D0 to D13, A0 to A5) so you may need some form of external control, like a shift register or port expander.

As for your battery requirements, a bit (lot) would depend on how often the LEDs are on. For example, if you only have half on at one time, that would halve the power requirements.

Nick,

Alrighty, well that does bring up some problems then. I'm not sure if I need each LED to be indivisually adressable. I basically want these 14 LEDs to do a chasing lights type pattern, where one turns on, then the following one turns on as the previous shuts off. I want this to chase faster and faster, and then I want just the six PWM pin LEDs to remain on, fading in and out (pulsing). Is something like this possible without having each LED in it's own pin? What would your suggestion be to handle this project? 20 pins is plenty, so do you think I would need a shift register or port expander still? Thanks so much, Nick.

chasing lights type pattern, where one turns on, then the following one turns on as the previous shuts off

Eyes are tricked very easily. With 3 groups of LED's you see the movement, and you can even play with different duty ratios:
Having either lights or "black holes" moving around
(For symmetry you'd need 12 or 15 leds, though)

more to power Arduino as well, and, if so, how much more

Arduino itself takes about 40 mA, I read. If it's regulator gets 9V, about 4V40mA are producing heat in the 5V regulator, 5V40mA are producing heat in the controllers (and the 3.3V regulator, and the power indicator, etc).

If you run 2*7 LED pairs in series, they have to share the 5V and probably won't take the full 20mA, you might even get along without switching transistors. Just tie the series pairs to pins 2..8 and see if the brightness is sufficient.
(To be on the safe side, test a single LED in series with a 120 Ohms resistor and verify the voltage drop is about 2.5 / 2.5 and the current is ok)

No. The ATmega's VCC determines what the voltage of an output pin will be. In all cases you mention, the input is either already 5v or regulated down to 5v before being connected to the ATMega's VCC.

So 9V on Vin will still result in the I/O pins being (about) 5V, because there is an on-board regulator that regulates the 9V down to 5V.

Eyes are tricked very easily. With 3 groups of LED's you see the movement, and you can even play with different duty ratios:
Having either lights or "black holes" moving around
(For symmetry you'd need 12 or 15 leds, though)

Thanks for the insight, Michael. Is there anyway you could expand upon this or lead somewhere that might explain it in detail? I'm a little confused about how to get the chasing light effect without each being seperately controlled, but I'm very curious to hear your idea.

Just tie the series pairs to pins 2..8 and see if the brightness is sufficient.

Fairly sure you are, but are you saying have 2 LEDs in series connected to pin 2, then 2 LEDs in series connected to pin 3, and so on until 8? So, if I have 7 sets of 2 LEDs in series, would that mean I only need to provide half of the mA? 7*20mA = 140mA + 40mA [for the Arduino] = 180mA... does this sound correct?

(To be on the safe side, test a single LED in series with a 120 Ohms resistor and verify the voltage drop is about 2.5 / 2.5 and the current is ok)

Are you saying to hook the LED through a resistor and into the Arduino with power (5V) and then test the voltage drop? What current would be okay?

So 9V on Vin will still result in the I/O pins being (about) 5V, because there is an on-board regulator that regulates the 9V down to 5V.

Thanks for clarifying, James! So no matter what the power source I'm putting into the Arduino (volts-wise) I can plan to use a resistor that would be sufficient for 5V, correct?

Appreciate all responses, guys. Getting more and more comfortable with all this.

I'm not sure what you mean by "come out of the VIN pin for power" but if you plug 9V into the power jack you will get 8.3V out of Vin, which is what you put in less the 0.7V drop on the protection diode. However that power is not particularly useful. You still get 5V out of the pins on the board. And if you try to somehow shove the 8.3V into the LEDs you will then blow up your processor as the 8V feeds back through the processor.

You could conceivably put the 8V into a transistor and use the processor to turn the transistor on and off.

As for the chasing effect, if you put the pins in groups of two, or three, it would still look like a chaser, but only need half (or a third) of the pins.

I just did a quick test. And this is the sort of thing you can do too.

Just taking 5V from a power supply, and running it through one red LED with a 220R resistor I measured 14.7 mA. This sounds right because the LED had a forward voltage drop of 1.7V, so:

current = (5 - 1.7) / 220 = 15 mA

Now put two LEDs in series and I measure 7.2 mA (about half). And this would be because the current is now:

current = (5 - 1.7 - 1.7) / 220 = 7.2 mA

So each LED is only getting 7 mA rather than 15 mA and is thus less bright. Now you could compensate by halving the resistor.

Personally I couldn't see a heap of difference in the brightness, but I think that is because our eyes to not respond linearly to brightness.

As for the chasing effect, if you put the pins in groups of two, or three, it would still look like a chaser, but only need half (or a third) of the pins.

So you are saying just have 2 (or 3) LEDs go on at once, then the next 2 (or 3) would go on as the previous 2 (or 3) shut off and so on to create the chasing effect? Or are you saying there is some way to make each individual LED in a group of 2 turn on even though the group of two is connected to one pin? Did that make any sense? :cold_sweat:

Nick, thanks so much for testing that out and explaining it in such depth to me. It's really making all this a lot easier to understand.

As for the power supply, would something like this work? RadioShack.com Official Site - America's Technology Store It's 6V so the Arduino wouldn't have to burn much off, correct? Because, as I understand now, the Arduino regulates everything down to 5V, yes? :sweat_smile:

It's a bit low. They recommend 7V+ for a reason. You lose 0.7V in the reverse polarity protection diode, and then the voltage regulator has a 1V dropout. That is, it needs 1V headroom. So really you need 6.7V upwards, which is why they say 7V to 12V.

So you are saying just have 2 (or 3) LEDs go on at once, then the next 2 (or 3) would go on as the previous 2 (or 3) shut off and so on to create the chasing effect?

Yes, I think groups of two chasing would look OK. You could try it and see. Failing that you can use a shift register or two and put 8 LEDs per shift register.

Thanks so much, Nick. I'll report back with pictures and results. Thank you and everyone else for all the help! Excited to try this stuff out.

One more question actually: I see now that they recommed 7V - 12V, but doesn't the USB only provide 5V? Why is this considered a sufficient power source? Or is it not? Thanks so much!

It doesn't go through the voltage regulator. We assume that the 5V from USB is in range.

It doesn't go through the voltage regulator. We assume that the 5V from USB is in range.

You're the man, Nick! Alas, I spoke to soon. The questions keep on a comin'! I just read somewhere that if you have two LEDs wired in series, you'll need to have a power source that can handle double their FW supply. Is this true? In this case, will 5V not be enough to handle my two 3.3V LEDs in series pairs?

Bonus question: As long as only one LED is on at once, I could handle driving all 14 seperately, right?

In this case, will 5V not be enough to handle my two 3.3V LEDs in series pairs?

This was my suggestion: give it a try.
I guess you'll see a voltage drop of 2.5 V at each led and a current of less than 20 mA. No resistor required, probably.
Now the question is if the brightness is still ok.
My suggestion with the two leds in series implies they are controlled by one pin only, thus you just need 7 pins.
If the leds are wired opposite each other on your circle, you'd have two lights ( or black holes or light trains ) chasing each other around.
If the leds are next to each other, you'd just have an effective granularity of 7 elements only, but can build one "light train" running around.
(Initially, I imagined the first suggestion, or even fewer bigger groups up to 3groups with 5 leds, giving 5 lights chasing each other faster and faster until they seem to shine continuously at or above 20 Hz, when you switch to PWM output pulsing the whole circle)

michael_x:
I guess you'll see a voltage drop of 2.5 V at each led and a current of less than 20 mA. No resistor required, probably.

I can't agree with this point. The resistors with LEDs are required to limit current. You can't omit them if you have a lot of LEDs.

Read this:

http://www.thebox.myzen.co.uk/Tutorial/LEDs.html

In there he says:

There are several web sites and schematics on the web that suggest you can attach an LED directly to an Arduino output pin with no current limiting resistor. They are wrong, and following them will damage your Arduino.

Is this true? In this case, will 5V not be enough to handle my two 3.3V LEDs in series pairs?

Do the LEDs really have a 3.3V forward voltage? In that case you are limited to one per pin. I think some external circuitry is starting to look good here.

Bonus question: As long as only one LED is on at once, I could handle driving all 14 seperately, right?

Yes that should be OK. Still have to keep the current within limits for the pin (eg. 20 mA).

Do the LEDs really have a 3.3V forward voltage? In that case you are limited to one per pin. I think some external circuitry is starting to look good here.

Having a look at the data sheet is always good.
I just picked any Kingbright UV LED (rated VF typ 3.8 max 4.2 V @20mA), which seems to support Nick's Statement.
I'm only right with my assumption about the resulting current to be less than 20 mA :wink:
According to the attached diagram it should be around 0.0x mA @2.5V (which would not harm the Arduino), and the voltage drop would typically vary only by 0.7V with a current variation of 5 to 25 mA.
I fully agree with Nick that "external circuitry is starting to look good here". It increases the possible scenarios a lot.
My approach however is rather experimenting with what you have got already, and experience the encountered limits.

UV_LED.png