Basic LED Setup - Page 1
Forum section: electronics / beginners

author: justinzagar
author_rank: Newbie
timestamp: November 18, 2019, 08:56:17 pm
content: So I have been trying over and over to successfully set up a USB powered LED light, with varying levels of non-success. My goal is to be able to put together a working - and lasting - LED bulb (or an additional bulb for a total of two) powered by a simple USB cord. Sounds simple, and as much research and experimenting I have tried, I simply cannot get the LED to remain constant when powered up. I've used a couple different resisters, a couple different USB cords (one with a dimmer, one straight to the power source, etc), but every single time, after about 10-20 hours of use, the LEDs will start to dim, and slowly fade to the point of being useless.I've used resistor calculators to help me try to sort this out, but I just can't seem to get the right formula. Here is some information on the components I've tried:LED Bulbs: 5mm Ultra Bright with Forward Voltage of 1.9-2.1vResistor 1: 18ohmResistor 2: 68ohmTo sum up, I am looking to have 1 or 2 LED bulbs powered by USB. The USB should work either when plugged into a computer, or when used with a wall wart. Any assistance would be appreciated!!

author: Jwillis
author_rank: Super Contributor
timestamp: November 18, 2019, 09:34:01 pm
content: R=Vcc−Vf / If where R is the current limiting resistor , Vcc is the supply voltage ,Vf is the forward voltage of LED , If is forward current of LED . Remember LEDs are current driven not voltage driven.As long as the forward voltage is met. As the voltage increases the resistor value must also increase as well the resistor must have a sufficient power rating. It's as important to know the Maximum current rating of your LED and not to exceed that . Most USB should have at least 500 mA some as high as 1 amp of a available current but not always. If your LED is fading over time to destruction then the current limiting resistor isn't high enough or has an insufficient power rating.

author: rstofer
author_rank: Super Contributor
timestamp: November 19, 2019, 12:32:50 am
content: Quote from: Jwillis on November 18, 2019, 09:34:01 pmAdded a pair of parenthesis to clarify operator precedence.You need to get the Vf and If values from the datasheet. There's no room for guessing. A common LED might only want 20 mA at say 1.8V soR = (5V - 1.8V) / 0.02A = 160 Ohms. Maybe pick 180 Ohms for a common value.

author: newbie_electron
author_rank: Newbie
timestamp: November 22, 2019, 08:43:07 am
content: Make sure to short out the D+ and D- to let the computer know the USB you plugged into is a dedicated charging port (DCP) for max power delivery.As suggested by @rstofer, here is the schematic for your light bulb.Have a good day!

author: james_s
author_rank: Super Contributor
timestamp: November 22, 2019, 04:44:10 pm
content: Keep in mind too that 20mA is usually the max for small LEDs, in practice you will want to select a resistor that results in a bit less, I usually aim for 18mA if I want max brightness out of a 20mA max LED. The cheap white ones in particular will fade quickly at max power.

author: Audioguru again
author_rank: Regular Contributor
timestamp: November 23, 2019, 01:37:46 am
content: Most ordinary 5mm diameter LEDs are spec'd at 20mA. 30mA is their maximum allowed current.Your 2V red LEDs with an 18 ohms resistor burned up with a current of (5V - 2V)/18 ohms= 167mA which is way too much current.The 68 ohm resistors limited the current to (5V - 2V)/68 ohms=44mA which is still too much current.Did you see how simple the calculations are?