Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Building simple LED circuit

Status
Not open for further replies.

SlowCoder

New Member
Hi all! New to the board! First off, I'm pretty well a noob when it comes to electronics. 25 years ago I built some circuits from some Radio Shack manuals (those were the days :)), but I never understood exactly how the components interracted. Effectively, I could read basic and simple schematics, and use a soldering iron.

Now, I'm kind of getting bitten by the desire to learn more. I have a very basic grasp of what a resistor, capacitor, diode, etc. do, but I now need to know more. My method of learning is hands-on. Books suck. :p

Anyway, I'm trying to build a simple LED circuit using a RGB LED and potentiometers to control the intensity/brightness of each color. The power supply is 5V, max 100mA to work with.

The LED I purchased is Radio Shack P#276-028, 5MM LED. Green and Blue use 30mA, Red uses 50mA. At maximum power that is 110mA, over what I want to use.

Based on my limited knowledge, I think I want to wire this as such:
+5v > 56ohm R > Pot (120ohm) > Green leg
+5v > 56ohm R > Pot (120ohm) > Blue leg
+5v > 33ohm R > Pot (68 ohm) > Red leg
* I've heard that you actually want to put the resistors between the LED legs and ground, but I'd appreciate verification on it. *

My logic:
- The LED is 3.4v max, so based on an online LED resistor calculator, the resistors are what's needed to bring from 5v to 3.4v.
- Green and Blue - on the LED calculator, a pot capable of dropping voltage to .1v (basically turning off that color LED) is 120ohm.
- Red - on the LED calculator, a pot capable of dropping voltage to .1v (basically turning off that color LED) is 68ohm.

Am I anywhere near close, or will my house be reduced to ash in the not too far future?

I currently have some 1K pots at my disposal. They are rated at 50vdc at .1 watts. If I'm only putting 3.4v through them, will there be any problem using them for this project?

Thanks.
 
um, resistors and leds go in SERIES configuration, red will need lower resistance values,

when using pots i start high resistance and go low!
 
From the "um", I'm not sure if you're saying I'm incorrect somewhere ... :confused:

um, resistors and leds go in SERIES configuration, red will need lower resistance values
I believe in the "diagram" I have above, they are in series. E.g. +5v to resistor to pot to LED leg. Is that what you mean?
Each series is connected in parallel to each other, each connected directly to +5v.

when using pots i start high resistance and go low!
Can you clarify? I also happen to have 10k ohm pots (still 50v at .1 watt).

Please forgive the ignorance ... very new.
 
Forget the online calculator and learn the very simple math now!! and you will always remember it

Green led
5v - 3.4v = 1.6 volt

1.6 / 0.030 = 53.3 Ohm so use a 56 ohm resistor (30mA = 0.03 amp)

Red led
5 - 2.2 = 2.8

2.8 / 50 = 56 ohm.....although 50mA sounds high to me and i would work on 30mA (2.8 / 0.03 = 93.3 ohm or 100R would do)


With the resistors in the circuit the leds will operate safely at full brightness, so but adding the pots will only add more resistance and reduce the brightness as you increase the resistance on the pots.

The value of the pot wont matter much except for how far you turn the pot, so a 1K pot will only need to be turned 1/10 of its full travel for full on to led off, where as a 100R pot will require the full travel of the pot for full on to led off.

Pete.
 
Yes you are correct the resistors go in series as you had thought.

Also the comment on the red led was wrong from Doggy, it will need HIGHER resistance value.
 
Last edited:
Your understanding of how to put resistors with your LEDs is pretty good. I don't think "doggy" is very good at expressing himself using words.

It makes absolutely no difference what order the resistor, potentiometer (which is just another variable resistor) and the LED go in. (In some places it does make a difference, but not here.)

Also, one important thing you should understand is that you're not reducing the voltage to the LED. LED's don't care much about voltage (well, within limits). They do, however, care very much about current. The resistor is to limit the amount of current they can draw. Excess current can "let the magic smoke out". The online calculators are OK, but you'd be much better off (and your electronics education would improve) by learning to do this yourself. All you need is Ohm's law and knowing how to apply it (and knowing the ratings for your LEDs). It's not rocket science.

I'll get you started:

R = E/I
I = E/R
E = IR

There you go!
 
Last edited:
You guys are informative, and fast! Thanks! I am learning.

