• 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.

rEVERSE ENGERING FOR led RESISTOR

Status
Not open for further replies.

MrDEB

Well-Known Member
Not knowing what the voltage drop across the LEDs is I kinda need to compute resistor to use.
output =using an 18F1320PIC so 20 ma is max I really want to go
have two LEDs in parelle (per output using PWM)
using surface mount LEDs = data sheet ?? bought off Ebay = China
using a 460 ohm resistor as a "base line" I measure
BLUE LED = 2.5ma
YELLOW LED= 5.4MA
RED LED= 5.8MA
above figures using only one LED


two LEDs on each output in parallel
If I keep the current around 15-18ma I should get pretty good brightness out of LEDs hopefully??
using 4,5 volt power supply
using ohms law I should have .009 ma ??
or
1800 ohm resistor??
I am missing something for sure.
need to measure voltage drop on each LED?? hope not
hopefully can figure out or just trial and error?
 

MrDEB

Well-Known Member
using multisim ?

blue = 60 ohm = 18ma
red = 150ohm = 18ma
yellow = 150 ohm = 18ma
not sure how accurate these figures are??
had one toooo many glasses of wine w/ dinner so get back at it tomorrow.
unless someone has a better solution??
 

audioguru

Well-Known Member
Most Helpful Member
The output of a PIC is +5V only when it has no load current. Its max allowed continuous output current is 25mA. You need to measure its voltage when it has a load of 15mA or 25mA. It might be only 3.5V.

If the supply to the PIC is only 4.5V then nobody knows how low its output voltage is when its load is 15mA or 25mA. It might be only 2.5V.

You don't know the voltage required by your LEDs unless you measure them. They might need more than the PIC can produce.
 

MrDEB

Well-Known Member
good point

will measure tomorrow.
wonder if using PWM affects the computation any?
maybe recode the PIC so I have 6 outputs instead of 3??
be back tomorrow morning
 

Boncuk

New Member
Hi MrDeb,

to find out the exact LED forward voltage you only need to calculate one value which you use for a constant current source.

Use an LM317L wired as constant current source for the desired forward current. Measuring the voltage drop across the LED you've found the exact foreward voltage of it.

Boncuk
 

Attachments

MrDEB

Well-Known Member
Found the spec label

according to the data sheets
blue = 4.10 forward voltage
red = 2.8 forward voltage
yellow = 2.0 forward voltage
may have to reconfigure the PIC as the blue is 4.1 (no wonder the blue led didsn't light when I tested using the DVM using the diode tester.
 

MrDEB

Well-Known Member
accual voltage drop

with a 460 ohm resistor in series I measure 3.8 volts.
the yellow is 2.8 volts
connected to PIC and blue LEDs lights using a 460 ohm resistor = 2ma or so.
not real bright.
plan is to put two leds in parallel (might mix the colors for variety!) then connect a pot in series with all three LEDs then adjust brightness if I need to
 

Attachments

audioguru

Well-Known Member
Most Helpful Member
You will not be able to adjust the brightness of your dim LED because your PIC cannot supply it with enough voltage. With a second LED parallel to it then both LEDs will be very dim.
 

Boncuk

New Member
with a 460 ohm resistor in series I measure 3.8 volts.
the yellow is 2.8 volts
connected to PIC and blue LEDs lights using a 460 ohm resistor = 2ma or so.
not real bright.
plan is to put two leds in parallel (might mix the colors for variety!) then connect a pot in series with all three LEDs then adjust brightness if I need to
I think it's no good practice to connect an LED directly to an I/O pin of an MCU.

They can sink or source an absolute maximum of ~50mA, depending on the brand. (ATMELs can safely source 25mA total).

If you have to connect several LEDs to the MCU use an ULN-type NPN-transistor array with low base current to make sure the MCU works properly when all LEDs are lit.

Using a 5V power source for a blue LED with Uf=4.1V you might even omit a current limiting resistor if the regulator output voltage is at 4.8V.

Boncuk
 

MrDEB

Well-Known Member
I have a test setup

with a 460 ohm resistor then blue LED connected to outputs (for testing my PWM code) and the LED is just fine for brightness.
One difference is the LEDs I plan on using are smd not leaded as my test board has.
the leaded leds show a 3.4 voltage drop vers 3.8 on the smd.
putting in parrallel might change things but will PWM work with a NPN transistor?? another option as the circuit boards have already been etched so a dip ic is really not in my plans.
the rs wal wart is rated for 700ma so that's not a problem
going to play with different resistor combos etc and try out.
the blue/460 ohm smd setup is not bright enought for sure.May go with leaded but not really in my plans.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top