Using a NPN diode to control 12v LED

Hi Team, I am very new to this so please be gentle :stuck_out_tongue:

I am using an npn transistor to send a 12v pwm signal to a bunch of 12vLEDs via a potentiometer. (these will be garden lights in the wild.)

My question is, what sized resistor do I need between my arduino and the base? and why do I need a resistor?

I have also heard maybe a diode but again I am very new to this all and have a pretty basic understanding of electronics.

At the moment with no resistor everything is working as it should but the LEDsI worry about frying the arduino?

Here is the spec sheet for the transistor:

And here is an attempt at a schematic of my circuit:

This current limiting resistor should be > 220 Ohm in order to protect the Arduino output (< 20mA). It also should be low enough to feed the transistor base with enough current for the LEDs. What's the LED current?

In that case, would it not be better to have some sort of diode in place of the resistor? I’m not too sure about the LED current yet because it will be a bunch of garden lights that are TBD. Should that be a consideration? I thought that only mattered to spec the appropriate power supply?

You should be sure for the transistor selection - see the LED data sheet. Multiple LEDs draw multiples of the single LED current.

You need a resistor in order to limit the current flowing out of the Arduino pin to not damage it.

Let's say the max current allowed is 20mA. The transistor you show has a max "beta" (current gain) of 40. I'll make the assumption that it will be at least 30 in this application. Meaning that with 20mA flowing into the transistor base, you will get 600mA (20mA * 30) through the transistor for LED current.

Assuming 600mA is enough for your LEDs, then to limit the current into the transistor base to 20mA, the resistor will have 4.4V across it (5V out of the arduino and 0.6V at the base) so 4.4/0.02 = 220 ohms.

2 Likes

ok at this stage the total current of the LEDs will be about 1.25A and definitely no more than 1.5A

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.