Transistor is just not working

Thread Starter

Chukk

Joined Mar 13, 2021
7
Hello everybody,

I have a small question about transistors. I have a npn transistor (bc337). I have 5Volts on the emitter from an arduino. The base goes to a resistor (1k) and then to ground. The collector goes to a resistor (330) and then through a LED to ground. As far as I understood the ground connected to the base should get the electron flow going, so that the collector can light up the led (not conventional current). Is this wrong? This is driving me crazy.

I tried multiple transistors and checked every LED.
 

Papabravo

Joined Feb 24, 2006
21,159
You do have it wrong. You can't expect the transistor to work in that configuration. In order for an NPN transistor to turn on, the base terminal must at least 0.7 volts above the emitter. With +5v on the emitter, that can't possibly happen. With ground on the emitter, that can't possibly happen.

What are you actually trying to do?

Question: Can the Arduino supply enough current to turn the transistor on when the output is HIGH?
 

Thread Starter

Chukk

Joined Mar 13, 2021
7
As far as I understand, I am trying the same as in this image. I understood it this way, that the electrons can go through the base to the ground, when the button is pressed and this reduces the size of the p layer. Because of this the electrons can go through to the collector.

I am just trying to understand how I can use transistors. I want to light up the LED.
Untitled.png
 

djsfantasi

Joined Apr 11, 2010
9,156
When the button isn’t pressed, the base is “floating”, not connected to anything. To be sure the base is grounded in that case, you need another resistor. Like this...
C5B5CCAA-887A-42FA-A5F6-99A6EB5A3ED3.jpeg

If you’re controlling the transistor with an Arduino, the GPIO will connect either 5V or ground to the base, and you don’t need the additional resistor.
 

Thread Starter

Chukk

Joined Mar 13, 2021
7
Thanks for all your help. I actually have a BC327 and just tried it. It worked like I wanted it to. I'll try to wrap my head around it. I really thought I was describing the same as in the picture...
 

ElectricSpidey

Joined Dec 2, 2017
2,758
" As far as I understand, I am trying the same as in this image. I understood it this way, that the electrons can go through the base to the ground, when the button is pressed "

The only electrons going to ground in that circuit are from the battery.

Sounds like a little conventional vs electron current confusion.
 

Papabravo

Joined Feb 24, 2006
21,159
I'm recovering from a computer crash last night and it took me a while to make the following:
LED_Driver(2).png
This is a way, but certainly not the only way. I've given you the method for calculating the resistors to fix the currents to values that you might want. There is some considerable freedom to adjust these values for different LEDs and different current levels.
V1 is your power supply
V2 represents the Arduino driving source
R2 = (5.0 V - 0.7V)/2 mA = 2.15K Ω
R1 = (5.0 V - 1.93V)/20 mA = 153.5 Ω Choose 150 Ω as a "close" standard value. R1 could also be 155 Ω if you had one in stock.

Hope this helps
 
Last edited:

Thread Starter

Chukk

Joined Mar 13, 2021
7
I'm recovering from a computer crash last night and it took me a while to make the following:
View attachment 232663
This is a way, but certainly not the only way. I've given you the method for calculating the resistors to fix the currents to values that you might want. There is some considerable freedom to adjust these values for different LEDs and different current levels.
V1 is your power supply
V2 represents the Arduino driving source
R2 = (5.0 V - 0.7V)/2 mA = 2.15K Ω
R1 = (5.0 V - 1.93V)/20 mA = 153.5 Ω Choose 150 Ω as a "close" standard value. R1 could also be 155 Ω if you had one in stock.

Hope this helps
Thank you. This helps a lot.
 

BobTPH

Joined Jun 5, 2013
8,813
The circuit you described, if it worked, would have current flowing from an Arduino pin through the transistor then through the LED to ground. It would work, as others have stated, if you use a PNP transistor instead.

But what would be the point of it? It would work equally as well without the transistor. Just connect the LED anode to the Arduino pin and the cathode through a resistor to ground.

The reason for using a transistor is to increase the current capability. But your circuit does not do that. All of the current for the LED is still coming from the Arduino pin.

With the PNP, connect the emitter to +5V, the base, through a resistor, to the Arduino pin, and the collector, through a resistor and the LED to ground. Now you get current amplification.

Bob
 

Papabravo

Joined Feb 24, 2006
21,159
The circuit you described, if it worked, would have current flowing from an Arduino pin through the transistor then through the LED to ground. It would work, as others have stated, if you use a PNP transistor instead.

But what would be the point of it? It would work equally as well without the transistor. Just connect the LED anode to the Arduino pin and the cathode through a resistor to ground.

The reason for using a transistor is to increase the current capability. But your circuit does not do that. All of the current for the LED is still coming from the Arduino pin.

With the PNP, connect the emitter to +5V, the base, through a resistor, to the Arduino pin, and the collector, through a resistor and the LED to ground. Now you get current amplification.

Bob
Usually in switching applications you drive the transistor hard into saturation, forcing the current gain β, to be much less than it would be if the transistor was operating in the linear range.
 

crutschow

Joined Mar 14, 2008
34,285
When thinking about current, either use conventional current flow (positive to negative) or electron flow (negative to positive).
If you try to think about both, you will just confuse yourself.
Stick to one convention and ignore the other (it makes no difference which you select unless you are dealing with tubes).

I personally prefer current flow, since it flows in the direction of the arrows for diodes and bipolar transistors.
Thus forward-bias for these devices is always in the direction of the arrows, and reverse-bias is opposite the arrow direction.
 

Thread Starter

Chukk

Joined Mar 13, 2021
7
So I just tried the whole thing again and it still won't work. I attached two images. One for the actual circuit (yellow is 5V and blue is going to GND on the arduino) and one simulation where everything works. The transistor is still a bc377 (NPN) in my arduino circuit. I realize I am missing some basic knowledge in this topic, so I will try some easier stuff the next time. But if someone want's to point out why it works in the simulation but not in my circuit, I think that would be pretty helpful.


(I forgot to remove the red LED on the right side of the picture, but without it nothing changes)
 

Attachments

Last edited:

psoke0

Joined Mar 31, 2017
196
So I just tried the whole thing again and it still won't work. I attached two images. One for the actual circuit (yellow is 5V and blue is going to GND on the arduino) and one simulation where everything works. The transistor is still a bc377 (NPN) in my arduino circuit. I realize I am missing some basic knowledge in this topic, so I will try some easier stuff the next time. But if someone want's to point out why it works in the simulation but not in my circuit, I think that would be pretty helpful.


(I forgot to remove the red LED on the right side of the picture, but without it nothing changes)
you just connected 5v of arduino to Emitter of the transistor again that wont work
 

psoke0

Joined Mar 31, 2017
196
Soo the electrons actualy come from the GND and not from the 5V on the arduino?
electrons does come from negative side but i dont suggest you think that way. think like electrons come from positive side. like crutschow said.

When thinking about current, either use conventional current flow (positive to negative) or electron flow (negative to positive).
If you try to think about both, you will just confuse yourself.
Stick to one convention and ignore the other (it makes no difference which you select unless you are dealing with tubes).

I personally prefer current flow, since it flows in the direction of the arrows for diodes and bipolar transistors.
Thus forward-bias for these devices is always in the direction of the arrows, and reverse-bias is opposite the arrow direction.
 
Top