Need some advice re resistors and LED's

Hi, I'm sure this is an easy one.

I have an IR LED with a forward voltage of 1.7v, and forward current of 100mA. My picaxe circuit uses a 28x1 chip. Im using a 9V supply which is regulated, via a 7805 chip, to 5v.

In order to get the most brightness from the LED should I connect it straight up to the output pin of the chip (with an appropriate resistor of course) or should I use a transistor to get more current to it?

Thanks
 

nick12ab

Senior Member
In order to get the most brightness from the LED should I connect it straight up to the output pin of the chip (with an appropriate resistor of course) or should I use a transistor to get more current to it?
Transistor as 100mA is above the pin limit of a pin. The resistor is still required, however. You should also power the LED from the regulator rather than use a larger resistor since the regulator can dissipate a lot more heat than a normal resistor can.
 

westaust55

Moderator
You will need to decide if you are going to control the LED in a basioc format or with PWM control.
Assuming a basic dc non pulsed current you can just turn a PICAXE output on to drive a transistor.

You will need to do some calcs to assess what values are needed for the resistor and some calcs need to knopw the transistor data.
Ideally you drive the transistor into saturation so that the collector to emitter voltage (Vce) is a minimum which will reduce transistor heating.

For a simple circuit lets say the transistor Vce(sat) is 0.3 Volts and the "normal" gain Hfe is 400 (min) You will likely have data in the transistor datsheet that indicates one way or another what the gain is in saturation - often of the order of 0.1 x "normal gain"

So if operating form 5Volts for the LED (LED and series resistor between Vsupply and the NPN transistor collector plus emitter to 0V) we have

Vresistor = Vsupply - (Vce(sat) + Vled)
current = Iled
and the series resistance = Rled = Vresistor / Iled.

We want to drive the transistor into saturation so if Hfe = 0.1 x normal hfe from the example above Hfe(sat) = 0.1 * 400 = 40
Therefore the base current must be at least Iled / Hfe(sat) -- in out ficticious example = 100 / 40 = 2.5 mA

To calculat the transistor base resistor
Vres = Vsupply - (0.3V + 0.7) - 0.3V as allowance for PICAXE output not quite up to Vsupply and 0.7V as transistor base voltage

Resistor from PICAXE to transistor base = Rbase = Vres / Ibase

The above should give you enough theory to design/calculate for a single transistor driver circuit.
 

hippy

Ex-Staff (retired)
Peak Forward Current - Ipf

It seems to be 1A for a 1us pulse when 300pps.

At 36kHz each pulse is approximately 28us, the number of pulses depend on what data the PICAXE sends and how frequently, both of which would determine how that 1A would have to be derated.
 

Dippy

Moderator
Read carefully what hippy has said. Do you understand the term "derating"?.

Personally I would start off by having a component combo to limit it to a DC max current of 100mA.
During testing we can all 'slip up'. It's always better to 'slip up' safely.

After you've had a look and a read and a think post your circuit - including component values.

And, one little tip just to put in the cerebral notebook; the forward voltage drop of LEDs increases as you increase current, so if just simply swapping resistors to increase LED current you can get this (sort of) diminishing return effect.
 
Schematic - View attachment test.pdf

Code:
low 0 

main:

If pin0 = 1 then
	high 0 ;Turn light on
	pause 2000
	low 0 ;Turn light off
endif

goto main

I understand derating to be running the component with less power than the max to make it last longer?

I've been using the VSM simulator, when I place an ammeter across at the point near the LED, as you can see in my schematic, I get 100mA when I press the switch, if there's no resistor. With the resistor I get 13.6mA. In the simulation I have changed the appropriate properties of the LED to match the high power one I'll be using
 

Attachments

Last edited:

John West

