# Basic Transistor question - Transistor is not allowing enough current through

Hello,

For my project I need to power a .3W LED with an Arduino pin. I am powering this LED with a 2n2222 transistor with the collector connected to a 6v battery (the battery is also powering the Arduino) and the base to a digital pinout of the Arduino with a 330ohm resistor. The problem I am having is that the LED is significantly dimmer when controlling the base pin of the transistor with the Arduino than with the battery power.

I am not to familiar with transistors but I though the gain was dependent on the current not on voltage. So the transmittor should be fully saturated and allow almost all current through just by the current provided by the Arduino Digital Pin. Where did I go wrong in my assumptions?

Thanks!

I got turned on to this doc recently. It's an 'op-amp-101' type of text, and also includes snippets of prerequisites. Transistors are covered in only a few pages, but here's the calculation you need.

Section 2.7 Calculation of a Saturated Transistor Circuit

http://www.ti.com/lit/an/slod006b/slod006b.pdf

You are not connected properly for an NPN transistor.
6V to anode, cathode to current lmit resistor, resistor to collector, emitter to Gnd.

0.3W - how much current? N-channel MOSFET probably a better choice, will run much cooler.
Logic Level, low Rds, low Gate Capacitance:

serg10:
Hello,

For my project I need to power a .3W LED with an Arduino pin. I am powering this LED with a 2n2222 transistor with the collector connected to a 6v battery (the battery is also powering the Arduino) and the base to a digital pinout of the Arduino with a 330ohm resistor. The problem I am having is that the LED is significantly dimmer when controlling the base pin of the transistor with the Arduino than with the battery power.

You have the transistor in the wrong place, it needs to go below the LED with the emitter connected to GND.

Reason: The transistor emitter needs to be a 0V compared to the Arduino pin. When it's above the emitter you don't know what voltage it's at.

jbarchuk:
I got turned on to this doc recently. It's an 'op-amp-101' type of text, and also includes snippets of prerequisites. Transistors are covered in only a few pages, but here's the calculation you need.

Section 2.7 Calculation of a Saturated Transistor Circuit

http://www.ti.com/lit/an/slod006b/slod006b.pdf

That's an awsome doc. It looks very informative. Thanks!

jbarchuk:
I got turned on to this doc recently. It's an 'op-amp-101' type of text, and also includes snippets of prerequisites. Transistors are covered in only a few pages, but here's the calculation you need.

Section 2.7 Calculation of a Saturated Transistor Circuit

http://www.ti.com/lit/an/slod006b/slod006b.pdf

464 pages...ouch!

The best page to learn about transistors (IMHO) is this one:

http://www.mcmanis.com/chuck/robotics/tutorial/h-bridge/bjt_theory.html

I fixed the connection to the transistor but I still can't get full power from the Arduino pin. The transistor is only allowing 18 mA when I connect the base to the digital output of the Arduino but it allows about 90mA when the base is connected to 6+ volts.

Fungus:
Ah that makes sense, Thanks! However, I'm still not getting all the current through the resistor. Ideally, I just want it to act as an off & on switch.

What value is the base resistor?
330? You can drop that a bunch, 120 about the lowest to avoid overstressing the Arduino pin.

FIXED IT! It turns out that I was calling accidentally PWM my base pin.

Thanks for all the help guys. I learned more about transistors and I have some reading to do

What value were you using for PWM?

What value were you using for PWM?

...and how can you "accidentally" PWM a pin?

Actually, cross that. I got over exited and thought it was PWM. For some reason the Digital Pin on the arduino was only sourcing .8volts when under load. Odd thing is I'm using 4 AAA batteries which source over 1A and the ardunio with the LED on is using 65 mA.

fungus:

What value were you using for PWM?

...and how can you "accidentally" PWM a pin?

I though I was becouse kept calling DigitalWrite and when I ran the Blink code the light lit up all the way to full brightness. I was wrong and that is not the case though.

For some reason the Digital Pin on the arduino was only sourcing .8volts when under load.

That sounds like a missing
pinMode (pinX, OUTPUT );

Or, the pin is really overloaded for sourcing current.
Or, the transistor is miswired.

Without a schematic, I can't comment.