Pages: [1] 2   Go Down
Author Topic: Powering an Arduino Uno  (Read 3226 times)
0 Members and 1 Guest are viewing this topic.
Los Angeles, CA
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Biyaaaa!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Fennel Rye

Offline Offline
Full Member
***
Karma: 0
Posts: 217
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

!
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Does the Arduino regulate the voltage and drop it down or will each pin now provide 9V? 

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

Quote
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.

Quote
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.

Quote
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:

http://www.gammon.com.au/uno
Logged

Los Angeles, CA
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Biyaaaa!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
« Last Edit: May 22, 2012, 01:44:33 am by Fennel Rye » Logged

Fennel Rye

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Los Angeles, CA
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Biyaaaa!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Fennel Rye

Germany
Offline Offline
Faraday Member
**
Karma: 49
Posts: 2741
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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)

Quote
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 4V*40mA are producing heat in the 5V regulator, 5V*40mA 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)
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 64
Posts: 6055
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Los Angeles, CA
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Biyaaaa!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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.

Quote
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?

Quote
(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?

Quote
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.
« Last Edit: May 22, 2012, 02:10:02 pm by Fennel Rye » Logged

Fennel Rye

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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'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.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

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:

Code:
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:

Code:
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.

Logged

Los Angeles, CA
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Biyaaaa!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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?  smiley-roll-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? http://www.radioshack.com/product/index.jsp?productId=10788649&filterName=Category  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?  smiley-sweat

Logged

Fennel Rye

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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? 

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.

Quote
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.
Logged

Los Angeles, CA
Offline Offline
Newbie
*
Karma: 0
Posts: 41
Biyaaaa!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
« Last Edit: May 23, 2012, 01:13:53 am by Fennel Rye » Logged

Fennel Rye

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 452
Posts: 18694
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1] 2   Go Up
Jump to: