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.

transistor as a switch

Status
Not open for further replies.
Hi, im trying to use a uC like 89S52 for energizing a fan using a TIP12 , i connected a base resistor Rb , and supplied the collector with 12 V and put a protection diode , i dont know if a value of 1k base resistor would saturate the transistor at 5V or no ?

Rb= 5- VBe(on) / iB
= 5-2.5 / 12mA = 0.2 kOhm
at VCE(sat) 2V, Ic = 3A, Ib=12ma

is this correct ?
 
Your example shows 200 ohms, not 1k. 1k would not saturate the transistor.

Don't forget to check the 89S52 for its voltage drop when driving 12 mA.
 
thanks for your reply, well then my calculations were right ?

also this is from the datasheet of the 89S52
VOH Output High Voltage
(Ports 1,2,3, ALE, PSEN)
IOH = -25 uA 0.75 VCC V

so i think it wouldnt be a problem of drawing 12 mA from it ?
 
You'd need a 200 ohm base resistor as you calculated for the TIP120 (I assume it's a TIP120 not a TIP 20), if your uC output were capable of supplying 12mA at 5V. But according to the 89S52 data sheet it can only supply 800uA at 2.4V output.

Thus you need another transistor to add gain. You could us a 2N2905 or similar PNP transistor by connecting the emitter to the +5V, the collector to the TIP12 base through a 200 ohm resistor, and the 2N2905 base to the uC output through a 3.6k resistor. (I used an PNP instead of an NPN since the uC output is capable of sinking more current than it can source and I need 1.2mA of current from the uC to saturate the transistor using a nominal forced beta of 10.)

Note: This added transistor does provide an inversion so the TIP12 transistor is on when the uC output is low.
 
Last edited:
thanks carl , but how about using a ULN2003 ?
from the datasheet

VCE(SAT)
Collector-emitter saturation
voltage (Figure 5.)
IC = 100 mA, IB = 250 μA 0.9 1.1
IC = 200 mA, IB= 350 μA 1.1 1.3
IC = 350 mA, IB= 500 μA 1.3 1.6

i think that would work with the 89S52 ?

regarding the 2N2905 i think it wont work also because from the datasheet it says
VCEsat collector-emitter saturation voltage IC = -150 mA; IB = -15 mA; note 1 - -400
mV

so IB is not less than 800uA so that the 89S52 can supply it , or im wrong ?
 
Last edited:
You said that the collector was connected to +12V. Then it won't work because the transistor is an emitter-follower with a max output voltage at the emitter of only about 1V.

The emitter must be connected to 0V and the fan must be connected between the collector and +12V. A reverse-connected diode must be connected across the fan.
 
Audioguru, yea that's what i did , i were waiting your answer , so what's your opinion about the above posts about using 2N2905 or ULN2003 ?
 
Hi Ahmed,
I am surprised to see that the Amtel micro-p has hardly any output current when compared to a PIC that has 25mA high and low output current.
The Amtel has an output high of only 10uA when its output voltage drops to 4.6V, or 25uA when its output voltage drops to only 3.75V, or only 60uA when its output voltage drops to only 2.4V.
Its output low current is 1.6mA when its output voltage rises to 0.45V.

Do the math to see if it can drive a few transistors and darlington transistors.

Is the max fan current 3A or is that its running current. Its peak starting current might be 10 times more.
 
Last edited:
Do the math to see if it can drive a few transistors and darlington transistors.

would you guide me to a name of a transistor that can be driven using this uC ?
 
Do the math to see if it can drive a few transistors and darlington transistors.

would you guide me to a name of a transistor that can be driven using this uC ?
A TIP120 darlington needs an input of 12ma at 3V for a collector output of 2V at 3A.
Add an emitter-follower transistor then its input will be 600uA at 3.7V.

IF you find a very sensitive TIP120 and a very sensitive little transistor then it will work.
 
Why don't you just use a logic level MOSFET like NPD4060L? Connect the source to GND, the drain to the fan, and the gate to your 89S52 through a 47 ohm resistor. Connect a 1N4001 diode across the fan, anode to +12V.
The MOSFET will switch slowly (microseconds, or tens of microseconds), due the the limited current capability of your 89S52, but I can't see how this would be a problem, unless you are PWM'ing the fan. If you are, then this probably won't work.
 
thanks but im so surprised with the current caps of my 89S52 , then it cant be interfaced to any thing , also there's a problem that we dont have this mosfet here in egypt , can i use the IRF540 ? or any other common BJTs

Im not PWIng the fan , but how atmel makes a uC like that ?!
 
Last edited:
An IRF540 Mosfet needs 10V on its gate to turn on completely. A few out of 100 will turn on pretty well with only 5V on the gate. Try a few hundred of them and pick the most sensitive one.
 
Nigel, how its different between sourcing current and sinking , is that not happens in the same transistor output pin ? In other words, why at VOH it sources so little current at uA and VOL ( sink) it sinks 1.3 mA .. ?

I wonder also about blinking an LED . According to the specs it only sink 1.3mA or so so i cant interface even an LED to it ?? or we read the specs wrong ?
 
Last edited:
Nigel, how its different between sourcing current and sinking , is that not happens in the same transistor output pin ? In other words, why at VOH it sources so little current at uA and VOL ( sink) it sinks 1.3 mA .. ?

I was looking for a description of the pins (data sheets for better parts include a circuit diagram of the ports) in the data sheet I have locally, but couldn't find it! That diagram would explain why the chip can sink more than it can source...

Easy answer, dump the crap Atmel and move to a PIC! :p

I'm also amazed to hear how poor the Atmel is.

I would agree!

However, I had to go looking at data sheets after reading this thread.

Yes, it looks like most of the 8051 -52 atmel chips don't give much for drive, but some of the smaller x2051 x4051 can sink 10 mA, and can source peanuts, like the OP's chip.

To be fair, though, the AVR is much better, and close to the pic sink or source 20 mA per pin. Some AVRs provide up to 400 mA total, but most are like the pic: 200 mA total.

I had a hard time finding what I wanted in the Atmel data sheets, and much prefer Microchip data sheets. (Some posters were recently whining about microchip data sheets, I think they should give these a go!)
 
The PIC is made with high speed Cmos the same as in 74HCxx logic ICs. An output has a max allowed sink or source current of 25mA and can fry the IC with a typical unlimited current of about 60mA.

Maybe the Amtel is made with antique MOS.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top