I am trying to design a basic project to multiplex a 3x3 LED grid in a common anode arrangement. In order to avoid sinking (sourcing?) too much current from the digital I/O pins of the Arduino I would like to uses NPN transistors as a low-side switch for each column.

I understand the case where I use a transistor to switch a single LED with the anode connected to Vs. However, I am having difficulty in designing the circuit for the multiplexed approach.

As my circuit stands I can't understand how to to wire it to source current from Vs and using I/O to control the flow.

Any pointers would be much appreciated.

enter image description here


1 Answer 1


To source from Vs or the positive supply (I'm assuming 5V), you could connect it to the GPIO, where a logic High would be the V+ of the microcontroller, or you could connect it to PNP transistors. The PNP base would then be connected to GPIO instead, like the npn transistors are.

  • \$\begingroup\$ I'm not sure if I understand your answer fully. If I connected 5V to the I/O rows will this not always set them high and thus I wont be able to address and control the LED rows? Thanks \$\endgroup\$ Aug 1, 2016 at 21:20
  • \$\begingroup\$ @catslovejazz, exactly, which is why you either connect the "row" to a GPIO directly, or through a PNP type transistor, both of which you can control, like you do the NPN on the low side. \$\endgroup\$
    – Passerby
    Aug 1, 2016 at 21:38
  • 1
    \$\begingroup\$ So I would have a set of NPN to control the columns and a set of PNP to control the rows? This way I will only sink/source a small amount of current from the IO pins and the LEDs will be driven by the Vs/transistors \$\endgroup\$ Aug 1, 2016 at 21:41
  • \$\begingroup\$ Yes. See cdn.instructables.com/FNB/1C5O/ICN7G649/… that said, if you are scanning them at one led at a time, you don't need either row or column transistors. A 3x3 matrix at 20mA would be easy to do directly. \$\endgroup\$
    – Passerby
    Aug 1, 2016 at 21:41
  • \$\begingroup\$ Fantastic, the only modification I would need is a resistor to limit the current in each column. \$\endgroup\$ Aug 1, 2016 at 21:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.