Senior Member
A further note about LED properties (and for many other semiconductors as well.) The forward voltage drop decreases as the device heats up. The voltage drop you see specified in the data sheet is most likely specified at a certain device temperature. Yet, as Dippy brought up, the voltage drop increases as the current increases. The LED voltage drop fluctuates based on at least these two different parameters. These fluctuations are one of the reasons it is important to control LED's with current control circuits rather than voltage control circuits.
 

Dippy

Moderator
Ditto...
So, this mystery MOSFET, where is it? Are you using it to switch the LED? Thank goodness you aren't driving an LED straight from PICAXE. Electrical rarings are in the Manual and PIC Data Sheets. Read them.

Say, Red, are you going to drip-feed us with any more new info?
Why not post your actual circuit so that we all know what you are on about?:(
If we're all on different pages then it just wastes everybody's time - including yours.

Derating means changing your parameters to suit the change in device characteristics as conditions change.

Abs right about LED Vf . Most people don't know it, but I wouldn't worry too much about that in this little circuit.
 
Sorry about the misunderstanding, the circuit I posted was the circuit I was talking about when I posted it. In the time between that and my next post I had added a mosfet to it, then I had to go out so I didn't have time to print it and post it on here and now I am back I shall upload the new circuit with the mosfet

View attachment LED Power Mosfet Test.pdf

Thank you again for your help, it is very much appreciated!
 

John West

Senior Member
The 25 Ohm current limiting resistor needs to be tied to the +5 Volt supply side, not the ground side. As is, when current is passed through it it will raise the voltage of the MOSFET source pin relative to the gate and start turning the FET off.

When current is passed through a resistor it drops voltage through it as calculated by Ohm's Law. Best to read up on that. It's not too hard to understand, yet is critical to making circuits work properly.
 

Dippy

Moderator
Absolutely.
Just to expand; MOSEFT switching is all about Vgs - the voltage between the Gate and Source pins and NOT Gate and Ground.

Just to make the circuit better, add a capacitor across the (modified) +V---Res---LED---MOSFET---Gnd.
It'll act as a reservoir which will give better LED performance and less transients on the +5V line. Keep it close.

PS. What is D3 for?
 

John West

Senior Member
That's for suppressing the big inductive voltage kick when the LED shuts off. Oh, wait........ :eek:

It looks more like a flag indicating to us that Red needs a bit more advice on the circuit design.

In other words, Red, you only need that reverse protection diode across relay coils or other large inductors that are toggled. The LED should work fine without it.
 
Last edited:

John West

Senior Member
I prefer the PDF, although it's far slower coming up. That way I can see both a PDF window of the schematic and a comment window at the same time. I have a memory problem scrolling back and forth between the two.
 

Dippy

Moderator
I couldn't give a monkey's as long as the info is full, accurate and current.


PS. The circuit schematic posted here is very nice and clear.
I wish some people would spend a little more time with images. Some too small, some enormous and some awful.
 
Last edited:
Thank you for all the info, so just to clarify, will this work ok with irout?

I think i'll post jpg's and PDF's in future then everyone will be happy :D

I put D3 in to solve back emf but after reading up on this a bit more I gather that's not much of an issue with LED's
 

MartinM57

Moderator
will this work ok with irout?
It might but it's not optimal, and might be so sub-optimal it might not work at all ;)

Follow the advice above regarding moving the 25R to above the MOSFET.

Use an IRL520 not an IRF520 - either just take this as good advice or read up about "Logic Level" MOSFETs versus "ordinary" MOSFETs....or see Dippy's MOSFET Blog entry (Which I'm sure is being written right now :D)

I put D3 in to solve back emf but after reading up on this a bit more I gather that's not much of an issue with LED's
It's no issue at all. Ditch D3.
 
Last edited:
Thanks, however if irout won't work I think I'll have to seek another option, any recommendations? :)

Actually I intend to use the IRL520 but the VSM didn't have a model for it so I used that one as a place holder (I should have changed the label really)
 
Last edited:

MartinM57

