loading

One of the electronics DIY kit jolliFactory came up with is the Bi-color LED Matrix Driver Module Kit. This module is designed to be chain-able so that you may daisy-chain the modules together to the number of modules you need to suit your project.

The following are some of the projects built using this Bi-color LED Matrix Driver module:

It is amazing to browse through instructables and find projects which may interest and inspire you to embark on the project or ignite new ideas for your project.

Tetris is a tile-matching puzzle video game released in 1984 and it was the hugely successful handheld version for the Game Boy launched in 1989 that established the game as one of the most popular ever.

Just for FUN, we thought we could build a simple Tetris game by daisy-chaining two of the Bi-color LED Matrix Driver modules together driven by an Arduino micro-controller simply by adapting similar projects found at instructables. We searched through the instructables here but did not manage to find any similar Tetris project to work on.

We expand our search to other online sites and managed to find some information which we adapted to build a simple Arduino based Bi-color LED Matrix Tetris game here.

To build this project, basic electronics knowledge with electronics component soldering skill and some knowledge on using the Arduino are required.

You may view the following YouTube video to see what we are building.

Step 1: Building the Bi-color LED Matrix Driver Module

We will be building a two LED Matrix tall Tetris game here driven by an Arduino Nano for this project. We will need two of the Bi-color (Red/Green) LED Matrix Driver Module Kits from jolliFactory. Each of these modules uses two MAX7219 Display Driver ICs to drive a Bi-color LED Matrix. These ICs are excellent because they take a lot of work off the micro-controller and simplify the wiring and logic design.

You can find this Bi-color LED Matrix Driver Module kit from here.

This kit comes with all through-hole components and someone with basic soldering skill should be able to assemble it without much difficulty.

See the following YouTube video on how to assemble the LED Matrix Driver Module Kit:

Step 2: Wiring

After all the LED Matrix Driver Module kits are completed, they are connected together with the Arduino Nano micro-controller as shown in the wiring diagram (LED Matrices not installed for better view).

For the game audio output, we used one 8 ohms 0.5 watt speaker driven directly by one of the Arduino’s digital pins through a 100 ohms resistor. Basic sound tone is used for this project and the low sound volume should be sufficient for a hand-held game with this simple setup.

Four SPST Panel Mount Momentary Push Button Switches are required for the project for navigation and rotation of the Tetris blocks.

Note the use of 10Kohms pull-down resistors on the DATA IN, CLK and LOAD input pins. When power is first applied to the micro-controller or when they are reset, their I/O lines float. The MAX7219 can see this as valid data and display garbage until the micro-controller gains control. The pull-down resistors prevent these problems. To reduce the part count for this project, you may try without the 10Kohms pull-down resistors for the DATA IN and CLK input lines.

Except for the two Bi-color LED Matrix Driver modules and the four push button switches, we hook up the entire circuit on a small piece of perf-board around 60mm x 60mm in size.

Note that there are four PCB mount push buttons on the perf-board in the photo. We initially used them for the game control but after building a simple enclosure for the game, we decided to use four panel mount push buttons instead for better game control. We parallel wired our panel mount push button with the PCB mount push buttons so game control can now be performed using either the PCB or panel mount push buttons.

Edit:For those who do not want to mess around with too much wiring using perf-board, jolliFactory have designed a bare interface PCB board suitable to build this project. If you are using this interface PCB board, do remember to change the speaker output digital pin from D9 to D8 in the sketch downloaded from this instructable to drive the speaker.

You may find our bare interface PCB board at https://www.tindie.com/products/Nick64/jf-interface-board-1-bare-pcb-board-with-headers/

Step 3: Programming the Arduino Board

The Arduino board needs to be loaded with the Arduino sketch to run the display.

We used Arduino IDE V1.03 for our project. Download the Arduino sketch below for this project.

Download jollifactory_Tetris_V1_1.ino

The Tetris game sketch we have here is very basic without any game levels and scores. You may amend and enhance the sketch.

Note: Having some problems with your Bi-color LED Matrix Display modules? Download the following test program to test each of your modules separately. The display should light up RED, GREEN and ORANGE in sequence row by row to fill up the entire display repeatedly.

