An Awesome Interactive LED Table

If you want to create a large display with a matrix of LEDs, it’s a relatively straightforward process. Thanks to addressable LED tape and microcontrollers it becomes more of a software issue than one of hardware. [Vincent Deconinck] had some inexpensive WS2812 strips, so he sliced into an inexpensive IKEA coffee table  and mounted them in a grid beneath an acrylic sheet. Some work with Arduino Nanos and a Raspberry Pi later, and he had a very acceptable LED matrix table.

An attractive hack, you might say, and leave it at that. But he wasn’t satisfied enough to leave it there, and so to make something rather special he decided to add interactivity. With an infra-red emitter and receiver as part of each pixel, he was able to turn an LED table into an LED touchscreen, though to be slightly pedantic it’s not sensing touch as such.

The design of the IR sensors was not entirely straightforward though, because to ensure reliable detection and avoid illumination from the LED they had to be carefully mounted and enclosed in a tube. He also goes into some detail on the multiplexing circuitry he used to drive the whole array from more Arduinos and a GPIO expander.

The write-up for this project is a long one, but it’s well worth the read as the result is very impressive. There are several videos but we’ll show you the final one, the table playing touch screen Tetris.

We’ve featured another Lack table with LEDs, but you might comment that it lacked the touch element of this one. And of course, there is York Hackspace’s Tetris Table.

