SparkFun will be closed on Tuesday, December 24th, and Wednesday, December 25th, in observance of the Christmas holiday. Any orders qualifying for same day shipping placed after 2:00 p.m. (MST) on Monday, December 23rd, will be processed on Thursday, December 26th, when we return to regular business hours. Wishing you a safe and happy holiday from all of us at SparkFun!
Please note - we will not be available for Local Pick up orders from December 24th-December 27th. If you place an order for Local Pick-Up we will have those ready on Monday, December 30th.
65 microcontrollers, 4096 LED's, and a secondhand coffee table bring new light to an old-school video game.
Chris Taylor - Power board, hardware, coding
Casey Haskell - Mechanical Design, coffee table refurbishing
David Wolpoff - Original concept, router design
Nathan Seidle - Idea factory
Overview:
This project is the game of pong with a new twist and an interesting implementation. The original idea for this project was to design a coffee table to have integrated LEDs. We'd seen designs with interactive LEDs that responded to objects on the table, and they usually had around 400 LEDs...so we decided to up the ante with 10 times as many. We built the table and then decided that simple interactions were not enough, and went to work on a full-fledged game. 4-way multiplayer pong, in fact. Being geeks, we were obligated to have the game controlled using 4 Atari 2600 controllers (circa 1977).
The table itself was bought secondhand and refinished. Then it was retrofitted with proper mounting for the big LED matrix. The individual LED matrices were mounted on a custom plastic frame. All this work was done by resident mechanical engineer and lady-killer Casey Haskell. The matrices are connected 8 to a row, all 8 rows controlled via a custom router board connected to an Olimex LPC2106 development board. The entire rig is powered by a hacked 500 watt CPU power supply.
The Rest is Just Details:
The LED Matrices:
Each LED matrix consists of two parts, the actual LED module composed of 64 RGB LED's in a plastic mounting, and a Sparkfun RGB matrix controller board. The controller board hardware works using shift registers and SPI communication. The firmware maintains an 8x8 array of color values. When a new value comes in on the Data In line, it is shifted into the first "spot" in the array. The 64th value (the last "spot") is sent out on the Data Out line. This allows the matrices to be strung together in series to create a large matrix of color values that shift simultaneously. More on this later. You can find the schematic and code on the controller product page.
The tabletop-sized matrix:
Our first goal was to get the 64 matrices into "tabletop" size. We designed a custom mounting board and hacked the table itself such that each matrix could be bolted on and removed individually. The mounting board has holes that allow access to the power and serial lines of each matrix. We decided that the table would be controlled row-by-row, each row consisting of eight matrices. The data for each row would be clocked into the first matrix, and that data would then be clocked down the row. We originally directly connected the DATA OUT line of the first matrix to the DATA IN line of the second matrix and from the second to the third, all the way down the row. This posed a problem, however, because when clocking in data at the speed needed to display a pong game, noise on the lines would cause errors in the data, and we would end up with incorrect colors displaying on the board. Our solution was a custom buffer and power board.
This board simply consists of a decoupling capacitor at each input to each matrix, and a buffer refreshing the data signal before each matrix. This got rid of our errors and made the refresh a lot cleaner. For the geeks, take a look at the power board schematic.
The wiring for the table was wonderfully complicated-looking, but fortunately it looks worse than it really is. We used Olimex serial programmer cables that connected one-to-one to the power board. Here's a shot of the under-side of the table top after final assembly:
Stay in control:
The entire matrix is controlled with a single SPI line from an Olimex LPC2106 development board. Earlier I said that the big matrix was set up as a set of 8 separately controlled rows. Eight rows, one SPI line? Answer: router board.
The router board is essentially a glorified chip select, with three of the port pins on the 2106 board reserved for a three-bit chip select. The router simply drops the chip select of an entire row, and sends the data out for the entire row, with the rest of the rows ignoring the data. The rows are refreshed one at a time, from the top to the bottom of the matrix. Router Schematic
The Atari controllers were simply hardwired to port pins on the controller board. The controllers are simply polled on each cycle, with the bar position updated every cycle. The schematic for the joystick was found here.
Game time:
The actual game code is your standard game of pong, with modifications to accommodate the unusual display. The code maintains a 64x64 matrix of color values (simple char values for speed). On each iteration of the game loop, the code updates the paddles and the ball, and then refreshes the screen. Simple enough? Yes. Too simple? We thought so. So in order to add a new twist to the game, we implemented a "multiball" version of pong. In this version, the idea is to make the game team-based. Each time the ball hits one of the paddles, a score in the center increases. After every 10 "hits" another ball is added. The idea is for the team of four to stay alive as long as possible. This was accomplished in code by holding an array of multiple balls, the number of active elements in the array increasing as the hit count increases. As soon as a ball is missed, the game is over and the team's score flashes on the screen. Of all the teams that played at Makerfaire in San Fransisco, the high score was 67 (about 7 balls). Our game code can be downloaded here.
Looks like you are not the only one.
http://www.flickr.com/photos/connors934/3238339157/
Cheers
Michael
Thanks for the idea! Got to order some parts from http://www.spectra.com/ before proceeding. I have a feeling this can top the market. Brilliant idea.
I think with this set up, a game similar to motorcycle racing in Tron would be appropriate.
Fail.
Pong was played with the paddle control, not the joystick. :)
If you're going to make an 8x8 ($59 ea) = $3,400 screen, why not at least use a nice FPGA kit or something that can drive each matrix line separately?
The chip I'm using after the voltage translator is a 74ACT138 decoder. The code to display more than 8 colors is here:
http://www.sparkfun.com/tutorial/LED_Table/Matrix.zip
This is a 332 bit RGB encoding, so 196 different colors. Note line 88:
if(!(byte_count & 511))
new_frame = 1;
This is a conditional that causes the matrix to only display the last 64 bytes of a 512 byte data stream. The reason for this is that on the table, the matrices are controlled in rows of eight, and if the matrix displays every 64 byte frame it receives, the table will display "ghost" frames because of the slower timing. This conditional sets the frame size to 512. If one were to use this with a different number of matrices, 512 should be changed to 64 times the number of matrices.
sparr, the link Nate posted is to the controller board, it comes with the actual LED matrix. Hope that gets rid of the confusion.
Let's see if this works:
http://www.sparkfun.com/commerce/product_info.php?products_id=760
Sweet! And no need for getting one of those other ugly "evil" interactive LED tables. More lights on this superior Sparkfun LED Interactive coffee table, more fun too.
can you link to the "Sparkfun RGB matrix controller board" that youre using? i can't find it
What IC did you use in the router board oafter the two voltage shifters? I cannot figure it out. I would like to do a similar project using a transparent chessboard.
Amazing project!
You mention in the spec you have 4096 RGB 256 colour LEDs.
Does this mean you have reprogrammed the backpacks that come with the LED matrices to display more than the default 8 colours?
If so I would love to get hold of the code. I have some of these matrices myself and was wanting to display over 8 colours.
Reprogramming the AVR to handle 64 colors*, shouldn't be too hard. If** I buy one of these matrices and backpacks then I will surely write the necessary code and post it online. I have been having fun doing PWM for my own prototype charlieplexed displays lately
* 2-2-2 bit RGB
** at $60 each i would need to be really motivated by a project to buy one. that table is cool, but not $3500 cool.
Awesome idea and execution. How much did this crazy thing cost?
This looks cool, but I'll like to see a video of it working
Good idea. I got some taken and posted above through youtube. Sorry for the quality and lack of sound, but it should give you an idea of what it looks like. We're planning on stepping things up in the future.