Driving transistor with square wave

Discussion in 'The Projects Forum' started by sgardner025, Jan 13, 2010.

  1. sgardner025

    Thread Starter Active Member

    Nov 5, 2009
    79
    4
    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.
     
  2. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    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
     
  3. retched

    AAC Fanatic!

    Dec 5, 2009
    5,201
    312
    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.
     
  4. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    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.
     
  5. sgardner025

    Thread Starter Active Member

    Nov 5, 2009
    79
    4
    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.
     
    Last edited: Jan 13, 2010
  6. hgmjr

    Moderator

    Jan 28, 2005
    9,030
    214
    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
     
  7. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    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.
     
  8. sgardner025

    Thread Starter Active Member

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

    Moderator

    Jan 28, 2005
    9,030
    214
    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
     
  10. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    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.
     
Loading...