Ideas on driving 26 LEDs with an arduino

Thread Starter

zirconx

Joined Mar 10, 2010
97
I'd like to make a project that can light up 26 different LEDs in different sequences (spelling out words with LEDs next to a letter).

I own a number of arduino Unos and Leonardos. I looked for some type of breakout board and came across these 16 channel multiplexer boards from a few sources: https://www.banggood.com/ADC-CMOS-CD74HC4067-16CH-Channel-Analog-Digital-Multiplexer-Module-Board-Sensor-Controller-For-Arduino-p-1514065.html
Looks like that can sink 20ma of current, so I should be able to use two of those to get enough channels to drive 26 different LEDs. One downside I see is that I couldn't turn on all the LEDs at once, which I don't really see the need for so I think that's ok.

But maybe it would be easier (and more expensive unfortunately) to purchase an Arduino Mega? Then I would not need any additional hardware, other than 26 resistors. Looks like the digital pins on the Mega are also rated at 20ma.

Yes I could purchase addressable LEDs, but for my application (a Stranger Things wall), I don't think I could make those look right.

Thoughts?
 

djsfantasi

Joined Apr 11, 2010
6,433
I'd like to make a project that can light up 26 different LEDs in different sequences (spelling out words with LEDs next to a letter).

I own a number of arduino Unos and Leonardos. I looked for some type of breakout board and came across these 16 channel multiplexer boards from a few sources: https://www.banggood.com/ADC-CMOS-CD74HC4067-16CH-Channel-Analog-Digital-Multiplexer-Module-Board-Sensor-Controller-For-Arduino-p-1514065.html
Looks like that can sink 20ma of current, so I should be able to use two of those to get enough channels to drive 26 different LEDs. One downside I see is that I couldn't turn on all the LEDs at once, which I don't really see the need for so I think that's ok.

But maybe it would be easier (and more expensive unfortunately) to purchase an Arduino Mega? Then I would not need any additional hardware, other than 26 resistors. Looks like the digital pins on the Mega are also rated at 20ma.

Yes I could purchase addressable LEDs, but for my application (a Stranger Things wall), I don't think I could make those look right.

Thoughts?
Be careful about the pin ratings. There is a maximum for the total current drawn from all pins.

One pin can draw 20mA. But all pins can only draw less than 200mA. Which means that if an LED draws 20mA, you can only drive less than 10 of them. “Less” because that 200mA limit includes what the board itself draws! The same limit applies to the Mega.

Don’t worry. It’s a common error that people with Arduinos make.

So I’d add transistor or MOSFET drivers. May I suggest the ubiquitous 2N7000?
 

Thread Starter

zirconx

Joined Mar 10, 2010
97
I plan on spelling out words using individual letters, so I don't currently foresee a need to light up more than one at a time.

I found some addressable LEDs that aren't in a strip, so I might be able to fashion these into a wall board.
https://www.amazon.com/dp/B06XD72LYM

Then I could use my existing Arduino.
 

KeithWalker

Joined Jul 10, 2017
905
I'd like to make a project that can light up 26 different LEDs in different sequences (spelling out words with LEDs next to a letter).

I own a number of arduino Unos and Leonardos. I looked for some type of breakout board and came across these 16 channel multiplexer boards from a few sources: https://www.banggood.com/ADC-CMOS-CD74HC4067-16CH-Channel-Analog-Digital-Multiplexer-Module-Board-Sensor-Controller-For-Arduino-p-1514065.html
Looks like that can sink 20ma of current, so I should be able to use two of those to get enough channels to drive 26 different LEDs. One downside I see is that I couldn't turn on all the LEDs at once, which I don't really see the need for so I think that's ok.
But maybe it would be easier (and more expensive unfortunately) to purchase an Arduino Mega? Then I would not need any additional hardware, other than 26 resistors. Looks like the digital pins on the Mega are also rated at 20ma.

Yes I could purchase addressable LEDs, but for my application (a Stranger Things wall), I don't think I could make those look right.

Thoughts?
You could use a 5 to 32 line demultiplexer (see pdf attached). It will select one of 32 outputs from 5 input logic level lines. I don't know how big your LEDs are but it will output 20 mA. Anything more than that you would need a transistor on each output line.
https://www.quora.com/How-do-you-design-5-to-32-decoders-using-3-to-8-decoders
 

dl324

Joined Mar 30, 2015
10,758
I plan on spelling out words using individual letters, so I don't currently foresee a need to light up more than one at a time.
I made a scrolling display on a 5x7 LED matrix and I chose to drive a column at a time. I chose to use a CD4017 with transistors as the column drivers, so I only needed 9 outputs. I used P MOSFETs for the row drivers because the ARM microcontroller couldn't source more than a few mA.
 

Marley

Joined Apr 4, 2016
348
Simple way is to use a matrix. Example 6 x 6 will drive 36 LEDs using 12 outputs. If you scan through the matrix fast enough any combination of LEDs can appear to be lit simultaneously.
You will need external transistors for your row and column drivers.
If each LED needs an average current of 20mA then the actual current when selected will need to be multiplied by the duty cycle (6 in the example above so 120mA per LED).
 
Top