Author Topic: Basic LED Setup  (Read 1227 times)

0 Members and 1 Guest are viewing this topic.

Offline justinzagarTopic starter

  • Newbie
  • Posts: 1
  • Country: us
Basic LED Setup
« on: November 18, 2019, 08:56:17 pm »
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.1v
Resistor 1: 18ohm
Resistor 2: 68ohm

To 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!!
 

Offline Jwillis

  • Super Contributor
  • ***
  • Posts: 1740
  • Country: ca
Re: Basic LED Setup
« Reply #1 on: November 18, 2019, 09:34:01 pm »
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. 
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 10020
  • Country: us
Re: Basic LED Setup
« Reply #2 on: November 19, 2019, 12:32:50 am »
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.

Added 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 so
R = (5V - 1.8V) / 0.02A = 160 Ohms.  Maybe pick 180 Ohms for a common value.
« Last Edit: November 19, 2019, 12:48:49 am by rstofer »
 
The following users thanked this post: Jwillis

Offline newbie_electron

  • Newbie
  • Posts: 8
  • Country: kh
  • Junior MCU firmware engineer.
Re: Basic LED Setup
« Reply #3 on: November 22, 2019, 08:43:07 am »
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!
I like the smell of electronics.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: Basic LED Setup
« Reply #4 on: November 22, 2019, 04:44:10 pm »
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.
 

Offline Audioguru again

  • Regular Contributor
  • *
  • Posts: 115
  • Country: ca
Re: Basic LED Setup
« Reply #5 on: November 23, 2019, 01:37:46 am »
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?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf