Why transistor makes led less bright

Hi,

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?

Were you using 9V---led---330---Arduinou O/P?
If so don't!

Can you show us your schematic of how the transistor is wired?

The voltage on the emitter of your transistor will not get any higher than the voltage on the base. Since the voltage on the base will never go above 5v, neither will your emitter. In fact it's probably got about 0.7v drop compared to the base.

In the base I am using a digital pin sending HIGH

uh-oh ... no base resistor?

You wire things up like this.
Output pin to 1K resistor, other side of resistor to the base.
Emitter to ground.
Collector to your 330R resistor.
Other end of the resistor to cathode of the LED.
Anode of the LED to the +9V.
Ground of the 9V source ( -Ve terminal ) to Arduino ground.

Hi,
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png or pdf?

Tom..... :slight_smile:

Your wiring should be like this. Plug in specifics for your parts.

Resistors in line with LEDs LEDs

Base emitter question - that is the way transistors work. Take a degree in solid state physics and then you will understand why otherwise accept that is how they work.

gilperon:
Thank you grumpy. I cannot afford a degree in physics. I dont want to understand how it works, but how can I know the voltage in the emitter. Will it always be the collector emitter? The base? Or the smallest one? Which rule should I take?

Do you want to try that again only this time with words that make sense.

Simple rule for you

a) If your load is between the supply line and the collector then the voltage across the load can be as high as (supply line - 0.7 volts) So for a 9V supply, it could be around 8.3V

b) If your load is between emitter and ground then the voltage across the load will be almost the same as the base voltage. So if the base is at 5 volts the load will be about 5 volts.

a) If your load is between the supply line and the collector then the voltage across the load can be as high as (supply line - 0.7 volts) So for a 9V supply, it could be around 8.3V

b) If your load is between emitter and ground then the voltage across the load will be almost the same as the base voltage. So if the base is at 5 volts the load will be about 5 volts.

Eeeeps . . .

a) “(supply line - 0.7 volts)”: No. For a well designed circuit Vce would be around 0.2 V

b) “almost the same as the base voltage”: No. Emmiter voltage would be around base voltage less Vbe voltage, around 0,7 Volts.

Regards

You forgot the word "simple'
Technically I may well be incorrect but it was the principle, for the benefit of the OP, that I was endeavouring to convey.

the transistor 'sees' the base current and then 'closes' the circuit.

this signal goes to ground. there is no limit on the base to ground, so your output pin is basically going to ground. the limiting resistor is selected by calculating what current is needed to fully close the circuit. this is called driving the transistor into saturation. and additional current is shunted to ground,

the limiting resistor provides the needed current to saturate the transistor and limits the current being dumped through you output pin.

simply put you need to learn about the devices you are using. ESPECIALLY the fundamentals.

first you say

gilperon:
Thank you all! I am starting to understand it.

But then you say

I assume that arduino pin will be the one suplying energy to the motor, isnt?

No comment :slight_smile:

You are mixing up voltage (electrical potential) with current.

The Arduino pin will provide current to the base of the transistor in order to saturate the transistor and close the circuit between the collector and emitter.

Any current flowing OUT of the Arduino pin will be used to activate the transistor, up to a certain limit, which depends on the specific transistor you are using. All the current in excess to that needed to turn on (saturate) the transistor will be sent down into the emitter. If your motor is wired between the emitter and ground than that current will contribute to spin your motor. If you don't have a resistor between the Arduino pin and the transistor then your Arduino pin will be practically short circuited (well, there is an internal resistence in the transistor, but it is very low) to ground and die as a consequence.

The collector (or any other pin for what matters) voltage doesn't "flow" anywhere, voltage do not "go", what "goes" in a circuit is current. ANd current "goes" proportionally to circuit resistivity and "toward" (please, do not comment about electron flow on this, it will confuse the OP) the lower voltage or electrical potential.

I see you have changed from LED to motor.

If you want the motor to operate it at more than 5 volts you connect 9v ---motor--- collector
Remember to put a reverse biased diode across the motor

If you want motor to operate at less than 5 volts then you can connect emitter ---motor--- ground

@OP
You may want to face your limiations.
You really have to stop, take a breath then go to a few internet sites where they cover basic electricity and then onto basic electronics.
Also take a look on YouTube.

I am sure with some grounding in the "basics" will you be able to continue with your future projects.

If you don't limit the current to the base (ie directly connected) it will consume all you give it and blow (reason why it never is due to the 40ma constraint) the current will simply travel from base into the emitter...

If your arduino/ pin still works?

Connect a 1k to the base pin, if the LED fails the transistor or arduino cooked.

@OP
You may want to face your limiations.
You really have to stop, take a breath then go to a few internet sites where they cover basic electricity and then onto basic electronics.
Also take a look on YouTube.

I am sure with some grounding in the "basics" will you be able to continue with your future projects.

The best advice in the whole thread.

Best regards.

But that is a bit like saying "Don't go into the water until you know how to swim"

Half the fun of electronics is experimentation to "find out why". Yes you'll probably destroy a few things along the way but you'll also learn fast. (I speak from almost 60 years of personal experience and who knows how large a pile of mis-guided destruction)