Electronic – arduino – Theory/equation for wiring a irregularly shaped LED matrix for row/column selection

arduinoled-matrix

I have a large (~90) LED matrix I am whipping up. However, rather than being the traditional easy square shape, its in an odd heart shape.

The reason this is a problem, if I just use horizontal rows and vertical columns, I "waste" a lot of pins on rows/columns with only a few LEDs (like at the tip of the heart), and dont have enough pins on my current equpiment to address them all.

So the question is, how do you go about combining the LEDs such that you maintain ~10 per pin, without overlapping any rows or columns (my first attempt was simply to combine the smaller rows together, which cause them to intersect with multiple columns at a time).

I feel like this is a linear algebra problem, though I took that class 10 years ago (and failed it)…

Best Answer

If you don't have to pack your LEDs so close together that the layout is overly constrained, simply make the schematic a rectangular 12 x 8 matrix.

Then place the LEDs physically where you want them such that they can still be interconnected with traces.

schematic

simulate this circuit – Schematic created using CircuitLab

The above two diagrams are electrically identical (a 3 x 3 matrix) but in the right hand one the LEDs are physically arranged in a crude heart shape to illustrate what the PCB layout could look like.

If your problem is how to drive a 12 x 8 matrix, that can easily be done with 20 pins, but it's not much harder to use fewer pins.. for example 3 x 74HC595 will allow the use of 10 or 11 pins with no sweat.