Digital Dude needs Analog Advice

Discussion in 'General Electronics Chat' started by Jack B. Nimble, Mar 18, 2012.

  1. Jack B. Nimble

    Thread Starter New Member

    Mar 18, 2012
    3
    0
    Hey Folks:

    I need to control a single LED via an I2C bus. I thought I had it in the bag until realizing my digital pot chip can only sink 2.5 mA (see Circuit A).

    Board space is minimal, so I'm wondering about using a single Bipolar Junction Transistor in a SOT-23 package to control LED brightness. (See Circuit B). Seems pretty elementary, but I rarely do anything that's not either 0 or 5 volts and I'm full of questions, e.g. what type/brand of transistor would be appropriate? Any way I could I get along without current limiting resistor(s)?

    All thoughts appreciated.

    -Jack

    [​IMG]

    [​IMG]
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,432
    3,360
    Seems a bit overkill to me. If you want to control the intensity of an LED from a microcontroller, use PWM output from a single pin. No transistor or resistor needed but I would include the resistor for safety.
     
  3. Jack B. Nimble

    Thread Starter New Member

    Mar 18, 2012
    3
    0
    Yes, I should have noted this LED is on a remote daughterboard, i.e. my only connections to the microcontroller are +5v, Gnd, and the two I2C lines (SDA and SCL).

    -Jack
     
  4. MrChips

    Moderator

    Oct 2, 2009
    12,432
    3,360
    So, use one of the I2C lines and send PWM pulses out. No need for a digital pot.
     
  5. Jack B. Nimble

    Thread Starter New Member

    Mar 18, 2012
    3
    0
    Hmmmm, I like the way you're thinking here - such an approach might work. It's just that my motherboard has 3 other active devices the I2C bus, and I wonder if "borrowing" one of the I2C lines for PWM pulses might gum up normal I2C operations.

    Thanks, Mr. Chips. I'll noodle on this and report back.

    -Jack
     
  6. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    Your digital pot feeding the common-emitter transistor amplifier will do nothing for the first 31 steps then the LED will begin to turn on. Temperature changes will affect the brightness very much. When the pot reaches the 36th step then the LED will be about as bright as it will ever be but again temperature changes will affect its brightness.
     
Loading...