AVR I/O pin capacitance considerations

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I know this might seem a bit on the paranoid side.. but diodes have a certain level of capacitance between their P-N junction's, and capacitors can at the charging state draw as much current as the wire resistance/voltage/capacitance allows. Given that, it should be best to place a current limiting resistor between the I/O pin and the LED connected to ground vs connecting the I/O pin to the LED to the resistor to ground? At least in PWM applications? Please note I'm only talking about an I/O pin sourcing current through an LED, not sinking it.
I'm unfamiliar with the capacitance of modern LEDs, especially the bright white one's that are popular nowdays. I'm also sure the power involved is pretty low, but is this a sane deduction? How much extra stress would really be put on the I/O driver when it's connected directly to a capacitor? What about at higher PWM frequencies? At some point wouldn't there be a noticeable AC current leakage across the diode?
This has been bugging me since the first time I ever wondered about hooking an LED up to an AVR I/O pin. Comments and wisdom would be greatly apprecitated.

-Curiosity may have killed the cat
-But that's why they have nine lives

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Capacitance of small diodes is going to be in the picofarads. The current drawn
by a capacitor is limited by the source charging it. The output fets in the
Avr's port circuitry have a few ohms of resistance when they turn on, and the
diode capacitance is so small, there is no need to worry. Actually, even
ordinary cmos logic outputs are fully intended to drive significant capacitive
loads because cmos inputs (fet gates) are essentially capacitors anyway.

Tom Pappano
Tulsa, Oklahoma

Tom Pappano
Tulsa, Oklahoma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Aren't modern bright white LEDs designed to increase surface area to increase light emittance at the cost of increased capacitance and lower reverse voltage/current rateing? I wonder what exactly are the real world capacitances of a bright white (3.6 volts or better forward) diode at 20ma.

-Curiosity may have killed the cat
-But that's why they have nine lives

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

Capacitance of small diodes is going to be in the picofarads.

Quote:

I wonder what exactly are the real world capacitances of a bright white (3.6 volts or better forward) diode at 20ma.

Your question piqued my interest, so I looked at a couple of datasheets for "super bright" LEDs and did a quick Google search. The capacatances I have seen are in the few hundreds of pf.

If it causes you concern, then put the resistor first and fuggeddaboudit?

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I found a technical paper which asserts that for high currents, the rise time is primarly driven by recombination lifetime.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

if you want high efficiency led driver, connect led in serial with a resistor to ground, example: 500mV @ 20mA => R=25 ohm,
use a few hundred micro henry inductance, and configure as buck regulator,
(in series with led) you need additional capacitance to ground and led anode, to reduce ripple voltage.

now make pwm, connect adc channel to resistor, set voltage with pwm on resistor.
you are done, high efficiency led driver.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The most important thing seems to have escaped responders' attention. It DOES NOT MATTER where you place the resistor. The current does not disappear in the diode capacitance. It must return to where it was taken from. Current always flows in closed loops. The current path in this case is power supply-> avr vcc pin -> output driver -> diode -> resistor -> ground -> power supply. The current is limited by the sum of resistances of all these elements. If you exchange the diode and the resistor, the sum - thus the current - remains the same.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And (in addition to gizmo)
it doesn´t matter if the AVR sources or sinks current.

You can calculate the current caused by a capacitance directly connected to GND.
(no limiting resistors in series - so it´s the worst case)
Icc = VCC * C * f

To make a led flickerless you need at least 50Hz PWM. To make it very very very good we take 1000Hz. We assume the capacitance to be 200pF and a VCC of 5V.

Icc = 1000Hz * 200pF * 5V = 1uA (worst case!!!)
So don´t worry about it.

For sure the current when the level changes is high. Agian: don´t bother.
In the datasheet you may find an max. capacitance - this is only to ensure the timing specifications.
But driving a LED - there will be no problem if the rise/falltime is some 10´s of ns longer....

Klaus
********************************
Look at: www.megausb.de (German)
********************************