0
\$\begingroup\$

I have a small LED of 5mm and an arduino powered by 9V. When I connect the LED to Vin (9V) using a 330 ohm resistor the LED brights very high. When I connect the LED to 5V (from arduino) using a 330 ohm resistor the LED brights very low.

Ok, that's supposed to happen.

Now I use a transistor 2n222 to power the LED. The problem is that if I use 5V or 9V (Vin) to power the LED it gets the same brightness. In the base I am using a digital pin sending HIGH.

Why does the transistor does not allow my LED to get brighter when the collector is connected to 9V source power?

\$\endgroup\$
3
  • \$\begingroup\$ Are you connecting the LED to the collector or the emitter of the transistor? \$\endgroup\$
    – Roger C.
    Commented Nov 28, 2014 at 14:33
  • 3
    \$\begingroup\$ Maybe add a schematic to show how you connected it up. Sometimes things are missed with words that a schematic can easily clear up. If you press CTRL+M while editing your question, a schemetic drawing tool should open up for you. \$\endgroup\$
    – efox29
    Commented Nov 28, 2014 at 14:35
  • \$\begingroup\$ +1 for a schematic. We need to know the value of the base resistor. \$\endgroup\$ Commented Nov 28, 2014 at 15:07

3 Answers 3

1
\$\begingroup\$

Why does the transistor does not allow my LED to get brighter when the collector is connected to 9V source power?

That's your problem - the collector is connected to the power source - you are using it as an emitter follower - the brightness will be totally governed by the base voltage from the arduino. Try operating it as common emitter with a 4k7 base resistor: -

enter image description here

R1 = 330R or possibly a bit less to produce desired current thru LED

R2 - try 4k7

\$\endgroup\$
2
  • \$\begingroup\$ Thank you Andy. Just one final question: if I connect my LED as you said, can I say "Voltage consumed by LED + voltage consumed by Resistor = external power source"? Or the transistor will also use 0.7 V of my external power source? \$\endgroup\$
    – Samul
    Commented Nov 29, 2014 at 22:20
  • \$\begingroup\$ The transistor will drop about 0.1 volts because it now operates into its saturation region. \$\endgroup\$
    – Andy aka
    Commented Nov 30, 2014 at 0:51
1
\$\begingroup\$

When you use 9V with the 330 ohm resistor, your LED has 27mA passing through. When you use 5V the current is 15mA.

What Tom says above, if you connected the LED on the emitter in series with the 330 ohm resistor, the base's 5V drops to 3.8V across the resistor (-0.6 on the B-E of the transistor and -0.6 on the LED itself) so that would drop your current for the LED to 11mA which is less than what you had when the LED was directly connected (in series with the 330 ohms resistor) to 5V.

\$\endgroup\$
4
  • \$\begingroup\$ Thank you but why will the base's voltage be applied to the LED? Why the higher, 9 V external power source, will not be applied to the LED? As you say, can I assume that all the current used by the LED come from the base and not from the collector? \$\endgroup\$
    – Samul
    Commented Nov 29, 2014 at 22:22
  • \$\begingroup\$ The base voltage will be 5V. For the transistor to turn on, the Emitter has to be 0.6 or 0.7V lower than the base voltage on NPN transistors. This means the transistor will have 4.3-4.4V on the emitter regardless of the Vin. If it would be any higher, the transistor would be off. \$\endgroup\$
    – dscharge
    Commented Nov 30, 2014 at 10:32
  • \$\begingroup\$ And no, the current comes from the collector, this is how transistors work. The voltage is set by the base and the current is from the collector but since the voltage is base regulated the current passing through from the collector to the emitter is depending on the base voltage. \$\endgroup\$
    – dscharge
    Commented Nov 30, 2014 at 15:09
  • \$\begingroup\$ nice, finally I got it, thank you you made it very clear! \$\endgroup\$
    – Samul
    Commented Dec 1, 2014 at 1:10
0
\$\begingroup\$

It is hard to tell without knowing what you did exactly. And I am assuming that you mean a 2N2222 transistor (or any other NPN type).

You should (from + to -) have: "+", resistor, LED, transistor (C and E) and "-". The base of the transistor would be connected to the controller (normally via a resistor like 1-2 kOhms).

Note that the emitter of the transistor would be connected to "-".

If you have "+", transistor (C-E), LED, resistor, then there is a problem. The base voltage on the transistor must be 0.6 Volts higher that the emitter voltage. With a (suspected) output voltage of 5 V on you controller, that would leave you with 5 - 0.6 = 4.4 volts for LED and resistor, no matter what your supply voltage is.

Of course the order of LED and resistor is of no importance.

\$\endgroup\$
1
  • \$\begingroup\$ that's amazing! I understood every word! I just still dont know why is it wrong to connect the LED after the transistor goind to the ground. Why the voltage will be 4.4 and not 9 (my external source power)? \$\endgroup\$
    – Samul
    Commented Nov 29, 2014 at 22:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.