Transistor Problem

Hi,

I’m playing around with transistors lately and something doesn’t work right.

The setup is as follows:

One PNP transistor,
Base goes to pin 2, Collecter is +5V, Emitter is LED and then to ground.
So far everything works fine, pinmode is set to output and I can switch to HIGH, LED goes on, LOW, off.

But if I attach an extrenal circuit:
9V Battery, Base still goes to pin 2, Collector is +9V, Emitter is LED and then arduino Ground, and 9V Block ground goes to arduino ground.

But if I change from HIGH to LOW now all that happens is, the LED gets dimmer but its not turning off anymore… what am I doing wrong?

Cheers,
Jazzar

One of your big things is that you need a resistor in between the base of your transistor and the arduino pin - if you haven't burnt the pin out already!

Use a 1K to start with...

BTW - driving an LED without a current limiting resistor is bad - stick something like a 330-470 ohm resistor between the LED and ground.

It would also be good if you posted your schematic; I can visualize what you are doing, but a drawing will ultimately help...

Sounds like you may have damaged the Transistor. I’ve had transistors be stuck “open” when I fried them, perhaps yours is somewhere in between functioning and fried? Try a new one (this time with the proper resistors), and let us know what happens.

Thanks for the replys!

LED - resistor -> never without ;-)

Base - Arduino resistor -> did it with and without, no change, but didn't know I had to use one, isn't the Base supposed to draw only very little power?

Transistor is fine, switched, and checked again with circuit one.

To picture it:

the circuits above show how to incorrectly wire a *NPN-Transistor*

Ha! Something important I forgot:

if I connect the Base (circuit 2) to GND directly, the LED turns off! So it seems that with higher voltages the Arduino Pin can't sink the pin enaugh. Although I have no idea whats keeping it from doing so...

P.s. the transistor datasheet says 5V for Base is fine and maximum Collector - Emitter Voltage is -40V so nothing there either.

Whats the value of those resistors? Is it a PNP or an NPN (like in your drawing)?

You cold try an additional diode or two in series with the base resistor, as a work-around. But the Arduino should be able to drop the voltage low enough to shut off that transistor, so something is odd here.

Oh btw (if it is NPN), swap the sides your LED and resistor is on the transistor. That is, from +9V to resistor and LED in series, then to collector. Then the emitter straight to GND. As it is connected now, the voltage over the LED and resistor will never be more than the output of the Arduino pin, minus about 0.7 V (base-emitter voltage drop). When you swap the sides, you will get almost 9V over the resistor and LED, so you might need to recalculate the resistor.

Of course this was very quickly and badly explained.. Maybe this little transistor intro will help a litle on the way: http://www.kpsec.freeuk.com/trancirc.htm in general the load connects between the collector and one of the supply rails (which one depends on PNP / NPN), for simple switching like this.

:-D it actualy is a PNP ... damn... since it worked vice versa I didn't check...

Thanks a lot! Problem solved, and just in 2:40h :-)

cheers!

Corrected circuit picture:

isn't the Base supposed to draw only very little power?

yea, that is why you use the resistor, cause the base and the emitter are connected, without the resistor you have a wide open shunt from your arduino pin to ground

the transistor datasheet says 5V for Base is fine

yea but most only take 0.7 volts to be saturated (switched on)

Uh ok we dont want to shortcut the arduino.

Funny thing I noticed: Three transistors connected Emitter to Base are actually sensitive enaugh, to show your heartbeat on a LED, by solely touching the Base-Pin... and holding very still since any movement near the circuit will make the LED flicker. The flickering is quite faint thaugh.. I wonder if it is possible to enhance the contrast.. maybe this circuit in a farraday cage, and just Base leaping out? Would make a totally awesome Valentine's Day/Christmas/Birthday gift :-)

transistors also amplify, there is a range in between when it starts to turn on and it is fully on, so you can take an analog signal, put it on the base, and modulate the emitter voltage, which amplifies the signal

start hooking up more and you increase the amps gain

What I meant was a way to increase differentiation, that say, during the heartbeat when the LED gets a little bit dimmer it goes a lot dimmer. If I increase sensitivity, I believe the LED will be always on or making it even less recognisable.

One PNP transistor ... I can switch to HIGH, LED goes on, LOW, off.

Aren't PNP transistors usually turned on by putting a LOW signal on their base? Driving a PNP transistor with a 9V supply from a 5V microprocessor is usually problematic since even 5V looks "low" to the 9V supply (this is why the simplest voltage-converting H-bridge circuit usually has six transistors rather than just 4.)

Aren't PNP transistors usually turned on by putting a LOW signal on their base? Driving a PNP transistor with a 9V supply from a 5V microprocessor is usually problematic since even 5V looks "low" to the 9V supply

Exactly.

So one should rather use NPN transistors then PNP?

Lets say I use a 50V supply, with a NPN transistor, so I apply 5V to the Base wouldn't I encounter the same problem? That for 50V, 5V isn't high enaugh?

Lets say I use a 50V supply, with a NPN transistor, so I apply 5V to the Base wouldn't I encounter the same problem? That for 50V, 5V isn't high enaugh?

In a common emitter circuit (grounded emitter) for a NPN transistor it's the emitter/base voltage (current really) that determines the emitter/collector current flow.

Bipolar transistors are current operated devices, the various voltage ratings are for device safety limits. You can't just apply 5vdc to a base emitter junction without damaging the transistor, one needs a series resistor between the base and it's voltage source to set the amount of base current, which then determines how much current can flow between the emitter and collector.

Lefty