I'm doing a DIY project and i would like to keep it as simple as possible.
Then as a "noob" you are approaching it completely in the wrong manner. :astonished:
I need to drive 32 (20mA) leds in a line. Not a matrix.
Then you do not comprehend what a matrix is electrically. It is in fact, the simple approach. Easier to wire and actually somewhat easier to program!
I have read that the max power of the Arduino Mega is 200mA global, so I'm way over it as they will be all turned on at some point.
Fine. Not a problem.
Is there an IC that could get 32 inputs from the Arduino and output them without the limited power of the motherboard?
No. And yes. Obviously you do not get 32 inputs from your Nano (waste of time using a Mega 2560) to one chip but there is a proper way to do it.
The chip you want is the MAX7219 matrix driver. This will drive your 32 LEDs to maximum brightness - though desiring to do that is in itself, a fundamental mistake. You wire your 32 LEDs as a four (cathode) by 8 (anode) matrix. This is actually much simpler as only twelve wires run into your line of LEDs, not 33! You program the MAX7219 for a scan limit of four (Value 3 in register 0xB) and the bit patterns for your 32 LEDs are written into the first four digit registers.
Just buy two or three three of these kits:
Or these ones
which used to be more expensive but are now actually cheaper and more useful if you wish to stack matrix arrays.
The point is that you do not install the matrix arrays themselves - or their socket pins, but just solder to the positions on the PCB and you have a durable and reliable assembly to drive your own arrays of LEDs wired as a matrix.
Why did I say two or three? Well, you can fully assemble the first one as the matrix with which it comes and practice programming it. Then the second one for your current project and the third one - for the next! :grinning:
And what was your mistake as a "noob"? Thinking in a "linear" fashion - one LED connects to one pin, two LEDs connect to two pins, three LEDs ...
Once you exceed about ten, the landscape changes. For "bulk" problems, you swap to hardware designed specifically for the task and software to match. And you save 31 resistors!
And a Mega 2560 is mostly useful not for more wires (pins), but for its additional memory which in this case I am pretty sure you do not need. A Nano - and not a UNO - is more practical.
You could cascade four SN74HC595s and drive them with shiftOut().
But they would not drive the LEDs to 20 mA.