How many LED's can I power (via shift registers) with a MEGA

Hi,
I'm working on a project which requires a fairly large amount of LED's to be powered via shift registers. I need to power 20 goups of 16 LED's (320 in total). each group of 16 would be split across two 74hc595 shift registers daisy chained together. I have the first group working fine (please see schematic) but now I'm wondering whether or not adding more is going to put too much strain on the regulator on the board.

As you can see in the schematic the shift regs (and therefore the LED's) are currently powered by the 3.3v rail. This is so as to leave the 5v rail free for analogue inputs coming from potentiometers and therefore keep my analogue and digital circuits seperate.

could anybody please advise as to whether this project will be possible without thew need for an external power supply?

ALternatively I am considering the idea of trying to do the same thing using fast switching demultiplexers which would cycle through the LED's and therefore mean that a much smaller amount of them are powered on at any given moment.

ANyway.. I guess I'm just looking for ideas on the best way to acheive this (preferably without using an external power supply)

Thanks in advance

The 74HC595 shift registers can each supply a maximum of 70mA so that is the first consideration. How many mA does each LED take and can the SR provide enough current if all of them are turned on ?

More importantly, if you power all of the SRs from the Arduino, can it supply enough current to power 320 LEDs if they are all on, the answer to which is emphatically no

You need to consider using SRs that can each supply enough current to drive 8 LEDs on and to power the SRs with an external power supply

Thanks for the response UKHeliBob. I know that the SR's that I'm using (74hc595) do in fact supply enough current to power all 8 LED's via 330ohm resistors as I already have them working. The problem that I have is that I now need to duplicate this circuit 11 more times. so that's a total of 24 shift registers and as I said earlier; a total of 320 LED's. Which is quite lot of current.

what do you think about demultiplexing them so that the supply is rapidly switched between the LED's. That way, even if ALL LED's are required to be 'seemingly' lit at the same time, it would only really be one LED in each group that is ever powered on at once.

The Arduino is not designed to be a power supply so I would advise you to stop using it as one

but now I'm wondering whether or not adding more is going to put too much strain on the regulator on the board

It will most definately destroy the 3v3 regulator.

As you can see in the schematic the shift regs (and therefore the LED's) are currently powered by the 3.3v rail. This is so as to leave the 5v rail free for analogue inputs coming from potentiometers and therefore keep my analogue and digital circuits seperate

I would not be afraid for voltage dips caused by leds IF the power supply is great enough.

I would recommend to switch the 5V and 3V3 circuits. You can let the potentiometers be connected to 3v3 and power the LEDs by the 5V circuit. But you might as well use 5V for everything. I do recommend to use 100nF or higher capacitors on each analog pin to filter the potentiometers a bit.

ANyway.. I guess I'm just looking for ideas on the best way to acheive this (preferably without using an external power supply)

The Mega does not have a diesel generator on board. What I mean, it does need some form of power therefor I am assuming that you are using the USB port powered by some phone charger or your computer?? (computers typically can supply 500mA on USB ports)

How many mA does each LED take and can the SR provide enough current if all of them are turned on ?

The schematic dictates 330R resistors with 3V3 power supply. Assuming leds with a voltage drop of ~1.3V are used, each led will only consume about 6mA. And 8 x 6mA is less than 70mA.

Take note that if all 320 leds are active, you will be using just under 2A which is not insanely high. I do not know if the USB port can handle this amount of current or that some diode or fuse will be destroyed. (which would be a fixable 'issue')

ALternatively I am considering the idea of trying to do the same thing using fast switching demultiplexers which would cycle through the LED's and therefore mean that a much smaller amount of them are powered on at any given moment.

You can also do this with the shift registers, by doing more frequent updates and let only 1 or 2 leds burn at any time on each SR. However you will gain nothing.

For instance. If you let 1 led burn at any time, you will reduce power consumption up to 8 times, but your led will only shine at 1/8 of the time which will decrease the light output.

You can ofcourse increase the current with lower resistor values but it is essentially undoing that what you are trying to achieve.

With 6mA per led you will be fine with the 74hc595, but if you want more light you simply need more current and more current means either more or differenct IC's. You can for instance use ULN2803 chips and use the full 20mA per led.

Kind regards,

Bas

Generally speaking it would seem more sensible to use a MAX7219 to drive each group of 64 LEDs.

Best to buy a couple of the matrix modules unassembled and wire your own LEDs as a matrix instead of installing the square ones in the kit; it's cheap enough anyway.

You need to run on the 5 V supply. Using the on-board regulator of an Arduino is simply nonsensical. :roll_eyes:

thank you so much for your replies everybody. I think I'm going to give the demultiplexing method a go as I'm interested to see if it would work and because ideally the project should be powered from a PC usb connection.

This method is "multiplexing" rather than "demultiplexing".

USB power can normally supply up to 500mA max. But you want to keep below 80% of that for safety of the Arduino circuit and the pc/laptop, so around 400mA. The Arduino itself will need up to 50mA of that, leaving you with 350mA for the rest of the circuit.

With 320 LEDs, you can only supply each led with just over 1mA on average. So I suggest you work out what series resistor to use with a single led to get 1mA of current to flow, then connect a led and series resistor to 5V and see how bright the led looks, in the situations you want to use it in (indoor/outdoor/bright sunlight etc). Modern LEDs are very efficient and might be bright enough for your use, even at 1mA.

An alternative to max7219 could be ht16k33 modules. These can drive up to 128 LEDs each, so you would need 3. With max7219 you would need 5 modules/chips, so it's not that much of a saving, but maybe worth considering.

I think we should check, before going any further, how you plan to use these 320 LEDs. As you were planning to use 74hc595, I guess you need individual on/off control over every led?