Help with a transistor
SimEnzo
Posts: 21
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:
Can anyone tell me where I'm going wrong?
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
Can anyone tell me where I'm going wrong?
Comments
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.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
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.