Shop OBEX P1 Docs P2 Docs Learn Events
Resistor with a Transistor — Parallax Forums

Resistor with a Transistor

Joe FishbackJoe Fishback Posts: 99
edited 2006-09-02 01:42 in BASIC Stamp
I know how to wire up a BS2 Stamp to a·transistor to switch a load. But I was wondering if you should put a resistor between the Stamp pin and the base·of transistor to limit the current on the pin. Most of the the diagrams I have seen posted not have one. I have tried with and without, both work. Just wondering if the extra protection is needed?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
······ Joe Fishback

-Robots are my friends-

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-09-01 01:16
    The HomeWork Board has series resistors (on the I/O lines) built in, but the BoE does not.· You should definitely use a resistor (220ohms - 1Kohm) between your external devices and the STAMP I/O pins.

    (as for will...89's comment -- it must be the answer to another question.)
  • ccevtccevt Posts: 10
    edited 2006-09-01 02:05
    Joe,

    In almost all cases, you need a resistor in series with the transistor base to limit the current. It protects both the BS2 and the transistor. The base-emitter junction is a silicon diode which will limit the voltage in to the transistor to about +0.7 volts which is also clampping the BS2 output to that level and will take excess currrent from the Stamp pin. This assumes an NPN transistor with the emitter connected to ground and the load in series with the collector with the other end of the load connected to an appropriate +voltage source. It still applies if you use a PNP transistor with Emitter connected to +5 volts and load between collector and ground. If you use either NPN or PNP transistors in an emitter follower (AKA common collector) configuration, then it is safe(r) to omit the base resistor. If you use an enhancement mode MOSFET transistor, such as a 2N7000, you can omit the resistor in series with the gate (input) but it is advisable to use a resistor (>=100k) from gate to source as a static protection device so when you remove the Stamp, the FET gate is not floating and easily zapped.

    The resistor used in series with the base is typically from a few hundred ohms to a few 10s of K ohms. You need to know the DC beta (HFE) gain of the transistor and the required load current. High collector load currents and low gain transistors will require lower value resistors in order get enough base current to saturate (turn the transistor on hard which means the collector is pulled close to the emitter voltage). Hint: Ohms law applies.

    Pulse width modulation (PWM), mentioned by "willthiswork", still requires a resistor in the base in order to limit the peak current. Think of PWM as a person trying to dim a light bulb by rapidly flipping the light switch on and off. When it is on, the full current flows (including possible overload current), and when it is off there is no current. On the aveage, the current and voltage is lower depending on the ratio of ON time to OFF time, but you can still have peaks that exceed component ratings. L and/or C filter elements are used as energy storage devices to remove the ripple created so that the light dosn't flicker or the power supply does not hum.
    The filter works like the flywheel on a 1 cylinder engine.

    Don't forget the protect diode across an relay coils or solonoid coils or you will lose the transistor!

    Hope this helps.

    Horace - N1HC
  • Beau SchwabeBeau Schwabe Posts: 6,559
    edited 2006-09-01 05:14
    Joe,

    Check this application note that I put together... Even though it references a motor in the schematic, a Relay, Light bulb, etc. could just as easily be substituted.

    Hope this helps: Don't get HOT choosing the wrong transistor


    BTW) Running a transistor without a current limiting resistor is generally [b]NOT[/b] a good idea.  The B-E junction of a transistor
         should not exceed the forward voltage of the PN junction ...in most cases this is only .6V  If you do exceed that level
         for prolonged periods of time with an adequate amount of current you [b]WILL[/b] damage the transistor.
    
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.

    Post Edited (Beau Schwabe (Parallax)) : 9/1/2006 5:27:09 AM GMT
  • Joe FishbackJoe Fishback Posts: 99
    edited 2006-09-02 01:42
    Thanks everybody, Beau I now remember your past Post " Don't get HOT choosing the wrong transistor". This time I copied it and filed it in my reference book, also copied this whole thread.

    Thanks again,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ······ Joe Fishback

    -Robots are my friends-
Sign In or Register to comment.