loading

A while ago I build a 10x10 LED-Coffetable with some of these WS2812 LEDs, but even if it is possible to play the old-school game Snake with a smartphone connected to it, I want something more special. So I decided to put a few more leds to it, arranged as a cube in order to get more possibilities creating animations as well as games and here we are: the RGB-Brick.

I would like to thank the whole team of LED-STUDIEN who funded that project, but specially Dennis Jackstien as my contact person. Without their assistance I wouldn't be able to build this charming LED-Cube.

Step 1: Get Inspired!

Here are a few pictures and a small video with some of the capabilities of the Brick, including plenty of animations, a (work in progress) fire for heated atmosphere, a music visualizer and the games Snake as well as Tetris.

Step 2: What You Need

Here is a list of all the materials you need, some of them are not necessary and others can be exchanged by your favorites:

  1. 500 WS2812 LEDs 30px/m
  2. 5V 30A power supply
  3. Teensy 3.2
  4. ESP8266 wifi-modul
  5. some pieces of wood:
    1. 1x: 27,2cm x 27,2cm x 1,0cm, for the lid
    2. 2x: 29,6cm x 27,2cm x 1,0cm, for the large side panels
    3. 2x: 25,2cm x 29,6cm x 1,0cm, for the small side panels
    4. 1x: 34,0cm x 34,0cm x 1,9cm, for the bottom
    5. 8x: 34,0cm x 4,6cm x 0,3cm, for the edges of the LED grid
    6. 100x: 34,0cm x 3,3cm x 0,3cm, for the LED grid
  6. some pieces of acrylic glass:
    1. 1x: 34,0cm x 34,0cm x 0,3cm
    2. 2x: 34,0cm x 36,3cm x 0,3cm
    3. 2x: 34,6cm x 36,3cm x 0,3cm
    4. 1x: 10,0cm x 7,5cm x 0,3cm (optional, for the terminal)
  7. Teensy audioboard (optional)
  8. Wires,voltage regulator, cable clamps, buzzer, button, temperature sensor (optional)
  9. wood glue, acrylic glass glue, screws and other little things

