View previous topic :: View next topic |
Author |
Message |
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
LEDs |
Posted: Thu Mar 15, 2012 11:39 am |
|
|
Your arrangement for the LEDs is a recipe for disaster.
(1) The triples of LEDs are unlikely to share current equally and will have different brightness. The display will look odd.
(2) The LED currents are limited only by the capability of the 74164.
(3) The scheme may very well APPEAR to work, but will probably have a VERY short life. Either your 74164s, LEDs, or both will self-destruct!
You MUST include a current limiting resistor in series with EACH LED. Read the data sheets to arrive at a value.
Proteus / PSpice and the like don't know about thermal issues and LED forward voltage variation, unless you tell them.
Thanks ckielstra, I hadn't noticed. Keeping to one thread would have been useful.
Mike |
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Thu Mar 15, 2012 11:54 am |
|
|
seifpic wrote: | PCM programmer wrote: | What range of index values (i) does your for() loop create ?
Which ones should it create ? Run this test program
to show the indexes that it creates:
|
Yeah, it was supposed to do 8 loops but it did nine because I set i to 0. I set it to 1 and it's supposed to work now. | So your loop is now from 1 to 8? Check out the parameters for the bit_test function in the manual... |
|
![](templates/subSilver/images/spacer.gif) |
seifpic
Joined: 11 Mar 2012 Posts: 45 Location: Egypt
|
Re: LEDs |
Posted: Thu Mar 15, 2012 4:37 pm |
|
|
Mike Walne wrote: | You MUST include a current limiting resistor in series with EACH LED. Read the data sheets to arrive at a value. |
I have read what I can understand from the datasheets. Should I add a 220 ohm resistor per LED? Because in a normal LED matrix, there is one resistor per row or column, and I personally used one resistor to power multiple LEDs before. If so, can you explain the reason to do so? I'm also sorry about not including the schematic here as it was messy and I didn't think it was necessary for this post (the other post asks a different question) .
Thanks in advance. |
|
![](templates/subSilver/images/spacer.gif) |
seifpic
Joined: 11 Mar 2012 Posts: 45 Location: Egypt
|
|
Posted: Thu Mar 15, 2012 4:40 pm |
|
|
ckielstra wrote: | So your loop is now from 1 to 8? | No, I changed it to loop from 0 to 7 http://codepad.org/RWlRTp20 |
|
![](templates/subSilver/images/spacer.gif) |
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
LEDs and resisitors |
Posted: Fri Mar 16, 2012 3:22 am |
|
|
You CAN use one resistor to limit the current through several LEDs if they are connected as:-
Code: |
+V ___|\|______|\|______|\|______|\|___/\/\/\___ GND
|/| |/| |/| |/|
|
All the LEDs carry the same current.
At the same current, LEDs of the same type, and bin selection SHOULD be reasonably well matched for brightness.
The forward voltage drop across the LEDs depends on colour, and varies for individual LEDs of the same colour.
For red LEDs the Vf varies from ~1V5 to ~2V5. (IR LEDs have lower Vf, green, blue,IR progressively higher.
You can try to connect LEDs in parallel as below:-
Code: |
+V ______|\|________/\/\/\___ GND
| |/| |
| |
|___|\|____|
| |/| |
| |
|___|\|____|
|/|
|
Connected like this all the LEDs have the same voltage across them.
You CANNOT guarantee that ALL the LEDs will pass the same current.
This is because each LED requires a DIFFERENT voltage across it to pass the SAME current.
Look at the Voltage/current curve for typical LEDs. They start with zero current until a minimum voltage is reached, then the current changes rapidly with small voltage changes.
Driving LEDs from 74164 you have two specification limits which come into play.
(1) Maximum current rating for each output pin, 30 to 40 mA.
(2) Total power supply current for the package, 70 to 100mA.
The ratings depend on which device/package you've got and manufacturer.
I'm assuming you're supply is 5V.
With 220R in series with each LED you'll get ~10mA, maybe a bit more.
For three LEDs connected to each output, you're going to be just about at the pin limit.
When your showing a "1" the total chip current will be ~60 to 70mA, getting close to the package limit.
Showing a "7" you'll have passed the package limit.
Showing an "8" your current COULD be around a quarter of an amp! (Heavily depends on the 74164)
From this you have several choices:-
(1) Use larger value resistors and accept the reduced brightness.
(2) Connect LEDs in series and drive with FETs or bipolars from higher voltage source.
(3) Show off your fancy design for as long as it survives.
(4) .............
I'll leave you to work it out.
Mike |
|
![](templates/subSilver/images/spacer.gif) |
seifpic
Joined: 11 Mar 2012 Posts: 45 Location: Egypt
|
Re: LEDs and resisitors |
Posted: Fri Mar 16, 2012 4:08 am |
|
|
Mike Walne wrote: |
(4) .............
|
What if I do it like this:
Code: |
V+ ___________/\/\/\___| \ |___
| | / | |
|__/\/\/\___| \ |______| GND
| | / | | |
|__/\/\/\___| \ |___|
| / |
|
One more question, from what I've learned, electrons start at the anode and go to the cathode, shouldn't the resistors be placed before the LEDs? |
|
![](templates/subSilver/images/spacer.gif) |
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
Oh dear |
Posted: Fri Mar 16, 2012 5:04 am |
|
|
Now you've got me really worried!
Quote: |
One more question, from what I've learned, electrons start at the anode and go to the cathode, shouldn't the resistors be placed before the LEDs?
|
You were not paying attention for either lesson on Kirchoff's laws.
I had anticipated a question on quantum mechanics, but you were not at that lesson either.
Conventional current flow is from positive to negative.
Electrons are negatively charged and drift from negative to positive round the outside of an electrical power source.
In a diode the electron flow is from cathode to anode. Had you been brought up on thermionic valves, you would have had no problem with that one.
Try each of these two circuits.
Code: |
+V ______|\|_____/\/\/\_____ GND
| |/| |
| |
|___|\|_____/\/\/\__|
| |/| |
| |
|___|\|_____/\/\/\__|
|/|
+V _____/\/\/\____|\|_______ GND
| |/| |
| |
|__/\/\/\____|\|____|
| |/| |
| |
|__/\/\/\____|\|____|
|/|
|
I really should NOT have to say any more>
Mike |
|
![](templates/subSilver/images/spacer.gif) |
seifpic
Joined: 11 Mar 2012 Posts: 45 Location: Egypt
|
Re: Oh dear |
Posted: Fri Mar 16, 2012 6:54 am |
|
|
Mike Walne wrote: | In a diode the electron flow is from cathode to anode. Had you been brought up on thermionic valves, you would have had no problem with that one. |
Kakin wrote: | depends on what you want the resistor to do.
for example: you have two leds and connect the resistor to voltage and the other side to both leds. no problem here, but if you connect both leds to voltage and both cathodes (negative side) to the resistor then it won't work as nicely.
One of the leds may be dimmer or not on at all, because the current through first is causing a voltage in the resistor, making the second led "see" a smaller voltage or non at all (remeber voltage is a difference between two points) | ^ http://forum.allaboutcircuits.com/showpost.php?p=131024&postcount=3 |
|
![](templates/subSilver/images/spacer.gif) |
seifpic
Joined: 11 Mar 2012 Posts: 45 Location: Egypt
|
|
Posted: Fri Mar 16, 2012 7:35 am |
|
|
I used this calculator http://www.quickar.com/noqbestledcalc.htm to calculate 3 (2.7V) (20mA) LEDs in parallel and it outputs a 39ohm resistor. Do you recommend That I use another setup? Because I am using a wall adapter 5V dc (2A) as a power source. |
|
![](templates/subSilver/images/spacer.gif) |
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
Kakin |
Posted: Fri Mar 16, 2012 7:42 am |
|
|
Quote: |
Kakin wrote:
depends on what you want the resistor to do.
for example: you have two leds and connect the resistor to voltage and the other side to both leds. no problem here, but if you connect both leds to voltage and both cathodes (negative side) to the resistor then it won't work as nicely.
One of the leds may be dimmer or not on at all, because the current through first is causing a voltage in the resistor, making the second led "see" a smaller voltage or non at all (remeber voltage is a difference between two points)
|
Without a schematic, I have little idea what Kakin is getting at, neither, it appears, do you.
Try these circuits for yourself. To really make the point use one red and one blue LED.
(If you have not got a blue LED the use a green.)
Code: |
+12V ______|\|___________/\/\/\___ GND
| |/| Red | 1k
| |
|___|\|_______|
|/| Blue
+12V ___/\/\/\______|\|___________ GND
1k | |/| Red |
| |
|___|\|_______|
|/| Blue
+12V ______|\|___________/\/\/\______|\|________GND
|/| Red 1k |/| Blue
+12V ______|\|___________/\/\/\______|\|________GND
|/| Blue 1k |/| Red
+12V ______/\/\/\______|\|___________|\|________GND
1k |/| Red |/| Blue
+12V ______/\/\/\______|\|___________|\|________GND
1k |/| Blue |/| Red
+12V ______|\|_________|\|__________/\/\/\______GND
|/| Red |/| Blue 1k
+12V ______|\|_________|\|__________/\/\/\______GND
|/| Blue |/| Red 1k
|
Mike |
|
![](templates/subSilver/images/spacer.gif) |
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Fri Mar 16, 2012 8:36 am |
|
|
Again we are in a recursive and endless subject. It is very hard to help somebody to do a project that require to have acquired basic
theoretical training and a minimun skills.
In my opinion, it is outside of the scope of this forum try to explain Ohm's law or Kirchhoff. But even if it is a conceptual question, since the
user has "virtual concepts" because as seen, usually works with Proteus, which is the closest thing to a Walt Disney movie because it's
a fantasy world where all is possible, even to connect a LED without a limiting resistor.
Humberto |
|
![](templates/subSilver/images/spacer.gif) |
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
Oh no |
Posted: Fri Mar 16, 2012 8:37 am |
|
|
Quote: |
I used this calculator http://www.quickar.com/noqbestledcalc.htm to calculate 3 (2.7V) (20mA) LEDs in parallel and it outputs a 39ohm resistor. Do you recommend That I use another setup? Because I am using a wall adapter 5V dc (2A) as a power source.
|
I'm losing the will to live.
I thought I had explained:-
(1) Why you DON'T parallel the LEDs.
(2) 10mA per LED is going to destroy your drivers.
So you've chosen to ignore my advice to REDUCE the current, and DOUBLED it.
I agree your calculation is correct, I would NOT use the proposed 39R.
Normally when I make recommendations I charge ££££ ($$$$), I do not expect an arguement.
I suggest:-
(a) Reduce the LED current (and maybe use more efficient LEDs).
(b) Start again with a different topology.
(c) You give up.
(d) I give up.
Humberto has said it all.
Mike |
|
![](templates/subSilver/images/spacer.gif) |
seifpic
Joined: 11 Mar 2012 Posts: 45 Location: Egypt
|
Re: Oh no |
Posted: Fri Mar 16, 2012 10:59 am |
|
|
Mike Walne wrote: |
I'm losing the will to live.
|
Please bear with me here, as I said I am a beginner and I haven't learned about the theories you mentioned till today. I am sorry I have been a bit ignorant, but I havent been sleeping well lately.
Quote: |
(a) Reduce the LED current (and maybe use more efficient LEDs).
|
Reduce the LED current, then use which setup of the ones you showed me? I'm sorry I wasn't able to test them because I'm out of LEDs.[/quote] |
|
![](templates/subSilver/images/spacer.gif) |
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
|
LED circuits |
Posted: Fri Mar 16, 2012 12:24 pm |
|
|
Like Humberto says, we really shouldn't be having these exchanges.
I will humour you once more.
You can use either of the two circuits with three resistors and three LEDs.
The idea, of showing you the various circuits, was for you to work it all out for yourself, by testing with real components, and get a feel for how these things work.
To reduce the risk of destroying your 74164s, you need to increase the value of each resistor from your proposed 220R.
I suggest something like 680R or even 1k0. You will then have 2 or 3mA per LED.
If you find that the LEDs are too dim, get higher efficiency LEDs.
Try it out on one cluster (or even one LED), before committing to the whole circuit.
Best of luck, you're going to need it.
Mike |
|
![](templates/subSilver/images/spacer.gif) |
seifpic
Joined: 11 Mar 2012 Posts: 45 Location: Egypt
|
Re: LED circuits |
Posted: Fri Mar 16, 2012 12:54 pm |
|
|
Mike Walne wrote: | You can use either of the two circuits with three resistors and three LEDs.
The idea, of showing you the various circuits, was for you to work it all out for yourself, by testing with real components, and get a feel for how these things work.
To reduce the risk of destroying your 74164s, you need to increase the value of each resistor from your proposed 220R.
I suggest something like 680R or even 1k0. You will then have 2 or 3mA per LED.
If you find that the LEDs are too dim, get higher efficiency LEDs.
Try it out on one cluster (or even one LED), before committing to the whole circuit.
Best of luck, you're going to need it.
Mike |
Thanks, thats the answer I was going for. The problem here in Egypt is that I can't buy the components from shops like radioshack, it's a 2 hour drive from where I live. So I have to know what I need beforehand, then I get extra just in case. So I only had 3 superbright LEDs and some others but I can't find them. |
|
![](templates/subSilver/images/spacer.gif) |
|