A few things are hanging here.
- Is it important to reverse the circuit so that rather than the resistance be on the +5v side, they are on the Gnd side?
- According to SABorn's post, the red leg requires MORE resistance. But if it actually needs 50mA instead of 30mA, then shouldn't the resistance be LESS? e.g. the 33ohm vs.56ohm?
- Would the 1K (50v, .1w) pots work ok in this circuit?
- As I only want to use 100mA current, will turning down the pots to reduce brightness change the power consumption, or will the same amount of power be used, and converted to heat in the resistors? I'm assuming less power will be consumed.

I will practice using the equations you guys gave me. :)
 
The datasheet shows that all you guys are wrong:
1) The absolute maximum continuous current is 30mA. Do you want to risk it when it is a cheapo Chinese LED? Most 5mm LEDs are spec'd at 20mA.
2) The typical voltage is 3.5V for the green and blue but the spec does not list the current. The graph shows typically 3.5V at 20mA.
The typical forward voltage of the red is 2.0V at 20mA.
3) The resistor for the green and blue is (5V - 3.5V)/20mA= 75 ohms. A 1k pot in series with 75 ohms will dim the LED a little but not completely.
The resistor for the red is (5V - 2V)/20mA= 150 ohms. A 1k pot in series with 150 ohms will dim it a little.

The Chinese manufacturer does not show the minimum forward voltages so your LED might use more current than 20mA. But if your LED has the maximum forward voltages then its brightness and current will be less.
 
As i did not read the data sheet and only worked from what was posted so it could be wrong, as AG looked up the data sheet his advice would be worth taking.

As a rule of thumb for a led off 5volt i would normally use a 330 ohm resistor for general applications unless i needed to drive it hard for some reason.

If you start out with a 330R resistor for each led you can not go wrong.

As for putting the resistor on the negative side......i would not do that, as it is ok for 1 led but for 2 leds the resistance is 50% to high and for 3 its even worse, if you decrease the resistance to suit 2 or 3 leds the when only 1 led is on the resistance is too low and will burn the led out.

You need 3 resistors, being 1 for each led and they need to be on the anode (5v) side.

The rating on the pot wont matter for this application, the resistance of the pot is the important part.

If you want to work out the watts (power) of the circuit, then go back to ohms law.

5 x 0.02 = 0.1 watt (volts x amps = watts ... ExI=P) [see its that math thing again.]

Pete.
 
As for putting the resistor on the negative side......i would not do that, as it is ok for 1 led but for 2 leds the resistance is 50% to high and for 3 its even worse, if you decrease the resistance to suit 2 or 3 leds the when only 1 led is on the resistance is too low and will burn the led out.

Right. My bad. I was thinking discrete (NOT discreet!) LEDs, and forgot that yours have a common cathode, so yes, the resistors should go on the anode (+) side.
 
The datasheet shows that all you guys are wrong:
1) The absolute maximum continuous current is 30mA. Do you want to risk it when it is a cheapo Chinese LED? Most 5mm LEDs are spec'd at 20mA.
2) The typical voltage is 3.5V for the green and blue but the spec does not list the current. The graph shows typically 3.5V at 20mA.
The typical forward voltage of the red is 2.0V at 20mA.
Thank you for pointing that out. I had originally looked at the datasheet, but I guess I didn't know to look for typical vs. max.

3) The resistor for the green and blue is (5V - 3.5V)/20mA= 75 ohms. A 1k pot in series with 75 ohms will dim the LED a little but not completely.
The resistor for the red is (5V - 2V)/20mA= 150 ohms. A 1k pot in series with 150 ohms will dim it a little.
Going by the new calculations, and using my new math to calculate the required pot to dim the LED color correctly: Green/Blue (3.5v-0v)/20mA=175 ohms, Red (3v-0v)/20mA=150 ohms. (I assume 20mA is correct?) By this math, why would a 1K pot not turn off its particular LED color?
 
Going by the new calculations, and using my new math to calculate the required pot to dim the LED color correctly: Green/Blue (3.5v-0v)/20mA=175 ohms, Red (3v-0v)/20mA=150 ohms. (I assume 20mA is correct?) By this math, why would a 1K pot not turn off its particular LED color?

This is one area where theory and practice don't necessarily coincide. In other words, it's one thing to work this out on paper, but the actual (visible) results might not be what you expected or wanted.

