Maker Pro
Maker Pro

Current limiting for transistor base

Yoshidk

Jan 23, 2013
1
Joined
Jan 23, 2013
Messages
1
Hello everyone

I have a circuit where my µC (ATmega16) triggers a transistor (ULN2001) to open for a LED
I know i need a resistor between the ATmega16 output and transistor base to limit the current, but i cant figure out which resistor value would be best?
I guess too low would waste power, and too high might kill the signal..

I made a simple drawing of the setup here:


Datasheets:
ATMega16:
http://www.datasheetcatalog.org/datasheet/atmel/2545S.pdf
ULN2001:
http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00001244.pdf
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
Ibase= Iled/beta.
Iled~10.4V/330 Ohm = 30mA (assuming red LED with Vf~1.6V)
beta ~60 (from the transistor datasheet for Ic=50mA)
=> Ibase= 500µA
Ibase= (Vh(cpu)-Vbe)/R2.
Vh = 4.5V (the ATmega should be able to deliver that voltage worst case at Vcc=5V and 500µA)
Vbe = 0.6V
=> R2=3.9V/500µA = 7800 Ohm.

To ensure that the transistor is saturated under worst case conditions use the next lower standard value, e.g. 7500 Ohm.

You can get a quick and dirty estimate from R2=R1*beta*V1/V2 (this neglects base-emitter voltage, Vf of the LED, VoH of the ATmega, but comes close).
 

KrisBlueNZ

Sadly passed away in 2015
Nov 28, 2011
8,393
Joined
Nov 28, 2011
Messages
8,393
The ULN2003 and ULN2004 have base current limiting resistors built in. The 2004 is probably the most suitable if you're just driving LEDs with it.
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,700
Joined
Nov 17, 2011
Messages
13,700
I obviously I overlooked that note saying ULN2001 and only looked at the 2N3904. My fault. Kris is right concerning the ULN IC.
 
Top