Transistor Beginner

Discussion in 'General Electronics Chat' started by emzdanow, Jun 14, 2010.

  1. emzdanow

    Thread Starter New Member

    Jun 14, 2010
    23
    0
    I am brand new to transistor circuits, mainly interested in DC motor control. I want to use a 2N3904 transistor as a switch to turn on a 12v computer fan. I am using a PIC16F690 to send a 5V digital signal to the transistor gate. I am using a converted desktop PC power supply for the +12V (verified with multimeter). My problem is that when I turn on power supply the fan turns on without the high digital signal at the gate. In fact pressing my switch to activate the digital signal does nothing. I have the positive lead from the power supply connected to the positive wire of the fan motor. The ground of the fan motor is connected to the collector. The ground of the power supply is connected to the emitter. The digital signal is connected from the microcontroller port to the gate through a 560 ohm resistor.

    Why is my circuit open when the power is on and no gate current is applied (removed resistor from gate to be sure)?
     
  2. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    You probably fried the transistor, and it is now shorted from collector to emitter.

    The motors' reverse-EMF that occurs when you turn off the transistor is likely enough to fry it. Placing a fast-recovery diode across the motor will help prevent the burn-out of the next transistor.

    2N3904 transistors are rated for a maximum Ic (collector current) of 200mA, but a more practical limit is 100mA. With a base resistor of 560 Ohms, you'll have a maximum collector current of about (Vcc-0.8)/(Rbase/10) = (5v-0.8v)/(560/10) = 4.2/56 = 75mA saturated.

    Motors draw high current when starting from a stop (stall current).

    You must not supply a transistors' base with an unlimited supply of current; a resistor is mandatory or you will cause smoke.

    A transistor does not have "a gate". MOSFETs have gates. They are voltage controlled, where transistors are current controlled. MOSFETs are all the rage nowadays.

    Hope this helps you somewhat.

    It would help if you posted back specifications of your fan, or at least a manufacturer and part number.
     
    Last edited: Jun 15, 2010
  3. emzdanow

    Thread Starter New Member

    Jun 14, 2010
    23
    0
    Thank you for your response sgtwookie,

    I think I may have solved the problem and was just doing something very stupid. After rearranging my motor power supply and pulling power from the microcontroller itself and trying different source voltage configs, the transistor worked when the base voltage from the microcontroller shared ground with the 12V power supply.

    Is this incorrect as well or is this correct and I am just electronically impaired?
     
  4. kingdano

    Member

    Apr 14, 2010
    377
    19
    youll do better on this site if you provide a schematic.

    extrapolating a circuit from words is difficult and error prone.
     
  5. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    Sounds like you found the way. The grounds have to be connected because otherwise they will be at different potentials.
     
  6. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Yes, you either have to connect the microcontroller supply and motor supply grounds, or there will be no path for current.

    Either that, or you will need to use optocouplers/optoisolators to get the control signals from the uC side to the power control side.
     
  7. emzdanow

    Thread Starter New Member

    Jun 14, 2010
    23
    0
    That was the problem, ground must be common between microcontroller and external power supply. Spoke to EE at work and he took me to school then docked my pay for ignorance.

    Thanks for all of the help!
     
  8. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Ouch! :( Well, if a lesson cost you money, I certainly hope that you remember it.
     
  9. lmartinez

    Active Member

    Mar 8, 2009
    224
    6
  10. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    I briefly looked at the first link and found a couple of serious errors, and not just typos. I would not recommend it to anyone, least of all a noobie.:eek:
     
  11. lmartinez

    Active Member

    Mar 8, 2009
    224
    6
    Would you be so kind to present the serious errors as to the author may have an opportunity to make corrections? Thank you in advance
     
  12. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    On this page: http://www.ermicro.com/blog/?p=423
    The blog implies that hFE is constant over the entire range of base current. This is not correct.

    hFE can (and does) vary widely across the range of base current. Some transistors (particularly those designed for audio amplifier applications) have a more linear response than others.

    When using a transistor as a saturated switch, you ignore the hFE specification, and use an hFE of 10.
    Thus, RB = (Vin-Vbe)/(Ic/10), where:
    Vin = the voltage applied to RB
    Vbe = voltage on the base with respect to the emitter
    Ic = desired collector current

    In the 4th schematic down, 5 LEDs are wired in parallel with a single current limiting resistor. This is just plain bad practice, as the Vf of LEDs can vary as much as 10% in a batch.

    The blogger implies that 75mA is far below the Ic(max) of 200mA, but in reality, 100mA is a practical limit for the 2N3904 transistor. In order to properly saturate the transistor for a 75mA (and actually rather heavy) load, the Vbe estimate should be increased to 0.8-0.9v. A datasheet should be consulted for the actual Vbe vs Ib ranges.

    At any rate, the new calculation results in:
    RB = (5v-0.85)/(75mA/10) = 4.15/0.0075 = 553 Ohms. The closest standard value is 560 Ohms. 510 Ohms could also be used; that would help to compensate for any drop in the uC's output pin - which would be quite minor, nothing near the 0.8v loss the blogger is claiming with such a light load.

    The bloggers estimation of resistor power requirements is also not correct.
    Let's say we've decided on using the 510 Ohm resistor.
    P=EI, but we double the actual power requirement for reliability's sake.
    4.15*7.5mA*2 = 62.25mW; a 1/10 Watt resistor would be much more than enough.

    If you look at the 5th image down, you will see that he has Vce(sat) highlighted, but has ignored the fact that the datasheet used Ic=10mA with Ib=1mA - notice that Ib=Ic/10.
    Look at Vbe(sat) - it shows a minimum of 0.65v, and a maximum of 0.85v, which I used in my calculation.

    In the 6th image, the blogger uses three 150 Ohm resistors in parallel to get 50 Ohms. However, they should have used individual resistors for each LED.

    In the 8th image, you can see that Vce is 0.40v; the transistor is not saturated.
    You can also see that the blogger has determined an hFE of 58, which is well below the minimum hFE specified in the datasheet for when it is used as an amplifier.

    The blogger continues to make similar errors in the remainder. They simply do not understand the difference between using the transistor as an amplifier, and using a transistor as a saturated switch.

    There are a few exceptions to the Ib=Ic/10 rule. There are some very high gain transistors around, such as the ZTX869 transistor, which has nearly the same Vce if you use an hFE of 100 vs 10. However, for the most part with standard bjt's, use Ib=Ic/10.

    With the ULN2803A, he's claiming 500mA per output. You might get that if you are only using 1 output at a time. Better to plan on 350mA maximum per output if you are only using 1 at a time. If you are using more than 1, the package dissipation limits will kick in.

    I think the blogger is in love with 2N3904/2N3906 transistors. I don't know why they aren't using the more robust 2N2222/2N2907A transistors, particularly since they're showing them as saturated switches. You might get up to 400mA source/sink with a 20mA base drive current; 200mA for certain. Not so with a 2N3904/2N3906 - 200mA is the absolute max, and not for long.

    There's likely other errors; I just kind of glossed over it.

    I've spent enough time on examining sites elsewhere.
     
  13. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    Sure. I was going to do it when I posted, but my wife had dinner ready.:)
    1. Paralleling LEDs is not good practice, especially for the hobbyist. Unequal forward voltages will make the intensities vary from device to device. Each LED should have its own current limiting resistor.

    2.Calculating saturated transistor "beta" is a waste of time. Transistors in saturation should be driven at their specified "forced beta" (βf), as in this table. In this case, βf=10, as is the case for most transistors.

    3. From section E:
    This apparently refers to current transfer ratio, which is 100% minimum at 25°C, or 40% max over the full temperature range (-55°C to +100°C). Current transfer ratio is analogous to hFE (beta). 100% is equivalent to a beta of one - not 500!

    4. The H-bridge circuit will not work as shown. The upper transistors are being operated as emitter followers. Emitter followers will not saturate unless the base is raised to Vbe above the collector voltage. With Darlingtons, and 5V base drive, the emitters will only rise to about 3.5V. In this case it is even worse. The bases of the upper transistors are clamped by the bases of the lower transistors to about 1.5V, so the upper transistors will never turn on.
    There are probably thousands of articles written about H-bridges, so I am not going to attempt to explain all the basics or subtleties here.
     
    Last edited: Jun 17, 2010
Loading...