Moderator
Thanks, however if irout won't work I think I'll have to seek another option, any recommendations? :)
I'm confused. You started in post #1 with "In order to get the most brightness from the LED should I...", which turned into a WA55 possible diversion in post #4 into PWM that then went into MOSFETs with a suboptimal schematic for PWM'ing...but then you raised yourself in post #5 about "pulsing using irout"

What are you actually trying to do?
 
I'm trying to power the LED, it's a high power LED so I would need to get more current to it than the picaxe could provide and I figured a MOSFET was the way to do this. I want to send irout to the LED, Im using a high power one because I want to get more range on the IR signal.
 

MartinM57

Moderator
OK - so the PWM'ing is a red herring and circuit you have (plus the fixes identified, plus an IRL520 instead of a IRF520) should work fine with irout. Are you thinking that there is some other problem with irout...
Thanks, however if irout won't work I think I'll have to seek another option, any recommendations? :)
?
 
Becuase the picaxe isn't connected directly to the LED I wasn't sure if this would cause a problem with the irout. Also I never said anything about PWMing although I mentioned pulsing in the context of irout :)
 
Absolutely.
Just to expand; MOSEFT switching is all about Vgs - the voltage between the Gate and Source pins and NOT Gate and Ground.

Just to make the circuit better, add a capacitor across the (modified) +V---Res---LED---MOSFET---Gnd.
It'll act as a reservoir which will give better LED performance and less transients on the +5V line. Keep it close.
Is this what you mean about putting the capacitor across?

View attachment With capacitor 1.pdfWith capacitor 1.jpg

Also I did a calculation based on wattage to determine the capacitor size and came out with 550uF, I think my calculation was wrong because this seems a little high to me, what do you think?

If I add more ouput devices to the pic, say a speaker or another LED, how will this capacitor affect them, if at all?

Thanks again.
 

westaust55

Moderator
Agreed - it was a red herring introduced by someone else (who will no doubt come along to justify it - although there is no need to :D)

Report back what happens with your circuit and irout...
I'm confused. You started in post #1 with "In order to get the most brightness from the LED should I...", which turned into a WA55 possible diversion in post #4 into PWM that then went into MOSFETs with a suboptimal schematic for PWM'ing...but then you raised yourself in post #5 about "pulsing using irout"

What are you actually trying to do?
seems I might be getting the PWM'ing blame for trying to clarify with the line:
You will need to decide if you are going to control the LED in a basic format or with PWM control.
Never mind the shoulders are broad, the skin is thick, and I dare walk down dark streets at night . . . .
 

MartinM57

Moderator
I'm sure Dippy can answer for himself, but I would say (without some seriously complicated maths to model the circuit perfectly - and not just a simplistic LTSpice model either) that you're into the qualitative "better LED performance and less transients on the +5V line" view of the circuit design rather than a complex theory-based quantitative view.

Better LED performance can probably be determined by increased range and less transients would need a reasonable 'scope to verify, so they are measurable I suppose.

Physical construction apart (i.e. the extra cap being close to the LED), you already have 100uF across the power rails, so you are only adding to that with your 550uF. But the value feels about right to me as a general purpose "reservoir" capacitor when switching a few hundred mA (well I would choose 470uF as it's a common value).
 

John West

Senior Member
Any value of capacitor around 400 to 1000 uFd (at that value it will be a electrolytic cap, meaning it will be directional like your initial filter cap) will help to make the circuit more stable during pulses of the LED, ensuring lower noise operation of the power supply lines. Without a scope to see what load noises are being generated, it's best just to put a high enough value filter capacitor in place that you don't need to worry about it.
 

papaof2

Senior Member
I prefer the PDF, although it's far slower coming up. That way I can see both a PDF window of the schematic and a comment window at the same time. I have a memory problem scrolling back and forth between the two.
If you shift-click on a jpeg image, it opens in a new window - you can arrange the windows to see both image and text in whatever way you prefer.

John
 
Top