LED side table

After a successfull seminar at the IEEE Student Branch Leuven about the use of a WS2801 pixel string as Ambilight clone, there was an idea of using a matrix of these LED pixels to create a low-res screen, built into a table. Then I saw a new Ikea side table, and it looked like it would be excellent as base for an interactive LED table.

The plan is to draw a frame in Inkscape and have it lasercut at the Leuven Fablab, make a hole in the table, and suspend the frame in it. The control electronics and power supply should be hidden underneath the frame.

Without having the table, I tried to deduce the width of the table's sides from the provided image and listed dimensions. This lead to a usable square space inside the table of about 44~45cm. I decided to take some marging and design a square LED frame of 44cm. It should fit :)

Then followed some tests in cardboard to determine the optimal "cube" size that will hold the LEDs. The cubes should be big enough to be visually consistent with the table's design and small enough to allow sufficient resolution for animations and simple games.
I eventually settled for 12x12 LEDs in cubes of 35mm width.

Eventually the raster was lasercut from 3mm MDF panels, then painted in white with a rattle can for better reflection and diffusion:
3mm MDF panel cut with laserPrimer applied, then painted with rattle can
At this point I came to the conclusion that WS2801 led pixels are not the best idea. They are quite long and bulky, so would stick out underneath the baseplate of the table, but have the advantage that they can be 'snapped' into a 12mm hole. WS2812B LEDs are a lot cheaper, require less soldering and since I don't need the waterproof feature of the WS2801's, I decided to go for the WS2812B instead. There is also a very good library to drive WS2812 strings from a Teensy 3 microcontroller, called OctoWS2811.

With the baseplate completed, the frame could be glued together. The tricky part being to hold the frame exactly square, since there was some play on the lasercut pieces.

The new LEDs came in a pre-soldered string with about 10cm wire inbetween them, so every one had to be resoldered before being glued into place.
Start of soldering and glueing the 144 WS2812B LEDs
Soldering the WS2812B LEDs
Since the OctoWS2811 can drive 8 separate channels, and I have 12 rows/columns, I decided to wire the LEDs into 6 strings of 24, and in a zigzag pattern to minimize wiring uglyness :) Addressing can be solved in software anyway.

For the control board, I decided to go for the aforementioned Teensy 3 and an USB Host Shield Pro Mini, so that a keyboard or gamepad can be used with the table. Both have excellent Arduino support, making development go quite fast :) Although I bumped into a bug with the USB shield and HID devices that should now be solved.
The power supply is a fanless 150W 5V unit I obtained via Ledsee.com.
Teensy 3.0 with USB Host Shield Pro Mini
Assembly took some time, and during testing, 3 of the 144 LEDs decided to prematurely end the cooperation...

Eventually I decided the project was advanced far enough to go and buy the table... and destroy it:
Cutting a hole in an IKEA Lack table
Cutting a hole in an IKEA Lack table. It's made of paper!
Interestingly, it's made almost entirely of cardboard in a honeycomb pattern. I bet if it catches fire it burns up within minutes.

Because it is impossible to cut this 100% straight, I glued a border from aluminium L profile to the side of the LED frame. When dropped in the hole, it should hide the ugly edges.
Attached aluminium profile along the border
Scrap aluminium bolted together to hold the PSU and control board
Next up is the mounting of the control board and power supply, just below the frame. I was a little worried about the heat of the power supply softening the glue which with the LEDs are mounted, but it turned out fine.
Close-up of the control board and LED panel in place

At this point, the hardware side is finished, except for a glass sheet that needs to be cut. I'm not sure yet whether to go for diffuse or plain glass.

For the software, I wrote a Tetris clone, and ported the Snake game from the Arduino game shield already. Then I added a menu system using scrolling text, so that it is possible to select and change the mode of the table.
First test with Tetris code and Xbox 360 USB controller

The complete, but "un-cleaned-up", code for this project can be found on Github