If you want a terminal at the bottom of the cube (it's optional expect for the power jack):

  1. 230V power jack
  2. 230V switch
  3. audio jack
  4. USB extension cable

Step 3: Building the Box

First of all we are going to build the wood box and the LED grid. The dimensions of the cube are specified by the distance of the pixel on the LED strip. In this case the pixel have a distance of 3,4cm, so the cube has to be 34 x 34 x 34cm. You will save a lot of time using this dimensions, because you need not to cut the strip after every pixel and put it back together by a small cable.

All comes together with some wood glue. You have to work properly cause the acrylic case matches perfectly on top of the wood box. It is getting much easier with some volunteers around you, or just use a frame tensioner like I did.

The edges of the grid and the grid itself are made of high density fiberboard (HDF). Using a table saw is the best choice because you have to cut even more than 100 pieces of them. You can find the dimensions in the picture above. The grid needs a small gap (about 0,3cm) every 3,4cm in order to get the x and y ledges together. Once you are done, you can put the edges to the cube and fix them with a lot of wood glue. It's a bit difficult, especially because they should have an angle nearly about 45 degrees. Before you can attach the grid to the cube you have to add the LED strips.

Step 4: The Electronics

The LED strips on the side go once around the cube, therefore cut 10 strips with the length of 40 pixel. For the LEDs on top of the cube cut 10 strips with the length of 10 pixel. Be careful to align the strips correctly by regarding to the arrow on them. Once you remove the glue strip off the cube it will never hold like the first time.

The power supplies are fixed with some screws on the sides of the interior. The power cables from the LEDs are getting into the box by some small holes near every LED strip.

The controller consists of a Teensy 3.2, an ESP8266 and the Teensy audio board, which is not required to run the cube. The DHT11 was just for checking the temperature inside the cube but after multiple tests about a few hours I can say that you can leave it out.

On the terminal you can find the power jack as well as the power switch (when I realized that this isn't the best place for a switch it was too late). The USB jack is for programming the Teensy. The audio-in goes to the Teensy audio board for acting the LEDs to the music. All this comes together on a small peace of aryl glass holding by two aluminum profiles. Just found this in the garage, you can use whatever you want because its covered by the bottom wood panel and does not contribute to the look of the cube.

Be aware that one LED uses 60mA, in total that's 30A! Be careful when you hook them up! You have to verify all your circuits before you connect them to the power supply!

Step 5: Connections and Coding

The LEDs are connected as two matrices on pins 3 and 20 on the Teensy. The first one is the matrix on the top (10x10, 100pixels) and the second one is the on the side (40x10, 400pixels). The LEDs of the top matrix are aligned in a zigzag pattern, meaning the arrows on the strip have to be in different directions for every strip, whereas the LED strips on the side are aligned in the same direction. Have a look at the pictures, the red line will show you how to connect Dout of the first strip to the Din of the next one, hope that will help you understanding the alignment.

For the animations and games I'm converting the two matrices into one by the size of 10x50 using the following function:

void setXYPixel(byte x, byte y, CRGB c) {
  if (x <= 39) 
    matrix_bottom(x, y) = c;
  else
    matrix_top(x - 40, y) = c;
}//end setXYPixel()

For the Snake game you need to implement some special cases:

  • When the snakehead hits the upper row of the side matrix it has to switch to the matrix on top.
  • When the snakehead hits one end of the top matrix it has to switch to the bottom matrix.
  • When the snakehead hits the last or the first column of the side matrix it has to switch to the first respectively last column.

For the Tetris game you need something similar to this for a field starting in the upper left corner:

void setXYPixel(byte x, byte y, CRGB c) { 
if (y < 10)
    matrix_top(x, y) = c;
  else
    matrix_bottom(x + 10, 19 - y) = c;
}//end setXYPixel()

Step 6: The Acrylic Cover

More difficult than the wood box due to the smaller thickness, but with enough time and good ideas for keeping the cube together while the glue gets hard you will get this together. I'm surprised about the strength of this acrylic glue (Acrifix), so I think you don't have to worry about a broken case.

Step 7: Bring It Together

After you completed all the steps before it's time to bring all parts together. When you didn't merge the LED grid yet, then now it's time to do so. I do not glue the grid to the cube because there is no need for it and in case of a broken LED you can exchange it with no problems, however you need to have more than two hands to hold the five grids to the cube and put it in the acrylic cover. Last but not least you can screw the bottom wood panel to the cube. The cover is fixed to the bottom wood panel by eight very small screws.

Step 8: Software and Controls

The sketch on the Teensy is based on the FastLED library which includes several basic animations. Adding the RGBLEDS library package to your sketch brings powerful matrix algebra for displaying text and 'sprites' with plenty of example sketches as well. If you want to play Tetris as well then refer to the instructable from jollifactory, even if it uses only a bicolor matrix.

The smartphone app is based on NetIO by David Eickhoff which has a very good documentation. With the NetIO-UI-Designer you can create your own user interface with buttons, sliders, labels and much more. You can choose the protocol for the outgoing messages in the designer. In my case I took the simplest one - UDP. The messages are send to the ESP8266 by my home network and the Teensy will evaluate the content and handle the specified command. You can use the attached file to get started to create your own interface or just use an app of your choice.

Step 9: Build Your Own and Enjoy

Now it's time to get the parts and build your own Brick. If you have any questions feel free to ask.

For more videos you can check my Youtube-Channel as well as the channel of LED-STUDIEN. It's still a work in progress so there will be more material in the future.

German instructions can be found here in a couple of days.

Thanks for reading and have fun playing Tetris or other nice games on your own Brick!

<p>Amazing ! This is really nice, congrats !<br>I thing I'll try it with my son.<br>Wood working and coding is not a pb for me but i'm a newbie for the electronic part.<br><br>Is it possible to get some additional pictures on LEDs connection (Do you use connector clip, welding, ...)<br>finally if you could provide some ebay / amazon link for electronics parts (arduino, buz, ...) I'm able to do some search on internet but as it's my first try I'm afraid to buy a lot of wrong items before success :(<br><br>Thx<br>Christophe</p>
<p>Thank you! Good luck to you.<br>All the rows of the strips are welded together and only the first pixel of each matrix are starting with a simple 3-pin JST connector. (In the picture you can see one male connector which comes from the end of the side matrix but it is unused. Only the females are going to the controller board.) The connectors are getting into the cube by small holes in the edges.</p><p>I'm getting mostly all of my parts from www.exp-tech.de, like the Teensy 3.2: http://www.exp-tech.de/teensy-3-2. But these are shops in germany. I don't know where to buy electronics in other countries. For the LEDs you can refer to AliExpress. A good reseller is Ray Wu: https://de.aliexpress.com/store/product/BLACK-PCB-5m-DC5V-WS2812B-led-pixel-srip-IP68-30pcs-WS2812B-M-with-30pixels-reverse-protection/701799_926778326.html?spm=2114.8147860.0.0.mxgmWE. Hope this will help you a bit.</p>
<p>Many thanks</p><p>I know what to do this winter ;-)</p><p>I'll keep you in touch if we success or if we need some additional help but it sounds pretty clear.</p><p>Christophe</p>
<p>You're welcome!<br>Feel free to ask if there are any questions. I want to see some pictures if your brick is ready! :)</p>
<p>Hi</p><p>To get u in touch, we did some progress, we are closed to finish wood work. Leds &amp; teensy are there but still waiting power supply from China ... </p>
<p>Wow! It is very crazy to see the wood work of another Brick! <br>Hope your work is going well and your brick is ready soon :)</p>
<p>Hi, Yep i finished to solder wire and leds. I start some test and after a very nice first shot with only the top matrix working very well, I'm stuck since I tried to make the both working together.</p><p>I think it's related to how my teensy is powered (I put the top matrix + 4 lines on one supplier and 6 lines + arduino on the other supplier) and unfortunately nothing is working. I'm becoming crasy, trying to pilot one matrix is swithing led on the other ...)</p><p>Is there any attention point on arduino and ground ? </p><p>The power supply must be connected in parallel or series ?</p>
<p>Hi, to keep you in touch, I finished to make it :-) It works very fine.</p><p>Posted some video there <a href="https://plus.google.com/112961673979406941024/posts/duhprz8d5vd" rel="nofollow"> https://plus.google.com/112961673979406941024/pos...</a></p><p>I upgraded the wifi part of ESP8266 by adding wifi manager that allow to change of wifi access point easily without flashing the esp ;-) </p><p>I also add a small box (3d printed) with 3 buttons to do basic control without having a phone.</p><p><a href="https://github.com/ouaibsky/RGB-Brick/tree/master/ESP_Wifi_Manager" rel="nofollow">https://github.com/ouaibsky/RGB-Brick/tree/master/...<br></a></p><p>Still have to implements an android app ... that's the final part.</p><p>Thx again for all your help and amazing idea.</p><p>Christophe.</p>
<p>I get a couple of questions on your breadboard picture:<br>* Voltage is 5V, all components works under 5V ?<br>* Why the buzzer is plugged on the wifi module (and not directly bound to the tensy)<br>* What is the component V-REG ?<br>* The switch in the middle is gonna switch off/on only the wifi ?<br>* Why using a Tensy (looks like it required special IDE) ? Is there a chance to work with any other arduino ?<br>* Last but not least: should it be possible to catch sound through a mic (I though at equalizer capabilities) ?<br><br>Regards<br>Christophe</p>
<p>1. Only the ESP works with 3.3V. The LEDs and the Teensy works with 5V. You don't need a voltage regulator when you use a Teensy 3.2, because its regulator on board can handle the max current for the ESP.</p><p>2. I have added this buzzer only to verify the wifi connection. It beeps only the first time when the brick has power and there is a command from the iPhone. Other sound effects can be played by using the Teensy audio board.</p><p>3. V-Reg is the voltage regulator mentioned in the first answer. Cause the ESP can handle only 2.6-3.6V you have to regulate the power from 5V to 3.3V.</p><p>4. The switch resets the wifi module (ESP). It does not turn the wifi on or off, it was just to test the wifi communication and it is not necessary.</p><p>5. You can use any controller of your choice, but the Teensy uses the same Arduino IDE as an Arduino or an ESP. You only need to update the IDE to (I think) 1.6.5 or higher. Follow these instructions to get the boards-manager in your IDE: <a href="https://github.com/esp8266/Arduino"> https://github.com/esp8266/Arduino</a></p><p>6. Of course this is possible! The Teensy audio board has direct pinout for a mic, but even if you don't use the audio board you can attach a mic to your microcontroller: <a href="https://learn.adafruit.com/adafruit-microphone-amplifier-breakout"> https://learn.adafruit.com/adafruit-microphone-am...</a> </p>
<p>Hi Moekoe,</p><p>excellent instructable good job! </p><p>One question can you flash the ESP8266 straight from the Teensy setup you made or do you need a flash tool for that?</p><p>thx,</p><p>Rob</p>
Thank you very much!<br>No, I am not able to flash the ESP straight from the Teensy, but actually you just need to programm the ESP only once. Just plug it in a breadboard, connect it to an FTDI Converter and program it with the Arduino IDE.
<p>OK thanks Moekoe,</p><p>Somehow I am not able to connect with my phone yet, although the flash went OK and it shows up in my network, did you had similar problems?</p><p>Thanks, Rob</p>
<p>Hi Moekoe,</p><p>I continue to implements your cube after some troubles with leds it's now ok.</p><p>Time to build the acrylic frame, I would like like it in black or grey.</p><p>Can you tell us the level of transparency / opacity that is acceptable. it it better black (it's often 0-5% of transparency) or gray or something else ?</p><p>It's quite expansive (80e) and as I can only order on internet I want to be sure to order a color that will be the good one</p><p>Thx</p><p>Christophe</p>
Hi Christophe!<br>So your work is ready soon :)<br>I used white acrylic glass with a transparency of 30%. The glass reduces the amount of light more than I thought first, so I think black acrylic with 5% or even less than 5% will be too dark, even if I expect it will look pretty good! Would be nice to see your Cube in a black housing, but maybe you find some black acrylic with more than 30% of transparency.. <br>Moritz
<p>I&rsquo;m really sorry for my question </p><p>If I use the Arduino board so what i'll change </p>
<p>Nothing will change, just your controller board has to fit to your microcontroller</p>
<p>Can i buy one?</p>
<p>Dear Moekoe,</p><p>Please provide me at least with the Teensy sketch so far, I am willing to pay for it. I drawed all the cube in vector so i can be cut by a laser. If successful and you want it I will upload it so other fans can use it.</p><p>You can contact me: shadowfox64*hotmail.com</p><p>Regards John</p>
<p>Hi John,</p><p>sorry for the late response. I have updated the instructable with the Teensy and the ESP code, hope this helps. :)<br>It would be great if you can send me your vector designs, especially because I have just finished to build my own laser cutter. I think there will be an instructable of it in the future. :)</p><p>I hope it is clear to you that I want to see some pictures of your Brick! :D</p>
Hi Moekoe,<br><br>Thanks so much for the update, i will start building it right away :)))!<br>Own lasercutter? Wow thats an another cool project, very curieus!<br>My friend owns a professional one (runs a small company too) and it testing and improving the files now for me.<br>Maybe he can provide a very reasonable priced &quot;kit&quot; with all the woodwork needed to build the cube. His idea was to cut out already small areas in the corners so the strips are easily placed.<br>As soon as i know the files are correct, i will send them to you!<br>And of course you will receive the photo's from both the builds!<br>When ordering leds be careful to buy the bare strips (not covered with plastic to make them waterproof), the Ali Express ones are the &quot;wrong&quot; ones it looks like, although it might be possible to cut them out..<br>Thanks again! regards John <br>
<p>Great job! However additionaly to the electrical diagram already requested please also provide the full software as you integrated it (instead of links to other projects).</p><p>How much do you estimate the total cost?</p><p>I'ma also working with pixelated surfaces and trying to setup a Python lib to handle 2D and 3D surfaces (noth as fast as FastLED though). My idea is to stretch automatically the game to the full 2D or 3D space dependending on a shape descriptoronly discovered at runtime.</p><p>How are the faces of the cuve represented in your Snake? A 3-dim array colors[face][row][col] works, but how to know e.g. which coordinates has the pixel at the right of some given pixel? An automatic mapping cartesian -&gt; polar coordinates would also allow to automatically run the same apps on round/spherical shapes.</p><p>Are you using Bluetooth to transmit the audio stream of the music visualizer or only jack cable? Do you try to autoadapt the number of samples (range of the Y axis) according to the average volume of the input stream somehow?</p><p>Subsidiary question: Have you though of making it touch-compatible? With IR, capacitive, pressure sensors...)</p>
<p>Thanks!<br>I don't want to upload my whole code yet. But I just added another step with some pixel assignments. </p><p>The total cost are about 350-400 Euro, but as I told in a comment before you can save a lot of money (maybe the half) by ordering the parts at AliExpress for example.</p><p>Have a look at the new 5th step. I was using the simplest solution in coding, but therefore I have to convert the snakehead to the correct position at the specified cases. The body of the snake is just following the head. Polar coordinates would be very nice but implementing them on the brick at this time is too difficult for me.</p><p>No, I'm just using the jack on the bottom of the cube. The music visualizer is based on the fast fourier transform. I have not had enough time for testing the audio connection more then just with this simple visualizer.</p><p>I have though about this while building my 10x10 coffeetable, but for the brick it will be to expensive. The 500 sensors would break my budget for this project.</p>
<p>Amazing project, congrats!</p><p>I was able to install the NETIO with your JSON file, it works fine!</p><p>You stated above that you not want to upload your code yet, but is there an estimated release date? Electronics and woodworking is no problem for me, but i will never figure out how to design a Teensy sketch.</p><p>So before i start this beauty I will wait for your Teensy code,</p><p>Thanks for your inspiration!</p><p>Regards Frank</p>
<p>Dear Moekoe,</p><p>This is awesome and me and my friend want to built it, but can you please give detailed info how to connect all the leds and the schematic from the breadboard please? I not understand the drawing you make with all the numbers, but I want this baby, love it! Regards John</p>
<p>Hehe. Let's me display all Minecraft bricks in one place :-)</p>
<p>I have the same idea and will make one to display all minecraft brick!!</p>
<p>Its similar to a cube im working on, but at a much larger scale.</p><p>Mine is only 10cm cubed :P</p>
<p>And a video of it with the housing: <iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/-eJGjzmacWY" width="500"></iframe></p><p>This is it running the same animation as before, just inside the laser cut acrylic housing.</p><p>I'm not super happy about how much the light bleeds, but it still looks good :)</p><p>The housing is 3mm black acrylic laser cut to go around the pixels, then a 3mm white acrylic over the top.</p><p>The capacitors on the panels stick out a bit, so there was a gap between the PCB and the black acrylic, which caused massive bleeding. To fix it, I laser cut some foam in the same pattern as the black acrylic and stuck that on.</p>
<p>That looks very nice! I love the blurred look. :) Why do you use both the white and black acrylic?<br>And of course the question: Why do you don't write an instructable about it? </p>
<p>A video of it before it got the housing: <iframe allowfullscreen="" frameborder="0" height="281" src="//www.youtube.com/embed/oZaLT4RJ0Pg" width="500"></iframe></p><p>I'm using a particle photon instead of a teensy + ESP.</p><p>This is running some of the OPC and fadecandy samples on the computer, and I wrote an OPC handler on the photon to display it.</p><p>Now I need to make some software that can actually calculate 3D visuals and compose them together!</p><p>The existing OPC effects are all working on 2D, and dont wrap around the edges of the cube nicely.</p>
<p>This is both so cool! When watching the video I didn't get the scale at all, I thought it was sitting on a table and only about 10cm big :D</p><p>Big is nice too, but I think this would be even cooler to have as something you can hold in your hand. Maybe even with a 9dof IMU to sense orientation and movement. And round edges and really smooth so people won't be able to keep their hands off it. Like a bright curiosum ;)</p>
<p>You're dreaming exactly from the QCoo: <a href="https://www.kickstarter.com/projects/788278700/qcoo-the-world-first-3d-snake-cube-with-ar-and-led?ref=discovery"> https://www.kickstarter.com/projects/788278700/qc...</a></p><p>It's a brillant idea, but I don't now where to get that much power to drive all the leds. The only solution is to power the leds with about 20% of brightness in order to run them by battery.</p>
<p>Very nice! :)</p>
<p>This is pretty insane! WOW :O</p>
<p>Thank you so much for this awesome project. Will definitely make one! Could you please upload pictures of the electrical scheme and wiring of the LED strips to one another?</p>
<p>No, thank you!</p><p>Just added the 5th step. Hope this helps.</p>
<p>Dude, I love this. Good job!</p>
<p>This is EXTREMELY cool! I love this project. Definitely added to my favourites.</p>
<p>Just pick up the parts and build your own! ;)</p><p>Thank you!</p>
<p>how to connect the electronics? cuz its not very clear in the instruction</p>
<p>Yeah, I didn't want to go into detail that much, because my english isn't that good. I will add the connections in a couple of hours!</p>
<p>To the one who mentioned the donating party: The pixels are very inexpensive as are the controllers to run them. I order my pixels direct from Chine via AliExpress and multiple companies make controllers capable of this for under (or around) a hundred bucks.</p>
Yes, you're right. If my next project will not have a sponsor I will buy the leds from AliExpress too.
I specifically suggest Ray Wu, store# 701799. He's a major supplier for the Christmas decorating groups and is always quick to respond and very helpful. He can also do special orders and custom work as well.
<p>I've heard of him in this post: <a href="https://plus.google.com/103458998373117296828/posts/bNrHBbjgysZ"> https://plus.google.com/103458998373117296828/pos...</a></p><p>Thank you. I will keep that in mind and order them at his store.</p>
<p>This would be a lot of fun, I love Tetris :) Great instructable!</p>
Thanks a lot! :)
<p>Very nice, if only i had a donating party like you had ;-)</p>
You just need a good idea, a good contest and a little bit of luck ;)

About This Instructable

31,969views

387favorites

License:

Bio: My name is Moritz and I'm an electrical engineering student from germany. My favorite electronic parts are LEDs.
More by moekoe:Dodecagon Light With RGB, Lightbulbs and Wifi 500 LED-Pixel RGB-Brick 
Add instructable to: