what resister values to use with a transister NOT gate?

I am planning on setting up a not gate with a bc547 npn transister? (the lettering on it actually says "BC 5478 K6 E"). I was looking around and one website said most gates can only handle 20mA of current, and I plan on using 5v power from arduino, so 5v/.02= 250 ohm, so the resister value should be around 250 ohms right? Sorry I am new and I am just making sure I understand whats going on. But the design says it should have 2 resisters, so I am confused.

EDIT: it looks like the max rating says 100ma, so at least a 50 ohm resister?

Heres a photo of the design I want to make: http://www.waitingforfriday.com/index.php/File:Slide12.PNG

You need a collector resistor to control the current through the transistor. Do not run it at 100% (20ma) so suggest you use a 1k in the collector circuit. The second resistor is to control base current. I suggest you use a 10k in that location. This should feed enough base current to ensure full saturation of the transistor (ie turn it fully on).

I was looking around and one website said most gates can only handle 20mA of current,

I think you are misunderstanding the word 'handle' here.

For that circuit use 1K in the collector and 10K in the base, it will be fine.

ok, so the resister next to IN is 10k, and the other is 1k? and how did you come up with those numbers so I can do it by myself for the future :slight_smile:

First, you shouldn't need a logic inverter on the Arduino output (or input). You can invert the state in software... :wink:

And, when you need an inverter, it's more common to use an inverter chip (or other gate wired as an inverter) than to use a transistor. The [u]7404[/u] (and 74LS04, etc.) is the "original" inverter chip.

OK....
250 Ohms is OK for the base resistor (1k would probably work too). The resistors depends on how much current you need out of the circuit.

...one website said most gates can only handle 20mA of current,

That's probably a good rule-of-thumb for a logic chip. The Arduino is rated for 40mA maximum. If you look at the transistor's datasheet, I'm sure it can handle more. (And, you should check the datasheet before you use a logic chip.)

The way a transistor works as a "switch" is that it has current gain, and you want to "saturate" the transistor so the calculated collector-emitter current is more than the current allowed by the collector-resistor. A typical transistor has a gain (hfe) of around 100.

  • Let's say we have a 50 Ohm "load" (or a 50 Ohm collector resistor). At 5V, that's 100mA.

  • If the transistor has a current gain of 100, you need 1mA into the transistor's base. That's 5k Ohms.

  • Since we want to be darn-sure to saturate the transistor, it's a good idea to cut the base resistance in half.

  • With a 2.5k base resistor, the we can be sure the transistor will remain saturated with loads of 50 Ohms or more (collector current of 100mA or less).

thank you!

Well I looked at it like this.
1K and 5V gives you 5mA current down the collector.
10K and 5V gives you 0.5mA through the base.
So the minimum gain the transistor needs is 5 / 0.5 or 10
Any transistor worth it's salt can manage a gain of 10, most small signal transistors have a gain of 100 or so. Therefore it will be fully saturated.

You do not need the currents that DVDdoug is suggesting, in fact that will only make the transistor slower to switch.