Go Down

Topic: Changing the digital ports voltage? (Read 8135 times)previous topic - next topic

code

Dec 02, 2012, 08:42 pm
First off I'm new to the electronics side of the house. I'm trying to mulitplex leds, is there a way to regulate the current that the digital ports on the Arduino Uno put out? Our led's can only hand up to 3.3 volts and I am unsure how much the ports put out.

retrolefty

#1
Dec 02, 2012, 08:56 pmLast Edit: Dec 02, 2012, 08:58 pm by retrolefty Reason: 1

First off I'm new to the electronics side of the house. I'm trying to mulitplex leds, is there a way to regulate the current that the digital ports on the Arduino Uno put out? Our led's can only hand up to 3.3 volts and I am unsure how much the ports put out.

The way (and only way) to 'regulate' the current being drawn from an arduino output pins is by having proper current limiting control on the external circuitry. For led's this is usually done by wiring properly sized resistors in series with the output pins being used.

And while leds do have a forward voltage drop specification, you don't operate a LED with a simple constant voltage amount, but rather you just make sure your circuitry controls the amount of current flowing through the led to it's rated value.

Lefty

AWOL

#2
Dec 02, 2012, 08:57 pm
Can you post the spec of your LEDs?
"Pete, it's a fool (who) looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

code

#3
Dec 02, 2012, 09:01 pm
Well how much does the digital ports output in volts? I don't want to fry my leds I can regulate it with resistors.

retrolefty

#4
Dec 02, 2012, 09:05 pm

Well how much does the digital ports output in volts? I don't want to fry my leds I can regulate it with resistors.

The standard Uno board output pins have a nominal +5vdc output when set high. Output pin current should be limited to 30ma or less as the 40ma absolute maximum rating is a value you should never be using continuously. If your LEDs require more then 30ma for full brightness then you should use extra external components (transistors, IC drivers, etc) to drive the leds.

Lefty

dhenry

#5
Dec 03, 2012, 01:39 am
Quote
is there a way to regulate the current that the digital ports on the Arduino Uno put out?

There is no one way to reglate the current  but multiple ways, based on your application.

1) For some applications, you can rely on the internal resistance of the mcu output pin: it is simple and can be effective for leds whose forward drop voltage is close to the supply voltage;
2) For small leds, you can use a resistor: simple but less efficient.
3) You can also use other ways, like a jfet, or a dedicated CCS driver, or a current mirror with multiple output legs.
4) There are also dedicated switching mode ccs drivers. they offer flexibility and a wide range of output current / voltage options.

Quote
Our led's can only hand up to 3.3 volts and I am unsure how much the ports put out.

You will find that your leds can take far more than 3.3v, especially those high power leds.

pwillard

#6
Dec 03, 2012, 06:52 pmLast Edit: Dec 03, 2012, 06:54 pm by pwillard Reason: 1

When someone says:
Quote
First off I'm new to the electronics side of the house.

Right away your answers numbered 1,3 and 4 are just completely unfair to someone that probably does not even know about Ohms law.

Answer #1 should be stricken entirely.  A newcomer would BARELY know when these conditions apply and you are leading them down a path to get it wrong before even knowing why. (damaging their LED, Arduino or both)
Answer #2 should read "For standard leds, you use a proper value current limiting resistor." (period!)  There is nothing inefficient about it.
Answers #3 and #4... really?  Once again... they said "New to electronics"

Telling a newcomer to Google for LED RESISTOR CALCULATOR is far better advice than you are giving.

Grumpy_Mike

#7
Dec 03, 2012, 06:55 pmLast Edit: Dec 03, 2012, 07:01 pm by Grumpy_Mike Reason: 1
Quote

Actually I am beginning to think that he has mental health problems.

You must admit he is consistently very wrong on this and it is getting tiring trying to correct him.
This of course confuses beginners as they do not know who to believe. But on this topic dear henry seems to want people to damage their arduinos. I don't know why, he must get some sort of kick from it.

For further information of why you need current limiting to keep things safe see this:-
http://www.thebox.myzen.co.uk/Tutorial/LEDs.html
Note that I managed to draw 250mA from an arduino pin, that is way over the damage point of 40mA.

pwillard

#8
Dec 03, 2012, 07:11 pmLast Edit: Dec 04, 2012, 01:53 am by pwillard Reason: 1
I mean really.  How is a person new electronics going to make sense of an answer  that says "use a JFET".   ...and would you ever recommend telling anyone to buy or even build Constant Current Source for a simple LED.  The LED being used by the OP still has not been explained.

The original poster is merely asking will 5V hurt my LED.  The correct answer is: Your LED will be safe if you correctly limit the current.

Sadly, nobody explained HOW that current is limited based on application of OHMS law prior to DHENRY's response.

