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.

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

Status
Not open for further replies.

konradIC13

Member
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:
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.
 
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
 
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.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top