# Transistor with arduino

Hey guys, so I have been using transistors with by Arduino to test them out, however I have a few questions about them.

First of all, I don't know which resistor to use at the base, for now I have been using 3.3k and 1k ohm resistors, but I don't know if the fully turns on the transistor. Is their some kind of formula/equation for how much current I need to apple to apply to the base of a transistor and what resistor to use.

If somebody could explain to me a little more about this part of transistors and the equation used, that would be great

By the way, I am using the 2N3904 NPN Transistor from farchield semiconductors
Data sheet:
http://www.fairchildsemi.com/ds/2N/2N3904.pdf

Thanks so much

I write a tutorial in french in the forum french section :

If you don't read french you can read graphics and formulas Basically you want a switch to saturate, for a high current transistor you'll need
something like 0.05 to 0.1 times the collector current into the base to fully saturate.

For a small signal transistor or a super-beta device perhaps 0.02 times Ic is enough.

Remember an Arduino pin has an absolute maximum rating of 40mA, which means
don't try pulling more than 25 to 30mA from it (this will be the limiting factor with
power transistors unless you use Darlington or logic-level MOSFETs)

jakewest:
First of all, I don't know which resistor to use at the base, for now I have been using 3.3k and 1k ohm resistors, but I don't know if the fully turns on the transistor. Is their some kind of formula/equation for how much current I need to apple to apply to the base of a transistor and what resistor to use.

The resistor is mainly there to stop more than 40mA coming out of the Arduino pin.

If you want a value that "just works" use 220 Ohm. 220 Ohm lets approx 18mA out of the pin and that will saturate just about any common BJT.

If you're designing for batteries and every excess milliamp counts then you need to look at the value for gain (or "beta") in the transistor's datasheet and calculate it precisely.