I believe that i should hook up the digital output to the gate or the base of the transistor then take the output from the drain or the collector of the transistor, could anyone tell me if this is correct and if so how much will the transistor increase the current if 5v is used at the collector of the transistor, thanks
well im trying to drive multiple leds off of one digital output from the arduino board and i need to up the amps to supply enough current to the leds to light up and i figured the best way to do that is using a transistor.
i need to up the amps to supply enough current to the leds to light up and i figured the best way to do that is using a transistor.
You should understand that a transistor can't 'up the amps'. A transistor can only be used to control current, the power supply has to already have the current capacity and voltage value that you require for your load(s). A transistor can allow controlling a voltage and current that would be too high for an Arduino output pin to safely supply directly.
How many LEDs? And do you have access to a higher voltage?
If you have access to 12V, you can put 4 or 5 LEDs in series with a current limit resistor and drive them all at once - the LEDs & resistor would go in place of the motor in the first picture above.
If you are limited to 3.3 or 5V, then the LEDs need to go in parallel, ideally each with their own resistors, again in place of the motor above. (3.3 may not drive 2 LEDs in series, 5V would).
The resistor between the Arduino pin and the base of the resistor is important - other wise the pin is not limited to how much current it can supply and you can fry it (and possibly the ATMega chip as well).
If you have a MOSFET transistor such as IRF3707Z (international rectifier) I believe you can drive the Gate directly from an Arduino pin as it uses Voltage to control the switching, another benefit is it has very low resistance between D and S.
(I have a tube of these at home, I should play some and see what kind of performance it has with LEDs in different configurations & voltages. Bought them to use in place of some IR630s that came in a Radio Shack experimant/lab kit I got for my son).
Another option is to use a Logic chip, the 7406. It has 6 open collector outputs.
For each output: wire your source voltage to the LEDs in series to the current limit resistor to the output pin of the the 7406. Then when you write a 1 to the input pin, the output goes low & turns on the LEDs. It is an open collector output so it looks just like the transistor in the example above.
I am using one of these to drive 6 sets of LEDs. 2 of the sets are sourced from 12V and have 4 columns of 5 LEDs/resistor in parallel (20 LEDs total). I load a register to drive the 7406 so I don't have 6 pins tied up.
They will sink 40mA, and the output can work with a source voltage of up to 30V. http://focus.ti.com/lit/ds/symlink/sn7406.pdf
Lot more convenient than dealing with 6 transistors & current limit resistors, fits all the functionality into a nice 14 pin package thats easy to work with.
My "local" supplier (35 minute drive) had them in stock. Too bad I can't find an octal version, would be great 7 segment+DP displays so any combination of display could be created (vs say a 7446/7447/7448/7449 family) to make things that look like letters in your code.