30 thoughts on “An Awesome Interactive LED Table

    1. The arduinos are used as serial buffers because the raspberry pi that is producing the animations isn’t an RTOS so it can produce timing glitches.

      One nano is driving the LED strips, another reading the IR sensors and pushing data upstream to the Pi, but because there’s a limited number of A/D inputs to the nano he used two.

          1. There’s only one A/D converter on an arduino nano afaik and it’s already handling 8 inputs in a mux. Making it do all the 14 inputs is just going to slow it down.

          2. On the output side to the WS2812, the serial output was a constraint built in Glediator. I could have overridden Glediator’s output with new code but I doubt doing DMA in Java is a good idea :-), so that would have meant adding a C layer and interfacing. Plus, that would have made the project RPi-only while this should also work with an OrangePi or similar.
            On the input side, one A/D of some sort was required to return serial data, so one Nano was mandatory. I had first thought using a mux indeed (I even bought a CD74HC4067 breakout board) but as Dax guessed, I preferred to double the scan rate using 2 Nanos.
            But yeah, I don’t claim I made the best choices, and it’s nice to get feedback on what could have been done differently. Really appreciated :-)

          3. its slow because its arduino. What is it, 10KHz max for adc?

            Vincent no matter what you put in there, the end effect is phenomenal, quality stuff!

            What is the Gladiator output? Its not like its bit banging in java? :) Using DMA is simply filling a buffer in memory with data (that you probably send over serial now) and triggering a transfer. You could write a python script emulating serial client that does this invisibly in the background while pretending to be a serial device on the same Pee you run gladiator.

          4. Thanks for the compliment, rasz_pl.

            Well, in fact, the Arduino can perform 10000 conversions per second – https://www.arduino.cc/en/Reference/AnalogRead – so with 200 leds x 2 samples (emitter on vs off), I could theoretically achieve 50fps.
            The reason I slowed down the rate (with a 2ms delay between measurements) is that the receiving leds are extremely slow to settle. That can be seen in the scope tests at https://www.youtube.com/watch?v=73JzLD2NXpM (scale is 2ms/div). With a single A/D, it would have required 400ms to perform a full scan, that is a scan rate of 2.5fps.
            Performing the measure on the two halves of the table at the same time leads to 5fps. That speed is acceptable, although the lag is noticeable, e.g. in https://www.youtube.com/watch?v=OdJgoZ6M1Aw
            The best solution would be to use better quality components for sure, but well, I was on a budget :-).

            I didn’t really study the Glediator output code but indeed, I could probably modify it, but sharing data between Java and other processes probably involves JNI which is hardware dependent and I really don’t like that.
            Emulating a serial port with a software performing the DMA stuff is an attractive idea though. I didn’t know you could emulate a serial port in Python. Cool !

            Thanks :-)

          5. You could try “precharging” cells in a 1×3 or 1×4 grid(depending how much distance you need to eliminate neighbor interference). Activate
            0x0
            1×2
            2×4
            3×6
            4×8

            wait for settle, read as fast as you can and precharge next batch
            0x1
            1×3
            2×5
            3×7
            ..
            and so on, reading whole diagonal lines at a time = you only wait that settle time 7 times per whole matrix instead of every single cell.

          6. Hmm, I agree that grouping measurement of several cells would be a good idea, but I admit I don’t get how to make it the way you propose with a multiplexed power supply.

            e.g. to power the following cells:
            R×C
            0×0 => I need Vcc on R0 and Gnd on C0
            1×2 => I need Vcc on R1 and Gnd on C2 => So 0×2 and 1×0 will light up too
            2×4 => I need Vcc on R2 and Gnd on C4 => So 0×4 and 1×4 and 2×0 and 2×2 will light up too
            3×6 => I need Vcc on R3 and Gnd on C6 => So 0×6 and 1×6 and 2×6 and 3×0 and 3×2 and 3×4 will light up too

            So in the end half of the table will be lit…

            However, one easy optimization would be to perform all “noise” measurements of the same column without any delay, because “noise” measurement is done with all emitting diodes off. So that would replace 7x14x2 = 196 delays by 7×14 + 1×14 = 105 delays, or almost double the rate…

          7. I spend exactly 0 seconds thinking about the matrix and what that implies :-) duh
            ok, so light up every second diode in same row
            0x0
            0x2
            0x4

            then move to
            1×1
            1×3
            1×5
            then
            2×0
            2×2
            2×4
            and so on all the way down, then move one left(0x1 0x3..) and repeat all rows (interleave), bonus points for updating the display state between the readings for lower latency – no need to wait whole frame if you already captured some data.

          8. I see your point.
            Indeed I could light up several rows in the same column at the same time and, provided they are far apart enough to avoid cross illumination, I could probably double or triple the rate. And with Arduino outputs able to provide 40mA max, powering several leds in parallel shouldn’t be an issue.
            Honestly, I don’t think I’m going to revamp this project because I moved on to other things now :-), but it was nice to discuss improvements, and hopefully others (or me in a future project) will benefit from it.
            KR, Vincent.

      1. There are already libraries to drive WS2812 with the Raspberry Pi. The use some hardware modules of the Pi, AFAIK including DMA, to generate the timing. You do not have to do everything bitbanging in software, although much arduino stuff is designed that way.

    2. I don’t know. The price works out about the same, and the “wasted transistors” leave options for adding new features later.

      More importantly, you could implement this in a few hours as opposed to a few days designing, testing, and debugging a more efficient circuit. Sometimes time efficiency is more important.

      1. STM32F103C8T6 minimal board is $2.5 free shipping
        offers dual 1MHz sampling ADCs with buildin muxes, 16 channels out of the box

        but the fact is I didint build anything, Vincent did :)
        Arduino thing was just my observation, its easy to spot a coder doing electronics this way ;-)

    1. Exactly, they are also called BHD (Black Hole Diodes), and they suck up all the light that’s around :-)
      More seriously, the data available on their page – https://www.aliexpress.com/item/x/32355315102.html – is a joke. That’s even the exact same data as on the emitter counterpart – https://www.aliexpress.com/item/x/32355514775.html
      The level of current these “receiving diodes” let through and their slow response make me think they are really phototransistors and not photodiodes, but any information is welcome…

      1. Really awesome project! The moment I saw it just thought… MUST HAVE :)
        I’m not into tinkering but giving it a try, and am now going for the interactive part.
        But.. … run into a wall now with the Glediator input calibration java part.
        I’ve managed to run my own simple Test Generator –
        but with my (non-existent) Java skills uncapable of doing the calibration generator myself.
        Any help with this code would be really appreciated !

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s