Page 1 of 1

Transistor selection

Posted: Sat Feb 21, 2015 3:27 pm
by davef21370
This isn't strictly a Raspberry Pi question as the project is now using an Arduino Nano but I'm programming it through the Pi so fair's fair.
I've currently got the board flashing and flickering several LED's (separate pins) and it's working as expected. Now I want it to do the same with strings of LED's (I'm sacrificing some battery powered ones, the cheap Christmas type) so I figure I'll need to use a transistor.
I know the Nano will supply 5V at a max of 40mA and the LED's work on 4.5V at, let's say, 200mA (not measured but it's a figure).
The LED's will have a separate supply and I know I need some resistor between the Nano and the transistor's base.
Given the information I have how do I work out what spec of transistor I need and what value resistor?

I've been Googling a while now and still stumped, even the online calculators I've found need more info that I have so not lazy, just confused.

Dave.

Re: Transistor selection

Posted: Sat Feb 21, 2015 4:09 pm
by gregeric
I'd recommend you use a MOSFET instead of a junction transistor. Chosen correctly, it will work as a near perfect (negligable on-resistance), voltage driven switch. I use the IRL2203N which can be turned fully on even with 3V3 logic. I've controlled 12V LED strips drawing around 5A with this, and it barely gets warm, no heatsink required.

It will work without a resistor between the nano's output & the MOSFET gate, but I think it is more correct to use say 10k to limit the current when charging the tiny gate-source capacitance. You can also tiew the gate to ground with 10k so as to ensure the MOSFET is off, not floating, when the arduino is unpowered.

Re: Transistor selection

Posted: Sat Feb 21, 2015 4:18 pm
by davef21370
gregeric wrote:I'd recommend you use a MOSFET instead of a junction transistor.
I'm using PWM (980Hz max) to control the LED's, will a MOSFET be able to switch fast enough?

Re: Transistor selection

Posted: Sat Feb 21, 2015 4:22 pm
by gregeric
Yes.

Re: Transistor selection

Posted: Sat Feb 21, 2015 4:49 pm
by Tage
some examples of smaller size MOSFETs:
Si2302CDS, Si2312CDS, PMV16UN, DMG3414U, DMN2075U

there are dozens of similar parts that can be directly connected to 3.3V GPIO output pins and can drive several Amperes at relatively high switching frequency. Look for n-channel MOSFETs with Rdson specified at 2.5V. if you take a large MOSFET that has Rdson specified only at 4.5V you can probably use it at least at low current, but it has ten times larger gate capacitance and price.
if you use npn transistor you should look for a high gain transistor, and expect that you have to drive the base with 1/10 to 1/30 of the collector current to make the transistor turn on fully. this amount of current can be too much for the GPIO.
and forget Darlington transistors. they have too high power loss and are not really suited to be driven by 3.3V GPIO output.

Re: Transistor selection

Posted: Sat Feb 21, 2015 9:07 pm
by davef21370
Thanks all, I have a MOSFET knocking about somewhere (something 540) so I'll try that.

Dave.