Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.

ASK AN EDUCATOR! “How do I choose resistors to match a multiplexed led matrix?”

Greg asks:

How do I choose resistors to match a multiplexed led matrix?

Great question and the answer is a little elusive. Let’s at the diagram for Adafruit’s 8×8 matrix:

As you might know, there are many ways to drive a LED Matrix, and we will assume you have an 8×8. The easiest is to drive it directly from your microcontroller using 8 pins for the anodes and 8 for the cathode. With this configuration you can individually control all 64 LEDs and have a variety of methods for switching them on and off. If you look at the I/O capability of your microcontroller you will notice that they are only capable of sinking ~30-40mA per pin. If you were to were to illuminate an entire row with a common cathode, you would draw ~160mA and blow out your controller.

First the math:

If you look at the spec sheet for Adafruit’s matrix, the LEDs have a Vf of 2.2V and draw 25mA. In order to properly illuminate them with a 5V supply you would need a 112ohm (120ohm is the closest without going below) resistor. R = (5V – 2.2V) / 0.025A = 112ohm.

The problem with using a 120ohm resistor in series with the anode of each column is that when you illuminate more then one row at a time, the current available for each LED decreases…so you will get an uneven illumination of the panel.

If you run the calculation for 8 LEDs in parallel, you would need 14ohm (15ohm is the closest without going over) resistors to deliver 25mA to each LED. The problem with this is that the voltage is going to increase across each diode when less then 8 are illuminated, and you would be drawing 200mA! Far more then your microcontroller can handle.

This brings us to our control theory:

Method 1:
Since you are multiplexing the LEDs you can take advantage your processors high speed by “scanning” the grid. With just your microcontroller, you can illuminate each LED with a 60hz refresh rate so you eyes dont see the flicker. You could implement an algorithm to scan from the top left to bottom right (just like a CRT). This would allow you to run an entire panel with relatively low current draw. has a good overview, although they are not using the scan method, and don’t forget the dropping resistors.

Method 2:
You can use your microcontroller to control more then one row at a time by controlling the anodes and cathodes with MOSFETs. This would allow for you to run your panel at even higher current ratings then the “constant on” current from the data sheet. You can change the duty-cycle controlling the rows to allow for ~100mA per diode. You will get a much higher brightness, and if you cycle them at >60hz, you eyes wont really notice the flicker. Here is a good example using 2n3906 and 2n2222 transistors.

Method 3:
You can also accommodate for the high current loads through the matrix by using a stand alone multiplexer. The IC allows you to isolate your microcontroller and allow you to take greater advantage of multiplexing by controlling more then one row at a time. has a list of tutorials as well for setting up a matrix using drivers.

I hope this has helped to answer your question and good luck with your matrix!

Don’t forget, everyone is invited to ask a question!

Click here!

“Ask an Educator” questions are answered by Adam Kemp, a high school teacher who has been teaching courses in Energy Systems, Systems Engineering, Robotics and Prototyping since 2005.

Adafruit has had paid day off for voting for our team for years, if you need help getting that going for your organization, let us know – we can share how and why we did this as well as the good results. Here are some resources for voting by mail, voting in person, and some NY resources for our NY based teams as well. If there are additional resources to add, please let us know –

Stop breadboarding and soldering – start making immediately! Adafruit’s Circuit Playground is jam-packed with LEDs, sensors, buttons, alligator clip pads and more. Build projects with Circuit Playground in a few minutes with the drag-and-drop MakeCode programming site, learn computer science using the CS Discoveries class on, jump into CircuitPython to learn Python and hardware together, TinyGO, or even use the Arduino IDE. Circuit Playground Express is the newest and best Circuit Playground board, with support for CircuitPython, MakeCode, and Arduino. It has a powerful processor, 10 NeoPixels, mini speaker, InfraRed receive and transmit, two buttons, a switch, 14 alligator clip pads, and lots of sensors: capacitive touch, IR proximity, temperature, light, motion and sound. A whole wide world of electronics and coding is waiting for you, and it fits in the palm of your hand.

Join 24,000+ makers on Adafruit’s Discord channels and be part of the community!

Have an amazing project to share? The Electronics Show and Tell is every Wednesday at 7pm ET! To join, head over to YouTube and check out the show’s live chat – we’ll post the link there.

Join us every Wednesday night at 8pm ET for Ask an Engineer!

Follow Adafruit on Instagram for top secret new products, behinds the scenes and more

CircuitPython – The easiest way to program microcontrollers –

Maker Business — To make it through a tough business cycle, layoffs should be a last resort

Wearables — Rub’n’buff

Electronics — Multimeter Bandwidth – AC Signal

Python for Microcontrollers — Python on Microcontrollers Newsletter: CircuitPython 6 Release Candidate, new hardware & more! #Python #Adafruit #CircuitPython #ElectronicHalloween @micropython @ThePSF

Adafruit IoT Monthly — Matrix Portal, Solar Lawn Sprinkler and more!

Microsoft MakeCode — micro:bit version 2 Announced!

EYE on NPI — Maxim’s Himalaya uSLIC Step-Down Power Module #EyeOnNPI @maximintegrated @digikey

New Products – Adafruit Industries – Makers, hackers, artists, designers and engineers! — New Products 10/21/2020 Featuring Adafruit Voice Bonnet for Raspberry Pi – Two Speakers + Two Mics (Video)

Get the only spam-free daily newsletter about wearables, running a "maker business", electronic tips and more! Subscribe at !

1 Comment

  1. Thanks, this was extremely helpful in understanding an issue I have been running into.

Sorry, the comment form is closed at this time.