Connect with us

Driving common cathode LEDs from microcontroller

Discussion in 'General Electronics' started by Eric, Jan 15, 2004.

  1. Eric

    Eric Guest

    I'm a bit stumped on how to drive a bank of common cathode LEDs from a
    microcontroller. Here is the problem.

    The green and blue colors require 3.5v @ 40mA, and the red portion
    requires 2v @ 40mA. I would like to drive 5 of each from the
    microcontroller. For a normal bank of LEDs I would simple connect
    them in series along with a resistor to the collector of a 3904
    transistor. Since they are common cathode LEDs, I am guessing that I
    would have to connect them in parallel between the transistor emitter
    and ground. This would result in 15 (!) resistors. Is there a better
    way to accomplish this task?
     
  2. Tim

    Tim Guest

    I do not believe you will find your idea practical. The output of most
    microprocessors are a volt or so below the power supply. The NPN transistor
    circuit you describe will cause at least another .6 volt drop. The green and
    blue LEDs will probably not light under those conditions.

    If the LEDs are requiring 40ma for all LEDs driven from one output, use a
    2N3906 PNP or equivalent in the following circuit. If the requirement is
    40ma each, use a TIP30 or equivalent.

    To insure they light fully, use a PNP transistor with the emitter connected
    to the microcontroller power supply, the collector to the LED bias
    resistors, the base to center of a voltage divider (ladder) with one
    resistor (about 1Kohm) connected to power supply, and the other (about
    2Kohm) to the microcontroller output.

    You may need to adjust the resistor values in the voltage divider so the
    transistor is:
    off when microcontroller output is high
    and
    on when microcontroller output is low.

    Note the output/LED relationship will now be low-on and high-off. The
    relationship can be reversed with a inverting buffer between the
    microprocessor and the voltage divider resistor.

    You can get fancy by using a higher voltage power supply (like 12vdc) and
    connect the LEDs in series and use only one bias resistor. This will reduce
    the current requirement to that of a single LED. This will require an
    open-collector buffer or NPN transistor common-emitter circuit to activate
    properly.

    Hope that helps.

    Tim
     
  3. Tim

    Tim Guest

    Just a note. You must use individual LEDs for this series setup. A common
    cathode array will not work in series as far as I know. And I don't know
    much.

    Tim
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-