Shop OBEX P1 Docs P2 Docs Learn Events
Help with a transistor — Parallax Forums

Help with a transistor

SimEnzoSimEnzo Posts: 21
edited 2008-06-12 19:02 in BASIC Stamp
Ok, I'll admit it... I find transistors confusing.

I'm trying to wire up a transistor so that my microcontroller can turn on/off a solenoid that runs on 24v DC. It seemed to be running fine, but when I touched the heat sink (to make sure it wasn't running hot), I got shocked. Checking the heat sink with a multimeter confirms that it has 25v current running to it. I assume this isn't supposed to be the case.

Here's how I have things setup:
  • I'm using a TIP31C transistor, which is an NPN type with a pin order of BCE.
  • I have it wired up so that an output pin from the microcontroller is going to the transistor's Base pin via a 1k resistor.
  • The 24 volts are going to the solenoid and the solenoid's ground is going to the transistors Collector pin
  • The transistor's Emitter pin is going to the 24v adapter's ground wire... it's also connected to the microcontroller board's ground via a 1k resistor (the microcontroller is being powered by a 9v battery)
  • The transistor's Collector & Emitter pins are connected with a 1N4004 protection diode
Attached is a photo of the wiring.

Can anyone tell me where I'm going wrong?
800 x 600 - 98K

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-12 18:00
    You have to remove the 1K resistor between the emitter and the microcontroller's ground. This is reducing the amount of base current and preventing the transistor from switching on as much as possible, thus increasing the transistor's resistance and the amount of heat it generates.

    The 1K resistor in the base lead may also be too high. You really need to provide as much current as possible from the Stamp consistent with its limitations. Plan on something close to 20ma, so a base resistor of 270 to 330 Ohms would be better.
  • SimEnzoSimEnzo Posts: 21
    edited 2008-06-12 18:08
    Cool, thanks... I gave that a shot and it seems to work. A multimeter on the heat sink is still showing a voltage, but it now varies up & down (ranging from 0 to 25v) as the solenoid is activated/deactivated... but perhaps that normal?
  • JonathanJonathan Posts: 1,023
    edited 2008-06-12 18:36
    Sounds like a spike from the solenoid from EMF. I wouldn't think that 25V could give you a noticable shock. Do you have a protection diode across the coil of the solenoid?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-06-12 19:02
    If the transistor is fully "on", it should have a drop of like 0.1 volt between the collector and emitter. If it's fully "off", then yes, it will be dropping 25 volts DC (because your 24 volt DC supply is probably "unregulated", meaning the actual voltage varies a bit based on how much current it's supplying).

    You turn the transistor "fully on" by providing enough current through the Base-Emitter path -- an NPN transistor is a "Current" activated device. Thus the 330 ohm resistor in the 'base' line.
Sign In or Register to comment.