R=V/I  or resistance you need is Voltage divided by Current.  So, you have 5V divided by ~20mA (typical current of a standard LED)
This is a basic simple calculation to get you in the right "area", a more accurate calculation can be achieved taking into account forward voltage drop of the LED.

So. 5/.025 = 250.  Closest Resistor value = 220   So, to drive a "normal/standard" 5MM LED from an Arduino pin, you insert a 220 Ohm resistor in the path from the Pin to the LED.

If you want to have some fun... go here  http://led.linear1.org/led.wiz

If you want to know more.  Google OHMS LAW.

dhenry

#9
Dec 03, 2012, 11:28 pm
Quote
So. 5/.025 = 250.

Ohm's law applies to just linear devices. The above calculation reflects your complete lack of understanding about Ohm's law.

It still can be used here, just not the way you did - the resulting current would be considerably less what what you your calculation suggested.

Grumpy_Mike

#10
Dec 03, 2012, 11:36 pm
Quote
It still can be used here, just not the way you did

OK so how would use it in this case and how would the result be different?

pwillard

#11
Dec 04, 2012, 01:39 amLast Edit: Dec 04, 2012, 01:57 am by pwillard Reason: 1
Quote
So. 5/.025 = 250.

(dhenry) Ohm's law applies to just linear devices. The above calculation reflects your complete lack of understanding about Ohm's law.

It still can be used here, just not the way you did - the resulting current would be considerably less what what you your calculation suggested.

In this case...  Even if you take into account forward voltage drop of a typical 5 mm LED, you still end up with 220 ohms (Or 180 ohms if you went the other way in standard  values).  If you do *not* understand how Ohms law applies to control the amount of current in a simple 5V LED circuit, those who take your advise should do so with *much* suspicion now.

Ohms Law calculation is about the resistor... which is linear... and used to control the current in that section of the circuit... which includes and LED, which for all practical purposes is a unidirectional conductor.

It is YOU who do not understand. That is clear to me now.

Henrik67

#12
Dec 04, 2012, 11:36 am

Quote
So. 5/.025 = 250.

(dhenry) Ohm's law applies to just linear devices. The above calculation reflects your complete lack of understanding about Ohm's law.

It still can be used here, just not the way you did - the resulting current would be considerably less what what you your calculation suggested.

In this case...  Even if you take into account forward voltage drop of a typical 5 mm LED, you still end up with 220 ohms (Or 180 ohms if you went the other way in standard  values).  If you do *not* understand how Ohms law applies to control the amount of current in a simple 5V LED circuit, those who take your advise should do so with *much* suspicion now.

Ohms Law calculation is about the resistor... which is linear... and used to control the current in that section of the circuit... which includes and LED, which for all practical purposes is a unidirectional conductor.

It is YOU who do not understand. That is clear to me now.

Guys - please stop the flaming... I thought this forum was about helping people interested in using Arduinos in their different projects, not for flaming those who try to help!

@pwillard - I think You too have a reason to review the link posted by Grumpy_Mike. Btw, Your calculation is wrong unless You have different laws of mathematics than the rest of us... 5/0.025 is not equal to 250 - it is equal to 200... And to be honest, if You use a 220 ohm resistor You will end up with a dimly lit led...

@Code - Do not drive the leds directly from an Arduino pin without any current limitation, You may/will end up letting the magic smoke out. Check the specs for Your leds (voltage drop and current needed) and read the link posted by Grumpy_Mike. It is imho a good guide to the correct way to light a standard low power led. Good luck with Your project!

GrooveFlotilla

#13
Dec 04, 2012, 11:53 am
IMO flaming a user who gives poor, misleading or plain simple willy-waving advice is entirely justified.
I wish dhenry would shut up and go elsewhere.

Not really good for anything, but they bring a smile to your face when pushed down the stairs.

Grumpy_Mike

#14
Dec 04, 2012, 11:54 am
Quote
I thought this forum was about helping people interested in using Arduinos in their different projects, not for flaming those who try to help!

It is the problem is that dhenry has some strange ideas about lighting up LEDs and throws in all sorts of irrelevant curve balls that the net result is that a beginner is confused. He says things and will not back them up, or talks about fourth and fifth order effects of something as if it was a first order effect. For example he is always banging on about the 40R output impedance of an arduino pin and ignoring the fact that this is only for small currents and I have measured pulses up to 250mA from a pin which puts the impedance down to at the most 20R. Anyway I think the result is that he has scared away another newcomer in a effort to make himself look smarter than he is. It is a shame.

It is always been my belief that electronics can be simple. The trick is to simply things as much as possible but not to such an extent as to be wrong. That is what I try to do, I don't always succeed.

On this topic I normally say:-
With an LED you always need something to limit the current, the simplest of which is a resistor.
Now that is not like saying:-
You always need a resistor.
But it avoids all the complication of mentioning constant current supplies and the rest when all the beginner needs to be told is that you can't just stick an LED across a digital output.