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.

Driving LED without current limiting resistor

Status
Not open for further replies.

eblc1388

Active Member
If you want to drive LED's with it, connect anode of LED to +5V and Catode to PIN, this will allow you to turn on the LED by putting LOG.0 on the output PIN.

The above is from the "sticky" FAQ about PIC in this forum, on how to drive LED using open collector pins.

Would I kill the chip if I do not use a current limiting resistor? Is it a common practice for PICs?
 
eblc1388 said:
If you want to drive LED's with it, connect anode of LED to +5V and Catode to PIN, this will allow you to turn on the LED by putting LOG.0 on the output PIN.

The above is from the "sticky" FAQ about PIC in this forum, on how to drive LED using open collector pins.

Would I kill the chip if I do not use a current limiting resistor? Is it a common practice for PICs?
You would possibly kill the LED first... and dramatically decreased PIC's lifetime. :twisted:

This is a good practise for all MCUs !
 
Jay.slovak said:
You would possibly kill the LED first... and dramatically decreased PIC's lifetime. :twisted:

In that case, why are you telling people to do that in the "sticky" ??? :?
 
eblc1388 said:
Jay.slovak said:
You would possibly kill the LED first... and dramatically decreased PIC's lifetime. :twisted:

In that case, why are you telling people to do that in the "sticky" ??? :?
Ohh I missed that. I assumed that people are inteligent enaugh to put it there :lol: .

LOL thanks for letting me know :lol:
 
If a PIC can output or sink a maximum of 25 mA..
I wonder what would happen if you put a diode to ground , with no current limit, and drive it with PIC pin in PWM mode..??
 
williB said:
If a PIC can output or sink a maximum of 25 mA..
I wonder what would happen if you put a diode to ground , with no current limit, and drive it with PIC pin in PWM mode..??

Why a diode?, why not just short the pin to ground (or 5V for that matter).

The outcome is fairly obvious!, it may survive?, or it may damage the chip?, it depends how lucky you are. But it is causing the device to operate outside it's design limits, so it's NOT a good idea.

Generally though I would expect the chip to survive, it's the short of thing that could happen quite easily by accident (due to a software error) - if you're using a pin as an input for a switch, and it has a switch either to Vdd or Vss, and you set the pin as an output - it obviously shorts the output in just that way.

But to feed LED's ALWAYS use a current limiting device (it doesn't have to be a resistor!).

Jay! - I've added a mention of a resistor to your sticky for you!.
 
Nigel Goodwin said:
williB said:
If a PIC can output or sink a maximum of 25 mA..
I wonder what would happen if you put a diode to ground , with no current limit, and drive it with PIC pin in PWM mode..??

Why a diode?, why not just short the pin to ground (or 5V for that matter).

The outcome is fairly obvious!, it may survive?, or it may damage the chip?, it depends how lucky you are. But it is causing the device to operate outside it's design limits, so it's NOT a good idea.

Generally though I would expect the chip to survive, it's the short of thing that could happen quite easily by accident (due to a software error) - if you're using a pin as an input for a switch, and it has a switch either to Vdd or Vss, and you set the pin as an output - it obviously shorts the output in just that way.

But to feed LED's ALWAYS use a current limiting device (it doesn't have to be a resistor!).

Jay! - I've added a mention of a resistor to your sticky for you!.
Thanks for the Sticky update Nigel!
And I think you can close this Topic now, everithing is cleared out.

Conclusion: Always use resistors (or some type of constant current device) to drive LEDs. If you won't use it, you are risking PIC and LED damage (which will most likely happen) :D
 
just remember to read the LED documentation.

And use this all the time once you see anything has a maximum current.

V=IR

V: voltage , I: current , R: resistance
 
williB said:
If a PIC can output or sink a maximum of 25 mA..
I wonder what would happen if you put a diode to ground , with no current limit, and drive it with PIC pin in PWM mode..??

It varies. You may have an LED which requires 3v+ as a threshold, and a PIC pin will drop below 5v when outputting 25mA. It's possible the LED will get only 25mA as the pin's output voltage drops to the LED voltage. But this is quite unreliable, the exact current depends on temperature, LED characteristics, and unspecified (thus no guarantee of consistency) PIC pin characteristics.
 
Oznog said:
williB said:
If a PIC can output or sink a maximum of 25 mA..
I wonder what would happen if you put a diode to ground , with no current limit, and drive it with PIC pin in PWM mode..??

It varies. You may have an LED which requires 3v+ as a threshold, and a PIC pin will drop below 5v when outputting 25mA. It's possible the LED will get only 25mA as the pin's output voltage drops to the LED voltage. But this is quite unreliable, the exact current depends on temperature, LED characteristics, and unspecified (thus no guarantee of consistency) PIC pin characteristics.
lol at least somone got what i ment.. :wink:
i ment LED when i said diode..
If the Pic can sustain the 25mA pulses of of the pwm output , my question is , why not use the current limiting of the pic to your advantage..??
 
williB said:
Oznog said:
williB said:
If a PIC can output or sink a maximum of 25 mA..
I wonder what would happen if you put a diode to ground , with no current limit, and drive it with PIC pin in PWM mode..??

It varies. You may have an LED which requires 3v+ as a threshold, and a PIC pin will drop below 5v when outputting 25mA. It's possible the LED will get only 25mA as the pin's output voltage drops to the LED voltage. But this is quite unreliable, the exact current depends on temperature, LED characteristics, and unspecified (thus no guarantee of consistency) PIC pin characteristics.
lol at least somone got what i ment.. :wink:
i ment LED when i said diode..
If the Pic can sustain the 25mA pulses of of the pwm output , my question is , why not use the current limiting of the pic to your advantage..??
I think that is not a good idea, risk PICs damage just to save couple cents...
 
Jay.slovak said:
I think that is not a good idea, risk PICs damage just to save couple cents...

Iagree, sounds a stupid idea to me! - the specs say not to exceed 25mA per pin (with a maximum per chip as well) - it DOESN'T say it provides a current limited 25mA per pin!.
 
hi, this is a very old thread, but hopefully some1 still reads this. i want to limit the current to the LED without the resistor as the resistor dissapates too much power. i want to make the circuit as effiecient as possible. So if effiecency is my greatest constraint, would running the LEDs from a micro work???

Any suggestions to other possible ideas are also welcome.
 
The max source/sink current on a PIC I/O pin is 25 mA, but the chip doesn't limit the current to that. You'll get as much current as the resistance of the driver, pin, voltage, and Ohms Law will allow, until the chip overheats and dies.

But... since it's actually the heat that kills the components and not the current itself, if you're careful you could drive the LED and PIC to higher currents at (very) low duty cycles, but it's probably best to use a resistor. You wouldn't want a software bug to freeze the pin high and destroy the LED and possibly the PIC as well.
 
hi, this is a very old thread, but hopefully some1 still reads this. i want to limit the current to the LED without the resistor as the resistor dissapates too much power. i want to make the circuit as effiecient as possible. So if effiecency is my greatest constraint, would running the LEDs from a micro work???

Any suggestions to other possible ideas are also welcome.

You do realize that the potential energy needs to go somewhere. If it is not dissipated in the resistor, it will be dissipated in the PIC which is BAD

You could even save power by restricting the current of the LED to 5-10mA using a resistor.

To summarize, always use to resistor (read the 10 posts above!).
 
Last edited:
Status
Not open for further replies.

Latest threads

Back
Top