Simple transistor problem

Discussion in 'General Electronics Chat' started by mikewashere05, Oct 26, 2009.

  1. mikewashere05

    Thread Starter New Member

    Oct 26, 2009
    Hello all,

    I've been working on this problem for a few hours now, and what seems
    to be simple is not working correctly in Multisim. I'd like your guys (and girls :)) opinion on my problem, here are the steps I've taken so far. Attached is an image of my Multisim circuit and its results.

    To be brief, I am attempting to design a relay driver circuit. What I'd like to happen is to set an output pin high (5v) from a microcontroller (ATTiny24). This, in turn, will power a 12v relay that requires 180mA to energize the coil. The relay has a coil resistance of 160ohms. The microcontroller can only sink up to 20mA of current, so I'm attempting to use a 2n2222 transistor in saturation mode to switch the relay on.

    The 2n2222 transistor has a hFE of 100 and Vbe of .6v. Some research on this site advised me that, if not necessary to design for power efficiency, I should assume the worst case hFE. The datasheet lists that as 40 at Ic = 500mA and Vce = 10v.

    So in order to create an Ic of 180mA to energize the coil, with an hFE (worst case) of 40 I need an Ib of 4.5mA. My Rb = (Vcc - Vbe) / Ib = 1kOhm.

    Using all that I modeled the circuit in Multisim as shown below. I expected an Ic of, at minimum, 180mA. The results are far from that number. Where am I going wrong?

  2. k7elp60

    Active Member

    Nov 4, 2008
    I am not familair with multisim, but the circuit hookup would normally have the 160 ohm resistor from Vcc +12V to the collector of the 2n2222. When the transistor turns on the transistor saturates and the relay energizes. Also a diode is connected in parallel with the coil, cathode to +12V to suppress the back emf when the relay deenergizes.
    Also it is a good idea to put a resistor from base to emitter to keep the the transitor off with no signal. I think 10K would work.
  3. Ron H

    AAC Fanatic!

    Apr 14, 2005
    Your 12V battery polarity is backward, and it would make more sense if you swapped the positions of the 12V battery and the 160Ω resistor, unless you really have a floating (ungrounded) 12V supply.
    When the transistor is saturated (Vce≈0V), 12V will be across the 160Ω resistor. By Ohm's law, the current will be I=12/160=75mA (slightly less).
    You should set Ib≈Ic/10 to ensure saturation.
  4. mik3

    Senior Member

    Feb 4, 2008
    Swap the 160R resistor and the 12V battery position. The negative side of the battery must be connected to ground.
  5. Ron H

    AAC Fanatic!

    Apr 14, 2005
    The battery doesn't have to be connected to ground to make the circuit work, but the polarity does have to be flipped.
    Of course, in most practical circuits, one terminal of the battery will be grounded.