Download jolliFactory_Bi_Color_LED_Matrix_Test_Check.ino

Step 4: Enclosure and Assembly

As this project is simply built for the FUN factor with no intention of using it for long, we did not pay too much attention to build a proper enclosure. However, the enclosure built should enable the player to hand-held the gadget to play quite comfortably.

What we have for the enclosure is a cardboard box backing with a blue tinted acrylic protective front with the game control push button switches mounted. We did not even secure the modules to the enclosure as they fit quite snugly in the enclosure.

We will not delve into the detail on how we build our game enclosure here. The pictures show the various stages of assembling the completed sub-modules together.

<p>Hello, I would like to ask two points after the matrix, the synchronization ran out of the box (pictured), which side is wrong?</p>
<p>I'm trying to connect 3 or more LED matrices to add on</p><p><br>It seems to skip one Matrix and moves on to another, even when you define the number<br><br>is there something that I need to do to amend the code to work with 4 matrices in series?</p>
Hola, gracias por este post muy bueno, logr&eacute; hacerlo pero no me funciona bien, a ver si pueden ayudarme <br>Use 2 matriz 8x8 single color, y me aparecen d&iacute;as y las piezas salen de un lateral, gracias por la ayuda
<p>can we add another lcd for score and highscore?? and game difficulty??</p>
<p style="background-color: transparent;">Yes. It should be possible to connect a separate LCD for display. Use a I2C LCD Display for ease of interfacing though it is a bit more expensive. You will need to modify the code yourself to implement score display and game difficulty. </p>
<p>can i use this led matrix? </p><p>https://www.amazon.com/gp/product/B00AYAPB9Q</p>
<p>No. That LED matrix display is a single color display. We are using a bi-color LED matrix display for this project which we are able to make it light up in three colors . You may find online for Tetris games implemented using a single color display or modify our Arduino sketch to work with it. We prefer the bi-color LED matrix display for implementing this game as it makes the game look more interesting.</p>
<p>and what arduino can i use if i don't have arduino nano??</p><p>thanks for the answer.</p>
<p>The entry level Arduino UNO should be a good choice. It is very similar to the Nano except for the size.</p>
<p>thank you sir! </p>
<p>One question, I do not have the bi Matrix color, which would only be having one color, that part of the exchange code, leaving only one color?</p>
<p>can we add a score and highscore?? and game difficulty??</p>
<p>How do you actually wire all of them on small piece of board???</p>
<p>We used perf-boards with copper dough-nuts and solder thin wires for point to point connections.</p>
<p>Im currently interested in building this project,however I'm currently getting the error &quot; Programmer is not responding&quot; so im just curious in what &quot;programmer&quot; did you use in the &quot;tool&quot; selection in the arduino program?</p>
<p>Since we are using the Arduino Nano, we do not need any programmer to program our Arduino. If you are using Arduino IDE 1.0.6 for program upload, then under Tools -&gt; Board, simply select Arduino Nano w/ ATmega328 and then upload the program to our Arduino board by selecting File -&gt; Upload.</p>
<p>I've tried to do the steps abovr but i still cant upload it. I've searched around and the usual answers are to check the port in which i cant select it as it was greyed out. I can't even find it in the device managers. Any help? Ive tried all kinds of way to install the drivers and even reinstalling the program</p>
<p>Your problem probably lies with the Arduino board you are using. You may need to check with your Arduino vendor on how to install the driver for your board especially if your Arduino board is a clone.</p>
<p>Hi, I made this using Colorduinos and RGB LED Matrices via I2C addressing<br>Thank you for the tutorial! </p><p>code: <a href="https://github.com/msg91b/Colorduino-Tetris" rel="nofollow">https://github.com/msg91b/Colorduino-Tetris</a></p>
<p>Are you using the exact Bi-color LED Matrix modules as in thus project?</p>
<p>The two led matrix displays the same output. how to fix the or have any one with a functioning codes?</p>
Yaaaaaaaasssss!!!!!!<br>Finally, problem solved!<br>I found out it was my bad soldering skills. I forgot to solder one little hole that caused a big problem. Now the game works just fine<br>Thanks Jolli for such a great idea and coding
<p>Glad you managed to find and rectify the fault. This bi-color LED Matrix module is designed to be modular so you may chain them up to form longer displays if your project requires longer displays. Check out our other instructables using this LED Matrix module and also other interesting projects by searching using jollifactory as the search keyword here. Cheers!</p>
Ok I found out the problem<br>2nd led matrix not working properly
<p>Hi</p><p>Ive got a problem with my tetris. Ive got 2 led matrices connected but it works only for 1 bottom led matrix, so the game starts in the middle and the top led matrix just stays turned off. Although when I connect Arduino to the pc the top matrix turns on green for a few seconds and then turns off</p>
<p>First test each of your modules separately to make sure they are working.</p><p>You may go to Step 3: Programming the Arduino Board to download the jolliFactory_Bi_Color_LED_Matrix_Test_Check.ino sketch for testing.</p><p>The display should light up RED, GREEN and ORANGE in sequence row by row to fill up the entire display repeatedly.</p><p>BTW, did you connect the 10K pull-up resistors?</p>
<p>Hello .. Good evening!<br> I 'm interested in your product , but as I live in Brazil worry about the time , you could say that arrive in less than a month?</p>
<p>We send the items via SingPost and normally takes 6 to 12 working days for items to be delivered after shipping which should be around 3 weeks.</p>
<p>Hello .. Good evening!<br> I 'm interested in your product , but as I live in Brazil worry about the time , you could say that arrive in less than a month?</p>
<p>Hello .. Good evening!<br> I 'm interested in your product , but as I live in Brazil worry about the time , you could say that arrive in less than a month?</p>
<p>Hello, how are you?</p><p><br>I'm attending the second year of high school with integrated mechatronics and received a proposal from school to set up a project using Arduino, I started researching and I was very interested in the Tetris game. I'm based on your game, but I'm having difficulties in construction.<br>I saw your KIT (AX7219 Display Driver ICs) and I was interested, but I'm afraid that doesn't arrive on time, since I live in Brazil. I wonder if you could say an estimated time for delivery with and without delay (if the product is stopped because of tariffs, laws, etc.) and would also like to know if you have the design that was used in Bare Bi-color plate LED Matrix Driver Module PCB to provide. </p><p>Thanks</p>
<p>Thanks for your interest in our product. We ship our products via SingPost and it normally takes 6 to 12 working days for delivery baring any unforeseen circumstances. We are sorry we are unable to provide you our PCB design.</p>
<p>what parts of the code should i delete if i have no speaker connected?</p>
<p>There is no need to delete any part of the code even if no speaker is connected.</p><p>If you really would like to clean up the code so as not to use the speaker, then delete the following two routines in the code and any calls to these routines;</p><p>1. void TriggerSound()</p><p>2. void playTone() </p><p>and find the following in the Arduino sketch and delete them;</p><p>/* ============================= Audio ============================= */<br>int speakerOut = 9;<br><br>#define mC 1911<br>#define mC1 1804<br>#define mD 1703<br>#define mEb 1607<br>#define mE 1517<br>#define mF 1432<br>#define mF1 1352<br>#define mG 1276<br>#define mAb 1204<br>#define mA 1136<br>#define mBb 1073<br>#define mB 1012<br>#define mc 955<br>#define mc1 902<br>#define md 851<br>#define meb 803<br>#define me 758<br>#define mf 716<br>#define mf1 676<br>#define mg 638<br>#define mab 602<br>#define ma 568<br>#define mbb 536<br>#define mb 506<br><br>#define mp 0 //pause<br><br><br>// MELODY and TIMING =======================================<br>// melody[] is an array of notes, accompanied by beats[],<br>// which sets each note's relative length (higher #, longer note)<br>int melody[] = {mg};<br><br>// note durations: 4 = quarter note, 8 = eighth note, etc.:<br>int beats[] = {8};<br><br>//int MAX_COUNT = sizeof(melody) / 2; // Melody length, for looping.<br>int MAX_COUNT = sizeof(melody) / sizeof(int); // Melody length, for looping.<br><br>// Set overall tempo<br>long tempo = 20000;<br>// Set length of pause between notes<br>int pause = 1000;<br>// Loop variable to increase Rest length<br>int rest_count = 100; //&lt;-BLETCHEROUS HACK; See NOTES<br><br>// Initialize core variables<br>int tone_ = 0;<br>int beat = 0;<br>long duration = 0;</p>
<p>Can someone please explain to me how to do this with 4 single colored max7219 modules? Or how to modify this code... I would really appreciate that.</p>
<p>you suck</p>
It works fine but no Sound!
<p><em>Just to check - </em></p><p><em>Did you connect the speaker to digital pin 9? </em></p><p><em>What type of speaker are you using? <br></em></p>
Yes i did. It is 8Ohm Minispeaker. The Speaker sounds for Test on the Pins to Led-Driver. But on Pin9 is nothing to hear.
<p>I verified the wiring circuit to be working with my sketch provided here. I am not sure what is wrong with your circuit.</p><p>Which Arduino board are you using and did you modify the sketch downloaded here? Did you connect the 100 ohms resistor between pin 9 and the speaker? </p>
Yes, the 100R Resistor is used. I dont modified the Programm and i use an Arduino Nano Board. The Sound is the only Thing missing.
<p>For your connection, are you <em>using our bare interface PCB board at <a href="https://www.tindie.com/products/Nick64/jf-interface-board-1-bare-pcb-board-with-headers/" rel="nofollow">https://www.tindie.com/products/Nick64/jf-interface-board-1-bare-pcb-board-with-headers/ </a></em></p><p><em>If you are wiring it yourself, you may have to check your connections again.</em></p><p><em>If you are familiar with Arduino programming, you may change the sketch to output the sound through pin 8 instead and connect your speaker to D8.</em><br><em></em></p><p><em><a href="https://www.tindie.com/products/Nick64/jf-interface-board-1-bare-pcb-board-with-headers/" rel="nofollow"><br></a></em></p>
I have two led matrix module with just one MAX7219 and just one color. Is it possible to build it with this instructions?
<p>It is not possible to drive 2 single color 8x8 LED Matrix with just one MAX7219 IC. You need one MAX7219 IC for each single color LED Matrix. So you need 4 of these MAX7219 ICs to drive 2 Bi-color 8x8 LED Matrices for this Tetris project.</p><p>You may purchase the LED Matrix DIY kit from https://www.tindie.com/products/Nick64/60mm-x-60mm-bi-color-led-matrix-driver-module-diy-kit/ with generic MAX7219 ICs included.</p>
<p>awesome idea and coding.<br>almost done building it but i have a little bit problem here, Ihave 4 max 7219 ics.<br>can you give me schematic of display driver to make one myself?</p>
<p>Sorry. Just found out I missed your request.</p><p>Though not exactly a schematic of the display driver, the block diagram in the link below should help you to make one yourself provided you have the right Bi-color LED Matrix:</p><p>http://jollifactory.blogspot.sg/2013/08/bi-color-led-matrix-driver-module-diy.html</p>
<p>This instructable was uploaded on 5 Jun 2014 and I found it was mentioned in an article at atmelcorporation's site 'Celebrating Tetris with Arduino

'. I am surprised to learn that Tetris was programmed by Alexey Pajitnov and the game was released on June 6, 1984 which coincidentally is exactly 30 years ago if I had uploaded it one day later. You may visit </p><p>http://atmelcorporation.wordpress.com/2014/06/06/celebrating-tetris-with-arduino%E2%80%A8%E2%80%A8/ to read the article.</p>
<p>So clean looking! That is an awesome platform.</p>
Nice 'ible! It seems like something I could play for an hour straight and be okay with it because I built it XD.

About This Instructable

43,209views

150favorites

License:

More by jollifactory:IKEA Frame Hack > sLOMO (Slow Motion) Frame JolliCube Audio/Music Visualizer JolliCube (8x8x8 LED Cube) with MD_Cubo library 
Add instructable to: