Electronics and lifestyle

Tag Archives: let table

Hello again my fellow readers. Today I present you an older project of mine, the LED coffee table.

The most difficult part was building the table itself and putting all the leds manually in their place.

The schematic and working principle is really simple. It would be very impractical to connect each led by itself, we would need 64 pins from the microcontroller. A better way to do this is by making a matrix, like in the picture below.

We now only need 16 pins, which is easy to manage. The problem in this configuration is that we cannot light up 2 or more specific LEDs without turning on some that we don’t want. If we turn on led[2,2] and led[3,3] we will also light up led[3,4] and led[4,3]. To do this, we only light up one row at a time very fast, so the human eye cannot see. This is how modern display works. In this project, we first ground the first row, turn on the led we want, then go to the next row, until the 8th, then repeat.

For this project I chose to use the very popular ATMEGA328, but we won’t hook up the matrix directly, we will use a shift register. Shift registers are really smart things, u send bits to them, either 1 or 0, which will turn on or off pins of the shift registers. For example if we send 00000001 it will ground every pin, except the last one, who will be VCC (usually 5v). I won’t go into further detail, you can read about them on wikipedia. Below is the schematic I used.

ATTENTION! I need to make one small remark. In my design, I also hooked the shift register outputs to transistors, and then to LEDs, because they cannot sink a lot of current. This design is ok if you want to use a chinese 8×8 led matrix, but for other LEDs please use transistors. (NPN for row / PNP for columns, but u can change this in software).

Here is the arduino sketch (it has some commentary, ask if you need anything, you can change the update speed for example) and this is a html page that generates patterns (credits to this instructable, I just modify it to be 8×8 ), just save it as patterns.h and put it in the same folder as the sketch.

Someone on reddit asked me “The LEDs seem far away from the top.. Is there a reason for that?”.

I didn’t use normal LEDs, but the ones with a flat top which have 100° viewing angle (normal LEDs have 30° if I recall correctly).

Then with a bit of clever math I calculated exactly how deep I will have to put the LEDs for a specific size of my table.

Let’s say we have a square of l = 5cm. The diagonal is l√2 (we need diagonal because we light up even the corners) and then we imagine a triangle like this, in the bottom is the LED (50° because it is only half). We apply tan(50) = 5√2/2 (only half, remember) / X . X is our height or how deep we have to put the LED and in this case is equal to aproximate 4,20.

Below is the video I made and some pictures. Enjoy!

PS. I know this is just very basic information, if you need any help, please ask in the comments below. I will try in the future to edit the code to read the pattern from a SD card or update it via wifi (ESP8266 🙂 )