This project began with 200 orange 3mm LEDs. I bought them for cheap and I wanted to make them into a display. I drilled 192 holes in a piece of wood, 8 high and 24 wide, and used it as a jig to solder together the LEDs. All the anodes of the LEDs in a column are connected, and the cathodes are connected in rows. This means that if a positive voltage is applied to one of the rows and ground is connected to one of the columns, the LED at the intersection will light up. In order to control all of the LEDs at once, you actually have to cheat a little bit. Only one row is actually lit up at one time, but they are cycled through quickly enough that they all appear on at once. This is known as multiplexing.
I used four 74HC595 shift registers to control all the rows and columns, and those in turn are controlled by an Arduino Nano. One shift register controls the rows, through some current-amplifying transistors, since the current required to turn 24 LEDs on at once is too much for the shift register. The other three shift registers are connected to the columns through current limiting resistors. I used 22 ohms, and it has worked pretty well for me, but something a little higher might be safer. The reason I have such a low resistance is because the transistors already lower the voltage and because the LEDs are only on one eighth of the time. There is also a voltage divider with a potentiometer in it, so that the brightness of the LEDs can be adjusted. I made an inverter out of two transistors as well, which is not strictly necessary, but it is a reliable solution to a problem I was facing when dealing with the shift register. Another solution would be to just chain the fourth shift register to the end of the other three. I don't know why I didn't do that, except that it makes more work for the Arduino. The hardest part of this project was debugging the circuit, since everything was very tight and I had multiple short circuits. If I were to do it again I would give myself much more space.




Once I had the circuit working, I wrote a library to take care of all details of interfacing with the shift registers and managing the data. I wanted to be able to come back to this project in a year and be able to control the matrix without having to do any of the hard work. This library also includes a file containing all of the printable ASCII characters and functions to handle stationary and scrolling text, so the display could be used as a sign or something like that.

I wanted to play Snake on the matrix, and now that I had a library to take care of all the details of writing to the LEDs, I could do that. I wrote a game of Snake with two modes: either you can control the snake with a joystick, or watch the autopilot play for you. The program uses classes generously; I wanted to practice what I was learning in school, but it also really does make things simpler, once you understand how to use these C++ features. The autopilot code is confusing, but it works pretty well.
The only thing left to do was to build a case for the display. I used pieces of wood recycled from a pallet for the sides and a piece of frosted plastic on the front, glued it all together, and mounted the matrix with its controller inside.
EXPANDED TECHNICAL DETAILS
Array-Based Game Engine Design
This project reimagines the classic "Snake" game on a massive low-resolution display made of 192 individual LEDs (arranged in an 8x24 matrix).
- Coordinate Mapping Algorithm: The "Snake" is stored as an array of X,Y coordinates in the Arduino's memory. As the head moves, the body coordinates are "Shifted" down the array, and the tail is cleared.
- MAX7219 Daisy-Chaining: Controls three 8x8 matrix modules linked together via a high-speed SPI bus. The Arduino manages the "Seamless" movement of the snake as it travels across the physical boundaries of the three separate LED chips.
Collision Detection
- Game Physics: The firmware constantly checks if the head coordinate ($X,Y$) matches any of the body segments or the "Food" coordinate, managing score-keeping and game-over logic with microsecond precision.