Driving transistor with square wave

Thread Starter

sgardner025

Joined Nov 5, 2009
79
I'm driving the base of a 2N2222A transistor with a square wave of fixed frequency and variable duty cycle to control fan speed. The problem is that the nice clean square wave that I have with a resistive load turns into a jumbled mess while driving the transistor, it looks more like a sine wave. The fan still runs and the speed can still be controlled. I have tried frequencies from 50 Hz to 20 KHz as well as several different base resistor values from 220 ohms to 2.2K ohms. The base driving signal is coming from a 741 op amp. Is the input capacitance of the transistor affecting the signal? I'm not sure what to try to correct this.
 

hgmjr

Joined Jan 28, 2005
9,027
Can you post a schematic so that we can see the details of your circuit? That will help use better assist you with your question.

hgmjr
 

retched

Joined Dec 5, 2009
5,207
A smoothing cap seems to be in order, however, hgmjr is correct, a schematic will keep others(like me) from shooting at a moving target.
 

Audioguru

Joined Dec 20, 2007
11,248
The output of an old 741 opamp (it is 42 years old) has trouble above only 9kHz. Most ordinary opamps have outputs that go up to 100kHz.

Let us see if the transistor is overloaded.
 

Thread Starter

sgardner025

Joined Nov 5, 2009
79
Here's a multisim schematic. I forgot to mention the diodes, I've tried it with and without them. The fan draws 120 mA at 12V, it's a small 40mm from an old video card.
 

Attachments

Last edited:

hgmjr

Joined Jan 28, 2005
9,027
If I understand your problem correctly, what you are saying is that the signal at the collector of the NPN transistor transitions from high to low very fast but it transitions from low to high at a much slower rate.

Is that this case?

hgmjr
 

Audioguru

Joined Dec 20, 2007
11,248
Your schematic has the 3rd 741 opamp turning on the 2N2222 transistor through 2 diodes and a resistor but nothing turns the transistor off.
Add a 470 ohm resistor from its base to its emitter to turn it off.

Replace the slow 50Hz rectifiers with higher frequency 1N4148 diodes.
 

Thread Starter

sgardner025

Joined Nov 5, 2009
79
Thanks Audioguru, the 470 ohm resistor worked and I don't even need the diodes. Was the transistor being overdriven with too much current?
 

hgmjr

Joined Jan 28, 2005
9,027
The addition of the 470 ohm resistor that audioguru suggested is referred to as a base-return resistor. You will notice that when you had the diodes in the base drive circuit, the drive to the transistor base occurred only when the drive signal went high. When the drive signal went low, the diodes were reverse-biased and therefore there was nothing pulling current out of the base when it was being turned off. This resulted in a very slow turn off. By adding the base-return resistor, this added resistor pulls the base to ground when the drive signal goes low.

hgmjr
 

Audioguru

Joined Dec 20, 2007
11,248
When the transistor was supposed to turn off, your diodes simply disconnected the base of the transistor then the base floated slowly down to where the transistor slowly turned off. A 470 ohm base-emitter resistor quickly turns off the transistor.
 
Top