Use transistor to control 12v LEDs, schematic help needed

Hi!
I’m new to Arduino (Haven’t actually gotten it yet, but it’s on it’s way) and i’m about to prepare for a project.
I’ve been developing app for all kinds of platforms for year (Windows, Android/Linus, iOS, web)
but I’m having problem with the electronics.
I friend of mine loves LEDs. He got them all over his car, but now he’s getting tired of having several controll-units
and not being able to sync all the lights.
So i want to make him a new unit, where he can connect lights and switch between patterns.

So, the idea is that each set of LEDs will be connected via a transistor (I’ve been looking at the tip122) so I can control them via the Arduino. I’ve been a simple schematic, but I’m not sure the i’ve done the math right.
I’m not even sure that the Arduino can control, lets say 6x tip122 at the same time.
If not, can i use something like a 2N2222 to control the TiP122 and let my Arduino control the 2N2222?
That would have to be one 2N2222 per TiP122 of course.

I’ve attached an image of the schematic and the math.
If you have any questions or tips/ideas on how to make it better. Please don’t hesitate to reply :slight_smile:

Thanks in advance

That maths is wrong. The base current will be 5v the output voltage of the arduino, minus 0.7Vthe voltage across the base of a transistor divided by the value of R1. Hfe is the current gain you get from the data sheet.

Collector to emitter current is Hfe times the base current. Power dissaapated in the transistor is the saturation voltage in the data sheet, times the collector emitter current.

Thanks for the fast reply :) hm, i see. Can you help me with the math? :) This is some of the info from the Tip122 data sheet:

Transistor Polarity: NPN

Voltage(Vceo): 100V

Power(Pd): 2W

Collector Current: 5A

DC Current Gain(hFE): 1000

Package Type: TO-220

Pins: 3

Power Consumption: 2W

Device Marking: TIP122

Package Type: TO-220

Total Power(Ptot): 65W

Transistor Count: 1

Transistor Type: Darlington

Maximum Continuous Current(Ic): 5A

Full Power Temperature: 25 ° C

Voltage(Vcbo): 100V

Current(Ic hFE): 3A

Current(Ic Max): 5A

DC Current Gain(hfe minimum): 1000

Surface Mount Devices: Through Hole

Collector current: 5A

Saturation Voltage(Vce sat max): 2V

Thanks

Yes, you can control 6 x TIP122 from an Arduino at the same time. You don't need to use a 2N2222 to drive it. But it would be helpful if you can tell us how much current each set of LEDs take, so that we can assess whether the TIP122 is a good solution or not.

Thanks for that info :) I'm not sure, but i don't think it's as much so it would overload 6 5A transistors. It's 4x 48 LED 3528 SMD light in the back, and 4x on the front. Also a few led strips (maybe 2x 6.6w in the front and 2x in the back) and 2x M20372BCL (3 LED Strobe @ 0.2A each)

I don't know if that info is helpful to you, but that's all i know for now.

I wouldn't use a TIP122 to control more than about 1A, because if you do it will get hot and need a heatsink. Just because it is rated at 5A doesn't mean it is good for switching that amount of current. At 5A it will have a voltage drop of up to 4V and dissipate up to 20W.

Unless you know that the current per set of LEDs will be 1A or less, I suggest you use logic level mosfets instead.

Oh, okay. So, like a IRFZ44? I can use pwm with a mosfet as well, right?

IRFZ44 is not a logic-level mosfet, so not suitable for driving direct from an Arduino pin. But there are many to choose from, for example FQP30N06L or RFP30N06LE.

Yes, you can PWM with a mosfet.

Okay, thanks. What's the different between logic level and non logic level?

Also, what value of resistor do i need for the gate?

What’s the different between logic level and non logic level?

A logic level FET will turn on fully with 5V where as FETs normally need 10V to turn them on fully. It is in the data sheet, it is not the gate threshold voltage but the gate voltage quoted for the Rds value.

what value of resistor do i need for the gate?

It is needed for keeping the peak current within limits from the Arduino. Use 100R.

Thanks for clearing that up for me :)

Okay, so 100 Ohm between Arduino and the gate, and then i need 100k Ohm between the gate and ground, right? I read this on a yt video:

put a 100k resistor between gate and ground if you want your FET to stay off by default!

Yes. Anything in the range 10K to 100K will do. The purpose of the resistor is to ensure that after power up, the mosfet stays off until the pinMode call has been made.

and then i need 100k Ohm between the gate and ground, right?

you can but I don't bother. Make it 10K rather than 100K to be a bit more immune to noise.

Grumpy_Mike:

and then i need 100k Ohm between the gate and ground, right?

you can but I don’t bother. Make it 10K rather than 100K to be a bit more immune to noise.

dc42:
Yes. Anything in the range 10K to 100K will do. The purpose of the resistor is to ensure that after power up, the mosfet stays off until the pinMode call has been made.

Thanks you both :slight_smile:
How dose my schematic look now? :slight_smile:

schematic1.png

How dose my schematic look now?

Looks fine.

Thanks for everyones help :)

Don't we need a resistor between the ground and emitter or collector and 12 V to control the current through LEDs?

A mosfet don't have a emitter or collector, it has a source and a drain. But it's basically the same thing. But no, i don't think so. You control the current via the voltage on the base (transistor)/Gate (mosfet) Because they are variable resistors, and the resistant is change via the Base/Gate.

That's how i understand it anyway.

x50505: Don't we need a resistor between the ground and emitter or collector and 12 V to control the current through LEDs?

No because if he has a 12V LED or LED strip then these contain the current limiting devices.

Off topic: But, let say that the led-board contains 4x 3v leds in series, then i need 12v to get them to their maximum brightness right? Why would i need a current limiting device like a resistor?

Also, back to topic. If i use a Arduino DUE (that work with only 3.3v), will i still be able to "open" the mosfet fully? Or should i use 2N2222 transistors on a seperate 5v rail? I might add a 5" display w/ touch to the project later, and i've seen that the drawing get really slow on a Mega2560, so that why I might use a DUE for this project at some point.