This might be a good reason for you to invest in a minimal "breadboarding" setup, where you can try different configurations without using a soldering iron or committing yourself to a particular design. You can plug in different parts and actually try them (what a concept!) until you get a pleasing result.

LEDs don't dim or extinguish according to any easily-described rule, so it's best to test a circuit before investing a lot of $$ and time.

I discovered this when I built a simple little circuit to dim a LED using a transistor (in this posting in another thread). It didn't work at all as I expected, and I had to do a lot of rejiggering to get it to behave the way I wanted it to.
 
This might be a good reason for you to invest in a minimal "breadboarding" setup, where you can try different configurations without using a soldering iron or committing yourself to a particular design. You can plug in different parts and actually try them (what a concept!) until you get a pleasing result.

LEDs don't dim or extinguish according to any easily-described rule, so it's best to test a circuit before investing a lot of $$ and time.
I agree with this. And I already bought a breadboard to do just that. But I'm not a rich person, so I wanted to make sure my logic is correct before I start turning my money into "magic smoke".
 
Going by the new calculations, and using my new math to calculate the required pot to dim the LED color correctly: Green/Blue (3.5v-0v)/20mA=175 ohms, Red (3v-0v)/20mA=150 ohms. (I assume 20mA is correct?)
You don't understand that it is the voltage across the resistor, not the voltage across the LED that sets the current.
1) The green or blue LED has a typical forward voltage of 3.5V.
2) Your power supply is 5.0V.
3) The current for the LEDs is typically 20mA.
4) The voltage across the resistor is 5.0V - 3.5V= 1.5V.
5) The resistor value is 1.5V/20mA= 75 ohms, not 175 ohms.

why would a 1K pot not turn off its particular LED color?
With a current of 20mA the LEDs will be fairly bright. But if you add a 1k pot in series then the current is 1.5V/(1k + 75)= 1.4mA which is still very noticable because our eyes have a logarithmic relashionship to brightness. Half the current creates a barely noticeable drop in brightness. One-tenth the current looks half as bright.
Maybe a 10k pot can be used but still the LEDs will not turn off and the very small portion of the resistance of the pot that is used when the LED is dimmed a little might burn out.
 
Hey folks! I'm back for more abuse! Life is a bear, and I was unable to pursue my knowledge advancement. :(

I built a simple circuit based on information you guys gave me, and some information from other areas. I'm using a 6v supply.

Specifications listed:
FW current: 30mA (green/blue), 50mA (red)
FW supply: 3.5v typical (green/blue), 2v (red)

I calculated the following resistence for green/blue: (6-3.5)/.03 = 125ohm
And red: (6-2)/.03 = 133ohm
Note that I went with 30mA for the red also. Is this ok, or do I need to go with the 50mA calculation?

The LED lit up quite brightly, but did work. The candela specifications for it are: 565mcd (red), 650mcd (green), 120mcd (blue). Is this LED supposed to be very bright?

I appreciate your input.
 
Most ordinary LEDs are rated at 20mA when they last a long time. 30mA is their absolute maximum current when they might not last long. Candela spec's are meaningless without stating the total angle of light because a cheap old dim LED is much brighter when it is in a case that focuses the light into a narrow beam.
 
Most ordinary LEDs are rated at 20mA when they last a long time. 30mA is their absolute maximum current when they might not last long.
Ok, so I recalculated (6-3.5)/.02 = 80ohm for green/blue, and (6-2)/.02 = 200ohm for red. Therefore, 100ohm on green/blue is more than sufficient, and 200ohm on red is exactly on. Boy is that a bright LED!
Candela spec's are meaningless without stating the total angle of light because a cheap old dim LED is much brighter when it is in a case that focuses the light into a narrow beam.
The published viewing angle for this LED is 60 degrees. Is that what you meant?
 
Your arithmatic is WRONG. (6V - 3.5V)/20mA= 125 ohms, not 80 ohms.

LEDs do not have a certain voltage like a light bulb, they have a range of forward voltages like from 3.2V to 3.8V. If the actual forward voltage of the LED is only 3.2V and a 100 ohm resistor is used then the current is close to 30mA and the LED will burn out soon.

Nobody makes an 80 ohm nor a 125 ohm resistor.

A viewing angle of 60 degrees is very good for an LED. Many cheap Chinese LEDs have an angle of only 7 degrees like a laser.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top