# Why are transistors necessary before LEDs?

Below is the small RGB LED circuit I'm trying to build. My question is why are the 3 transistors necessary, and can I not link the LEDs directly?

• I doubt if the LEDs will ever light up with 4.7k base resistor and 4.7k resistor in series with LEDs
– SBF
Aug 23, 2021 at 6:25
• @SBF they will not. They’re NPN transistors on the wrong side of the load. Also, the LEDs will not be driven higher than about 0.5mA each, which might be enough, but will not be very bright. Aug 23, 2021 at 6:36
• We don't know what the supply voltage is from that circuit. It's not a good circuit at all.
– Majenko
Aug 23, 2021 at 8:06
• @StarCat They're not on the "wrong" side of the load. There's no "wrong" side. They're just not on the "traditional" side for simple saturation switching. Instead they (and their resistors) form part of the base current path and severely limit the amount of base current that can flow. Your current of 0.5mA for each LED is bang on though. I make it 594uA per LED. A pitiful current.
– Majenko
Aug 23, 2021 at 9:05
• @Majenko, agreed, when I said "wrong" I meant this was not the most logical or efficient placement of the switching NPN transistors. Your explanation is correct of course. Aug 23, 2021 at 10:22

The port pins of your Nano can deliver current in a quite limited range, and six LEDs need a lot more to shine brightly. The transistors are amplifying the available current.

However, 4k7 resistors in series with each LED will not allow enough current to let them shine well. Reduce the resistors by a factor of at least 10. Read the LEDs' data sheet and apply Ohm's law.

The transistors are connected as an emitter follower, not as a switch. The transistors are acting as current amplifiers. The emitter voltage will rise to approximately the voltage on its base - about 0.7V. That places the voltage at about (5 - 0.7 = 4.3V) at the emitter. Since the collectors of transistors are powered by Vin I would guess you have at least 6 volts available assuming a 5V Nano so the extra voltage drop across the transistors will be dissipated as heat. The base resistors are not needed but should not affect performance much. The available current at the emitter would be the Hfe of the transistor times the base current. Each LED will consume about 2 milliamps making the load on each of the transistor around 12 milliamps. It should work fine. You can divide the 12 milliamps of the LEDs by the Hfe of the transistor to get the base load.

Each LED consumes up to 20mA and You are using three LEDs at each I/O port in Arduino Nano. In other word, each part consumes 120mA.

The important thing is Arduino Nano I/O provides 20mA at maximum. So if you want to control 120mA by I/O ports, you must use transistor to support huge current.

Transistor can afford current up to 500mA.

• I see 6 LEDs controlled by one pin
– Juraj
Aug 23, 2021 at 18:01
• How do you know how much current the transistor can handle? The OP did not specify the transistor used... Aug 25, 2021 at 0:01
• He said "Why transistors are necessary" not "Why this transistors are necssary"
– 박광렬
Aug 26, 2021 at 6:46
• @Juraj I see 12 LEDs controlled by pins 6/10
– SBF
Aug 26, 2021 at 20:56
• 3 transistors on pins D2, D6 and D10 and 18 LEDs
– Juraj
Aug 27, 2021 at 4:35