I ran into a problem where the transistor passes through the collector and the emitter from me just connecting that base to pretty much, anything?
I made a 9 minute video of my project here and what problem I ran into with transistors.
If you'd like to skip me showing the project you can jump to the problem at minute 5.
I'm using the BC337 transistor (NPN). When I google BC337 I found out the Base can handle max 5V, so that shouldn't be a problem?
I'm powering my project through a 9V 0.65A adapter, which goes through a power module to bring 5V.
AFAIK the current I want to pass through the transistor is 5V but with a really low ampere.
I believe the Arduino UNO code "pinMode Output" and then set to "HIGH" sends 5V.
If you could help me figure this out and teach me more about transistors I would appriciate it very much!
When I google BC337 I found out the Base can handle max 5V, so that shouldn't be a problem?
You will find that is the voltage "Veb" breakdown voltage, which is the reverse bias breakdown voltage.
The forward voltage which you do to bias the transistor ON is about 0.6 to 0.7V, and you have to use a base series resistor to limit the current into the base.
Do you know [u]Ohm's Law[/u]? We need Ohm's Law to calculate (or estimate) the required resistance.
Do you know how much current you need through the transistor?
Transistors vary from part-to-part, but in a switching circuit we want to saturate the transistor ("jam it on hard") so we don't need to make perfect calculations.... We can do lots of estimation/approximation...
Transistors are current amplifiers.* The current gain of a transistor is called it's Beta and it uses the symbol HFE. I didn't check the datasheet for the BC337, but a beta of 100 is typical so let's assume that.
When the transistor is saturated something else is limiting the current (a motor or relay coil or whatever the transistor is powering. So it's no longer operating as a "linear" current amplifier.... More current into the base doesn't make more current through the emitter-collector.
For example, let's say you need 1/2 an Amp (500mA) through the transistor. With a Beta of 100, you'll need 5mA into the base. (That current gets summed with the collector-emitter current so you'd have 505mA coming out of the emitter.)
Since the base-emitter voltage is about 0.7V (when the transistor is on), we'll just assume it's zero and we'll assume the full 5V is dropped across the base resistor.
We know we have 5V and we want at least 5mA so Ohm's Law says we need 1K Ohm. Since we want to be darn sure that we saturate the transistor we should use a resistor between 1/10th and 1/2 that calculation. Something around 200 Ohms would be great. (We can't go below 125 Ohms because the "Absolute Maximum" current allowed from an Arduino pin is 40 mA.)
We can make voltage amplifiers with transistors (which is often what we want) but transistors fundamentally operate as current amplifiers.
You will find that is the voltage "Veb" breakdown voltage, which is the reverse bias breakdown voltage.
The forward voltage which you do to bias the transistor ON is about 0.6 to 0.7V, and you have to use a base series resistor to limit the current into the base.
Tom...
Hey Tom and thank you for your help!
I tried to make a breadboard schematics, does this help?
How do I know if I have a base series resistor? I got this bag, do you think one of these will do?
DVDdoug:
I didn't look at your links...
Do you know [u]Ohm's Law[/u]? We need Ohm's Law to calculate (or estimate) the required resistance.
Do you know how much current you need through the transistor?
Transistors vary from part-to-part, but in a switching circuit we want to saturate the transistor ("jam it on hard") so we don't need to make perfect calculations.... We can do lots of estimation/approximation...
Transistors are current amplifiers.* The current gain of a transistor is called it's Beta and it uses the symbol HFE. I didn't check the datasheet for the BC337, but a beta of 100 is typical so let's assume that.
When the transistor is saturated something else is limiting the current (a motor or relay coil or whatever the transistor is powering. So it's no longer operating as a "linear" current amplifier.... More current into the base doesn't make more current through the emitter-collector.
For example, let's say you need 1/2 an Amp (500mA) through the transistor. With a Beta of 100, you'll need 5mA into the base. (That current gets summed with the collector-emitter current so you'd have 505mA coming out of the emitter.)
Since the base-emitter voltage is about 0.7V (when the transistor is on), we'll just assume it's zero and we'll assume the full 5V is dropped across the base resistor.
We know we have 5V and we want at least 5mA so Ohm's Law says we need 1K Ohm. Since we want to be darn sure that we saturate the transistor we should use a resistor between 1/10th and 1/2 that calculation. Something around 200 Ohms would be great. (We can't go below 125 Ohms because the "Absolute Maximum" current allowed from an Arduino pin is 40 mA.)
We can make voltage amplifiers with transistors (which is often what we want) but transistors fundamentally operate as current amplifiers.
I got a multimeter. Is there any chance I can use it to figure out what kind of transistor I need by measuring between the ground and the button on the game-pad?
I'm a true beginner when it comes to electronics, so I'm very unknowledgeble about how to measure current. I think it might be 0.25A~, but it might also be 0.25A split between 8 buttons?
I measured over A and D I got 5V. But when I measure between D and the button I get barely any reading.
The NES game-pad has the TC4021BP chip, which the buttons and the 5 cord-wires are run through. I guess the voltage is changed within the chip.
In the youtube video I watched they had the CD4021BP, but I guess they're very similar. The CD was explained like this:
So I guess what I'm trying to figure out here is what ampere (current) I have between the chip pin 8 (the Vss, ground) and pin 15 (the PI7, the B button on the controller). How can I do that?
--edit--
I forgot to mention that I tried adding a 200Ohm resistor on the emittor of the transistor, but there was no change in how it worked.
What I confuses me the most is that the Arduino doesn't even have to be powered on. When I connect the base of the transistor it starts to pass through the collector and emitter undependant on if I have power in the Arduino or not, even less if I send on the output pin or not. But when I disconnect the base wire, it simply stops passing through the transistor. This is incredible confusing.
--update--
It seems the breadboard/arduino is grounded even tough I turn the power off. But when I disconnect the adapter entirely, this fenomenon stops occuring. So apparently, it's enough to connect the base pin to GROUND to trigger the transistor. Is that really supposed to happen??
Hey again Tom and thanks once again for helping out!
I'm a little bit confused so I remade your schematics to look like what I have:
I'm no longer certain that the Ic is 5V. The chip in the NES controller is supplied with 5V, I can measure that. But the output from the chip I'm using (button B), seems to be much lower? I tried to measure it with my multimeter but I couldn't figure out how to do it.
How do you know that Ib goes from 5V to 0.7V with a 10K resistor? Ohm law? So we're assuming that the current is 0.7/10.000 = 5mA? Or is that common knowledge of how the Arduino UNO works?
Hi,
Okay, you need to connect a DMM in DC volts mode to the two wires that you want to connect together when they are open, and mark which is positive and which is negative.
This is important if you are going to use a transistor to connect them together.
NOTE the connection from the transistor Emitter to the UNO gnd is essential to provide base current to make the transistor conduct Collector to Emitter.
When the UNO output goes HIGH, 5V, the transistor conducts.
The current gain of a transistor is nothing to do with saturation ("jamming it on hard"). For that
you need the base current to be 5 to 15% of the collector current. Normal transistor operation
doesn't apply to saturation as the base-collector junction needs to be reverse biased for normal
transistor operation, and its forward biased in saturation.
Soft saturation can be achieved where the base and collector are about the same voltage with not
much more base current than the gain figure suggests, but if you want 0.1 V or less across emitter/collector,
you need much more base current (its a trade off in power saved in the main circuit v. extra
power in the base circuit).
So for instance if you want 0.1A emitter/collector, use 10mA base current.
I'm still a bit confused about "current". I do not understand how much current the Arduino UNO outputs to the Base, and I don't know how I could measure it.
But I got the transistor working! I think the biggest issue was that I didn't share ground between the two power sources.