1. 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.
    Dismiss Notice

Whats better - sink or supply current - driving transistor from ATmega8

Discussion in 'AVR' started by konradIC13, Jun 24, 2012.

  1. konradIC13

    konradIC13 Member

    Joined:
    Jun 15, 2012
    Messages:
    90
    Likes:
    0
    Location:
    Poland
    Hello,
    I want to make circuit where 3 ATmega8 outputs will be used to control 3 transistors where each of transistor will control one LED (in fact 3 transistors will work with one RGB LED, they will be just switching on/off appropriate colors of it, Red/Green/Blue, the If of each part of LED is 20mA and the voltage drops are 1.95v/3.3v/3.3v for R/G/B)

    I made two schematics, one is using NPN transistors and LEDs are on when the output is set high and in other one with PNP transistors LEDs are on when output is set low.

    I now cant decide if i should use the NPN configuration or PNP, what will be better? If the ATmega8 will supply current or sink current?

    View attachment 65121 View attachment 65122
     
    Last edited: Jun 24, 2012
  2. wkrug

    wkrug Active Member

    Joined:
    May 30, 2010
    Messages:
    280
    Likes:
    29
    Location:
    Germany
    The ATMEGA 8 can sink up to 20mA and source up to 10mA.
    In spite of that fact, I would suggest You to use an N-Channel Logic Level FET Transistor or an NPN Transistor.
    Because you can use it for higher Supply Voltages, when connecting more than one LED per Channel in serial manner.
    With a PNP Type ( or P-Channel FET )you had to use an additional Transistor to drive the Power Transistor when the Supply Voltage for the LED's is higher than the Supply for the Controller.
    Usually P-Channel FET's has an higher RDS-on, that increases the thermal charge of the Transistor.
     
  3. konradIC13

    konradIC13 Member

    Joined:
    Jun 15, 2012
    Messages:
    90
    Likes:
    0
    Location:
    Poland
    Hello, thank you for your answer.

    If ill need to control more than one led per channel ill remember to use N logic level FET, but so far i just need to drive one led per channel.
    So from what you say, its better do use NPN transistor and source current from ATmega output to transistor base like in this schematic:
    View attachment 65126
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. wkrug

    wkrug Active Member

    Joined:
    May 30, 2010
    Messages:
    280
    Likes:
    29
    Location:
    Germany

    I think to use NPN Transistors is the better Way.
    At a Base Resistor of 2kOhm the Controller has to source about 2mA and that's no problem.

    When you want to use the Controller A/D Converter, You should be a little bit careful.
    sourcing or sinking of higher currents can distore the converter results.
    Check this out, before creating a PCB.
     

Share This Page