Why hello there! It’s been awhile since the last post, so let’s jump in! I’ve been busy with a few projects, and with another semester of college ending. One of these projects is 3D Tetris!
3D Tetris Completed!
Although this wasn’t too big of a project, it’s difficult to keep it in one post, so I’ll be splitting it into three parts over the next few weeks. I have other projects that are smaller, as well as old stuff I meant to post a long time ago, rediscovered. Hopefully that won’t turn you off here though! Now, getting into it, the photo from earlier should give you a good idea of what this project is. No? Let’s go into some more detail:
Cool ‘Advertisement’ artwork of 3D Tetris
It started back near the end of December 2013, when one of my professors had mentioned about the possibility of bringing in a project to one of the lower electrical engineering lab classes. After some thought, this is one of the projects that popped into my mind. I ended up suggesting something else though (a simpler project), but then never heard back after that point.
Not deterred, I continued on with the project. It started out simple – a LED Cube. These are a popular hobby project to do, and display art. Instructables has a lot of projects on how to build one. But I didn’t want to do something that had already been done, and looked like everyone else. So then I thought, “Hey, why not make this an interactive art piece?”. Immediately, some form of 3D game popped up. Not many games are possible for this scale, but some older ones, like pong, Tetris, Simon, Pac-man, and your generic platformer came to mind.
Pong was nice, but could get boring after awhile. Simon could be ok, but could easily get over-complicated, and then the fun would be ruined. Pac-man, although a nice idea, would be insanely difficult to implement on a low-cost budget. A platformer could work, but might take a large area of space to display correctly. Finally, Tetris was the winner. Low-cost, complex enough to hold interest, interactive, and doesn’t take up much space. And since the game field of Tetris is a rectangle, using the large LED cube as an art display when not running Tetris, would be feasible. Thus, 3D Tetris was born!
The Schematic for 3D Tetris PCB
After debating sizes for awhile, I ended up with a 4x4x12 display area. To drive the LEDs, I decided on the matrixed method, due to the low amount of visible wires going to the LEDs. For this 4x4x12 display, a equivalent 12×16 LED matrix was draw to visualize the 3D display on ‘2D’ paper. Two immediate concerns came up: powering 192 High Brightness LEDs could draw up to 6 Amps of current! Along with this, in order to display one pixel at a time, instead of an entire row, I need to switch the matrix’s pins very fast. If your lost on what I’m talking about here, try this article. It would take too long to explain the theory and control of the LED display.
The constructed LED cube connected to a large prototyping area
Then, just two problems remained: high current, and fast switching. It just so happen that these don’t like really working together. I ended up using some TIP31/32 transistors to handle the high currents. This later proved to be overkill, when I actually built the display.
Another problem then arose as I was prototyping, and noticed the LEDs were dim, due to the fast-switching (1kHz+). I removed the resistors to the LEDs (theory here), and then drove the LEDs with a PWM signal. Well, sometimes when you fix one problem, another arises.
PWM’ing 32 LEDs with two TLC5940 Chips
PWM is nice an all, but I’m PWM’ing 28 pins (12×16 matrix, remember?). That isn’t really possible with most microcontrollers on the market. The solution? The TLC5940 24bit, 16 channel PWM driver! Two of these expensive chips ( $6.17 each! Ouch! ) solved the problem. The schematic shown earlier in the post shows the TLC5940 implemented in the circuit. The circuit board was then ordered:
The Circuit Board!
Now, this is only my third PCB ordered, but don’t get me wrong, I’ve designed many using Eagle in the past. I just never could find a cheap enough PCB service. Oh yes, the board worked perfectly on the first version. It would just help though if you remembered to breakout the pins to RX and TX, so you can program the microcontroller with Arduino (those white wires on the photo)
Assembled circuit board, without LED matrix or LCD attached
With the board assembled, as above, I then added the LCD, and the main hardware is complete! But before I can get into the software just yet, I needed to add something. The video game controller. But that will come in the next post.
Now, I didn’t put any videos with this one, but the next post, the controller will include two videos! Until then, stay tuned, I got some other ‘small’ things that might happen before that controller is finished…
– Eastern FireTail