The Story of Project

In short, this project is the result of a challenge. One day, a friend who was visiting me, saw my experiments with some led matrix and ask me if I can control many of these. I answered "yes certainly", using auxiliary integrated circuits can be controlled a large number of LEDs.

I started doing research and after I saw many projects I have concluded I need a ready-made panel and start my experiments from there. Also I wanted to skip monochrome panels and try with multicolor LEDs.

I observed that RGB panels are a little more expensive than dual color panels (the price difference is noticed especially when you plan to buy many).

So I decided to start with this panel: http://www.gearbest.com/development-boards/pp_65373.html which I think would best fit my future plans.

Priced at $ 13.91 is the best price that I could find (at the time I made the order).

I must say that this panel is why I "landed" at this store in the first place. Meanwhile I made several orders (from "Development Board" section)... and I will return with other articles if I manage to do interesting things with them.

Step 1: Components

The panel came as a kit. I guess that panel is used to make large displays available as finished product at some specialized vendors/manufacturers.

However, this panel assembly requires soldering of many SMD components. This requires careful planning of the sequence in which components will be soldered.

In the next steps I will show sequence that worked for me.

Step 2: PCB

PCB is very well done, the markings are visible and useful. Identifying the place for each component is easy.

The most important thing is to finish with SMD components before proceeding with thru-hole components.
Also it is necessary to mount bolts and nuts before soldering LED matrix.

Step 3: Soldering SMD Components

I soldered components in the following order:

  1. SMD Capacitors
  2. 74HC138
  3. 4953
  4. 74HC595

Step 4: Soldering Thru-hole Components

Not much to say at this step

Step 5: LED Matrix

Do not forget to double check orientation of LED matrix before soldering. There are two positions posible and only one is correct.

Note: I change bolts with others longer and put spacers for safety.

Step 6: Data Connector

A, B, C, D - row select with 74HC138

OE - 74HC595 Ouput Enable(Active Low)

STB - 74HC595 Strobe / Data Latch

CLK - 74HC595 Clock Input

R - data input for 74HC595 (RED section / 4*74HC595)

G - data input for 74HC595 (GREEN section / 4*74HC595)

Step 7: Arduino Library and Demo Code

I had to write this Arduino library from scratch because I have not found anything compatible with this panel.

I found souces / libraries for monochrome panels and for RGB panels but nothing to fit exactly this type of panel.

So I give up searching and start coding :) I named the library myMATRIX (sorry for the lack of inspiration).

After installing the library you can run the example myMATRIX_Demo.

This library should work with any ATmega - based Arduino boards. I tested with: Arduino Mega 2560, ATmega32, ATmega1284, ATmega8. It does not depend on other libraries and use timer2 for refreshing purpose.

Here is an example of using the library:

#include "myMATRIX.h"
#define RowAPin 2
#define RowBPin 3
#define RowCPin 4
#define RowDPin 5 
#define OE_Pin 6  
#define RedPin 7  
#define Green_pin 8  
#define CLK_Pin 9  
#define STB_Pin 10 

void setup () {

void loop(){

This example has the result from second image of this step.

Step 8: Another Example

#include "myMATRIX.h"
#define RowA_Pin 2
#define RowB_Pin 3
#define RowC_Pin 4
#define RowD_Pin 5 
#define OE_Pin 6  
#define Red_Pin 7  
#define Green_Pin 8  
#define CLK_Pin 9  
#define STB_Pin 10 

void setup (){

void loop(){
 char scrolltext_1[]="     * <a href="http://www.OpenHardware.Ro" rel="nofollow"> www.OpenHardware.Ro </a> *      ";
 char scrolltext_2[]="     * Numbers * 1234567890      ";
 char scrolltext_3[]="     * Capital Letters * ABCDEFGHIJKLMNOPQRSTUVXYZ      ";
 char scrolltext_4[]="     * Small Letters * abcdefghijklmnopqrstuvxyz      ";
 myMatrix.fillRectangle(0,0,31,15,red); delay(1000);
 myMatrix.fillRectangle(0,0,31,15,green); delay(1000);
 myMatrix.fillRectangle(0,0,31,15,yellow); delay(1000);
 myMatrix.drawRectangle(0,0,31,15,red); delay(1000);
 myMatrix.fillRectangle(10,3,21,12,green); delay(1000); 

Step 9: More About MyMatrix Library

myMatrix library is very simple but has the advantage of being lightweight and easy to use.

All pins can be configured by the user.

Were implemented only basic functions :

void Init(uint8_t pinRed, uint8_t pinGreen, uint8_t pinClock, 
                 uint8_t pinRowA, uint8_t pinRowB, uint8_t pinRowC, uint8_t pinRowD,
                 uint8_t pinOE, uint8_t pinSTB);
void setPixel(uint8_t x ,uint8_t y, uint8_t color);
void fillRectangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint8_t color);
void drawRectangle(uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint8_t color);
void clearScreen();
void printChar(uint8_t x,uint8_t y, uint8_t For_color, uint8_t Bk_color, char ch);
void printString(uint8_t x, uint8_t y, uint8_t For_color, uint8_t Bk_color,char *p);
void drawVLine(uint16_t x, uint16_t y1, uint16_t y2, uint8_t color);
void drawHLine(uint16_t x1, uint16_t x2, uint16_t y, uint8_t color);
void hScroll(uint8_t y, uint8_t For_color, uint8_t Bk_color,char *p);

This library is still in early stage. It will be maintained here: http://openhardware.ro/mymatrix

No need to check there to see if any updates. I'll post here by a comment any major change.

myMatrix library is released under the MIT license http://opensource.org/licenses/MIT nice explained here http://choosealicense.com/

There are plans in the future to update the library to support multiple panels (as I will have those panels).

I will also try other types of panels available on the market (same as above).

Thanks for reading!


I attached here (at this step) version 1.1. Solve the compiling (in fact linking) problem in newer version of Arduino.

<p>Hi SIlvius, how can I use the other fonts? set on the folder of myMATRIX library?</p>
<p>no... original library does not have implemented this capability... my plan is to be developed in the future ...<br>until then... you can try this:<br><a href="https://github.com/tomaskovacik/arduino/tree/master/myMatrix" rel="nofollow">https://github.com/tomaskovacik/arduino/tree/master/myMatrix</a><br>is based on my library, but is not my project... I notice that other fonts are not completed... ready only the parts that the author needed...some digits, some letters...</p>
<p>can you give me a tip, about how understand how to control this matrix, i have problems to understand the use of the 74hc138, and 74hc595, because I want to have diferent fonts and have total control of this matrix, and if its posible try to connect more matrix </p>
<p>you can read also the article and comments here: http://openhardware.ro/mymatrix/ <br></p><p>the library modified by Thomas Kovacik is made for 3 displays...</p><p>there are comments in the code... I tried to made the code easy to read and easy to understand...</p><p>you must to work hard :) ... if you want to have total control of this matrix... this project is just a starting point...</p><p></p>
<p>i got error at sample library</p>
<p>I have no idea. On my Arduino IDE work fine... And I have made many updates to the IDE and core. I started myMatrix since Arduino was 1.5 or less. </p><p>I think the only &quot;starting point&quot; is to reinstall/update library or even Arduino IDE...</p><p>Now, my setup is IDE 1.6.8 with AVR boards 1.6.17 ... and Linux ... as you can see:</p>
<p>ive reinstall arduino ide but still have error at compiling the example of myMatrix library</p>
<p>Try to disable optimisation for t_shiftOut in myMATRIXclass.h <strong>and</strong> myMATRIXclass.cpp:</p><blockquote> void <strong> __attribute__((optimize(&ldquo;O0&rdquo;))) </strong> t_shiftOut(uint8_t dataRed,uint8_t dataGreen); </blockquote>
<p>please how exactly should those files look at the end, cause i have:</p><p>myMATRIXclass.h</p><p>void myMATRIX::t_shiftOut(uint8_t dataRed,uint8_t dataGreen); </p><p>and in myMATRIXclass.cpp</p><p>void myMATRIX::t_shiftOut(uint8_t dataRed,uint8_t dataGreen)</p>
<p>Look at step 9. I put an updated version of myMatrix there...</p><p>Regards!</p>
<p>Thanks for the prompt response, now it compiles :-)</p>
can i use arduino DMD library for this led matrix?
<p>no... I search about DMD library after reading your comment, and I noticed that those library is for monochrome panels... this panel is dual color. DMD library use SPI hardware to output ONE color signal ... in my library I was &quot;forced&quot; to bit-bang some sort of SPI to output TWO color signal at the same time ( like a &quot;DUAL&quot; SPI ) </p>
how about p10(rg)modul.?
<p>what about p10(rg)module..? ... I don't understand what is the question... if it work with DND library or if work with myMatrix library... so I will try to answer both: If this panel P10(rg) is a RED - GREEN panel:</p><p>1) I don't think will work with DND library because it's monochrome library</p><p>2) I think will work with myMatrix library but this is only an estimate... </p><div><div>So I think it would be good to be able to do some tests before buying something...</div></div>
I want to make my own pcb &amp; need matrix schematic. :)
<p>Thanks for the code, how would I expand this so that it displays on a 16 x 64? Thanks :)</p>
<p>...it should be easy&hellip; only have to increase the buffer size and adapt coordinates values&hellip; but I not have two modules(or more &hellip;yet) to test in real conditions&hellip;</p><p>Look at my answer (for ak007) below. Someone already did it...</p>
I have tried using the code but cannot work out what I have got to change. Where are the coordinate values?
<p>Thanks for the reply, do I just use his code with your myMATRIX_Demo.pde file? Thanks! (sorry I'm a bit new to this)</p>
<p>not quite... there are some differences in printString and printChar because in this <br>library he wanted to use several fonts (only numbers are defined in <br>these additional fonts) ... so ... try them and modify and change them... look at the </p><p><a href="https://github.com/tomaskovacik/arduino/blob/master/myMatrix/myMATRIXClass.h" rel="nofollow">https://github.com/tomaskovacik/arduino/blob/maste...</a></p><p>and you will figure out...</p>
<p>Hi Silvius!, Very good job getting these modules working with Arduino. I am also working with similar project i have 6 16X16 displays cascaded. Your code works on these out of the box but on two displays only(repeated on rest of 2 pairs). Is there a way we can extend this code to drive 96X16 led matrix.</p><p>Thanks and regards,</p><p>Adarsh</p>
<p>here: <a href="https://github.com/tomaskovacik/arduino/tree/master/myMatrix" rel="nofollow">https://github.com/tomaskovacik/arduino/tree/maste...</a></p><p>is a variant made by Tomas Kovacik based on my library. It's for 96x16 (exactly what do you need). But example included in library not working with this variant... there are some differences in printString and printChar because in this library he wanted to use several fonts (only numbers are defined in these additional fonts).</p><p>For my part... I want to decide in some day to order several panels... and make this library to be configurable (as I intended from the beginning)... and work with other microcontrollers like STM32 and Atmel SAM3X (like Arduino Due).</p><p>also you can take a look here: <a href="http://openhardware.ro/mymatrix/" rel="nofollow">http://openhardware.ro/mymatrix/ </a> there are some comments which you could use in your research...</p><p>Regards! :)</p><p></p>
<p>Hi Silvius! Firstly, excellent work &amp; well done on this project! You've actually compelled me to create an account so I can thank you for the information you've provided. I've been imagining an LED project myself over the last few months but, as a newbie, I've been finding it difficult to make much progress beyond one or two 8x8 matrices on breadboards. I was delighted to stumble across your project and bought three of those units from Gearbest for a large display for home. I've soldered up one so far but sadly, my inexperience led me to damage the 2nd one I have so I was sad to learn they seem now to be completely sold out with no sign of new stock. The slightly different version that dancopy bought (below) is available so I was wondering if there was any feedback on whether or not one of these chained with the Gearbest version you feature here, and using your software, would be compatible? Tempted to order one and see how it goes.</p><p>Thanks again &amp; best wishes - Dave</p>
<p>Thank you very much for your appreciation. This kind of feedback make me to continue my work here... :)</p><p>I've noticed that Gearbest no longer have these panels... And I don't have a feedback from dancopy (other than these comments here). But I talk with others that already have some variations of panels(purchased assembled) and I can confirm that it works. Some discussions are here on instructables some there: <a href="http://openhardware.ro/mymatrix/" rel="nofollow">openhardware.ro/mymatrix/</a> and others in some private messages...</p><p>Also I plan to buy from somewhere more panels and to extend and upgrade myMatrix library... </p><p>Best wishes to you also... </p><p>Keep in touch</p>
<p>Hi Silvius,</p><p>You're welcome &amp; thanks so much for the info - I guess if the software works then the general design of the board (and how it works) must be the same, albeit with some component differences (and a bit more soldering it looks like!). It's possible they might display at a slightly different brightness (?) but I think I'll need to order it &amp; built it to find out! I'll let you know how I get on.</p><p>cheers,</p><p>Dave</p>
<p>&quot;they might display at a slightly different brightness&quot; ... I'm pretty sure that it is.</p><p>Gearbest version use IC 4953 (probable KDS4953 ... dual power mosfet)... other versions use discrete transistors and have been reported to display different brightness in same panel... I'm not sure if that was the reason. So take care...</p><p>Anyway I learned that these panels are made to work with some specialized controllers based on more powerful cpu's or mcu's or even fpga's. </p><p>And all comply with a de facto standard named HUBxx ... HUB08, HUB75, HUB12... and more... You can look here to see what it is about: <a href="http://www.led-card.com/index.php?cPath=31_34" rel="nofollow"> http://www.led-card.com/index.php?cPath=31_34 </a> (was the second link on google -&gt; HUB08)</p><p>Have fun!</p>
<p>Hi, thanks for the info (a lot to take in but I'm going through the link) and I get what you're saying in that the boards use different components. I can only build it &amp; see but it was advertised to work with Arduino. If there's a brightness difference in the panel I might have to live with it, or get two more so I use three panels the same. I've got more flux pens now so I'm ready to build it whenever it arrives &amp; see what it looks like :) For clarity, this was the specific link I bought from: </p><p><a href="http://www.ebay.co.uk/itm/371243010614" rel="nofollow">http://www.ebay.co.uk/itm/371243010614</a></p><p>On a separate topic, thought you might be interested to know I dabbled with some animation yesterday and put this 4 frame animation together:</p><p><a href="https://www.youtube.com/watch?v=FMtCErXRIBM" rel="nofollow">https://www.youtube.com/watch?v=FMtCErXRIBM</a></p><p>Very much a manual process (lots and lots of setPixel &amp; drawHLine commands!) but it was fun to do!</p><p>cheers,</p><p>Dave</p>
<p>:) Yes! I like what you managed to do... with little capabilities of the library.</p><p>So.. best regards, and see you again!</p>
I am doing this project in grenn colorboard i.e monovhrome board bit i can't find any library for it..i only found for RGB . So can you please help :(<br>Its urgent. I've to complete my project anyhow.
<p>Look here: <a href="https://github.com/Seeed-Studio/Ultrathin_LED_Matrix" rel="nofollow">https://github.com/Seeed-Studio/Ultrathin_LED_Matr...</a></p><p>I think that is what you need... Have fun!</p>
<p>Hi Silvius! Sorry to bother you again!<br> I bought this module: http://www.ebay.com/itm/16x32-Red-Green-Dual-Color-Dot-Matrix-DIY-Kit-Perfect-Control-Display-Module-/161809281055?</p><p>In this module, as you can see, besides the &quot;GND&quot; pins, there are 2 pins &quot;VCC&quot; and 2 named contacts &quot;+5v and GND&quot;; These pins need not be connected?<br> I made the connections as you mention in your tutorial but does not work properly;<br> Light some lights &quot;ghosts&quot; and nothing more - I do not know what's going on;<br> If you have any tips, I'll be very grateful;<br> Once again, thank you</p>
<p>I bought three of these module kits because I need to make a 16 x 96 display panel. They arrived the other day, with absolutely zero documentation. I think I can assemble them successfully, but please can you explain the pin-out on the In and Out connectors, and the waveforms that I have to use to drive the panels? Are these panels daisy chainable? I.e. can I just connect three of them together using the ribbon cables supplied, and then drive the first one? These are to display the contents of some memory on my existing system as a diagnostic aid, so I need to develop my own software to drive them, and I can't do this without understanding the design of the modules. Is there a schematic available somewhere?</p><p>Thanks - Rowan</p>
<p>&quot;Are these panels daisy chainable?&quot; - Yes </p><p>You can just connect three of them together using the ribbon cables supplied, and then drive the first one ... :)</p><p>Someone made a library for three modules: <a href="https://github.com/tomaskovacik/arduino/tree/master/myMatrix" rel="nofollow">https://github.com/tomaskovacik/arduino/tree/maste...</a> (based on my library)</p><p>I think you can easily &quot;extract&quot; schematic from PCB and studying code to see how multiplexing is done. I do not think that there is a schematic of this module anywhere in internet... (I think I will make shematic in gEDA as a challenge/ exercise)</p><p>About waveforms to drive modules: &quot;In this library serial communication is bit-banged emulating a SPI with dual data stream (Red and Green) ...and one clock)&quot; </p><p>You can read also some comments from here: <a href="http://openhardware.ro/mymatrix/" rel="nofollow">http://openhardware.ro/mymatrix/</a></p><p>Have fun! :)<br></p><p></p>
one GND from Data connector must be wired to GND from Arduino / Atmega<br>LED Matrix module must be powered separately with 5V - GND connector that you mention. This module need about 0.5~1.5A ... so 5V-2A power source should be ok...
<p>Thank Silvius!<br>You say that the LED Matrix Module must be powered separately;<br>I have an ADAPTER like this: http://pt.aliexpress.com/item/High-Quality-DC-5-5-x-2-1mm-5V-2A-Power-Supply-adapter-adaptor-Wall-charger/32272648335.html<br>So how do I do? I have to use two of this, one for the Arduino and one for the module? Do you think this way will work?<br>Again, I am very grateful;</p>
<p>Ok. I returned from a 4 day trip... and now I can study images from links you posted...</p><p>At first, your LED module from e-bay is slightly different from the module presented in instructable; At first glance should work... same connectors ... same pinout. You must use IN connector from your board (= D-IN connector on my board)</p><p>Second, LED module must be powered with 5V~2A. </p><p>It depends on what kind of Arduino board you use, you can power <strong>(or not)</strong> from same power supply.</p><p>If you use a standard board (Uno, Mega,... so on) you must use a power supply suitable for these boards...(or power them from USB connector) and LEDs from 5V/2A source.</p><p>If you use a stand-alone, custom Arduino compatible microcontroller/board, you can power microcontroller from same 5V source as for LED module... (also it depents on board configuration...)</p><p>About adapter from aliexpress link: If indeed characteristics are correctly marked, It should work ok... </p>
<p>Does this panel work with <strong><em>Arduino UNO R3</em></strong>?</p><p>I do not know how I should connect the matrix with the Arduino</p>
<p>It should go smoothly. I tested with Arduino Mega 2560, ATmega32, ATmega1284, ATmega8.</p><p>You have the freedom to choose which pins you want. Only needs to be defined like this:</p><blockquote>#define RowAPin 2 // this is Arduino digital pin 2<br>#define RowBPin 3 // this is Arduino digital pin 3<br>#define RowCPin 4 //......<br>#define RowDPin 5 //......<br>#define OE_Pin 6<br>#define RedPin 7<br>#define Green_pin 8<br>#define CLK_Pin 9<br>#define STB_Pin 10</blockquote><p>So you can make any configuration you want. Then you must initialize the library in setup() section:</p><blockquote>myMatrix.Init(Red_Pin,Green_Pin,CLK_Pin,RowA_Pin,RowB_Pin,RowC_Pin,RowD_Pin,OE_Pin,STB_Pin);</blockquote><p>in Step 6 is detailed data connector.</p>
<p>Thank you so much &lt;3</p>
<p>Thank you for answering Silvius.<br> I have the same panel as the PetriJ (64x16 but only red).<br> I can adapt your code for my panel? - As in the case of Step 8, I would exclude [#define Green_Pin 8]; in 'void setup' would come out [Green_Pin]; and also exclude [myMatrix.hScroll (0, black, green, scrolltext_1); ] Would be this or am I wrong?<br> Remembering: My panel is only red<br> Sorry, for I am well beginner Silvius<br>Again, my thanks</p>
<p>Sorry... It will not work in this way ... the library is built for two colors panels (32x16)... the library can be modified for other panels... but I think is beyond capabilities of a beginner... (There are two buffers internaly, for red and for green; and scan function need to output 2 signals...)</p><p>Good news is that exist more libraries and code available for monochrome led panels (comparing with RGY)</p><p>In fact is more easy to code for monochrome led displays... (you do not need to output Red and Green signal same time). You can use SPI hardware for output color signal...</p><p>When I started working at this library I bumped a couple of libraries like this:</p><p><a href="http://www.freetronics.com.au/pages/using-your-freetronics-dmd#.VZ4W-EY3N8E" rel="nofollow">http://www.freetronics.com.au/pages/using-your-freetronics-dmd#.VZ4W-EY3N8E</a></p><p>You can search more...</p>
<p>Hi Silvius! The interface of this Matrix is HUB08 or HT1632C? Because I bought a Matrix in Aliexpress with HUB08 interface but it is very hard to find sample code; I would like to interface with easier codes for I have difficulty understanding; I would also like to ask the PetriJ where I can get this panel 64x16.<br> thank you</p>
<p>I think is HUB08... At the beginning of my research I found references to HUB08 and HUB12... but it does not clear to me the difference between them ... I have not found (any official) documentation of these protocols </p><p>and why I wrote this library ... </p><p>In fact ... it's like SPI protocol ... with 2 data (R and G) and 1 clock .... for 1 row...</p><p>A,B,C,D for selecting row... </p>
<p>Sure it's <strong>not HT1632C</strong>... After some searching I cleared about HT1632C... It's very nice memory mapping LED display controller :) ...</p>
<p>Hi Silvius.<br>I've got the same panel but 64x16 and have been trying for a long time get it to work as it should.<br>Not many arduino sketches out there that support the DX dot matrix displays, and the few ones I find only work with one color.<br><br>But now I found your library and must say it's great. <br><br>Is there any way to show uint16_t animation with your library?<br>Because that's all that is missing for me. Need to display both graphics and scrolling text for phone number, open hours and such.</p>
<p>Thanks! For phone number , open hours it is not necessary to use uint16_t...you can use for example:</p><blockquote>char scrolltext_1[]=&quot; * Phone number: 222-22222 * &quot;;</blockquote><p>or </p><blockquote>char scrolltext_2[]=&quot; * Open Hours: 08:30 - 16:30 * &quot;;<br></blockquote><p>uint16_t (or other integer / numeric data) is needed only if that value is changing &quot;on the fly&quot; (like temperature , current time, rate of exchange... or other values ...) </p><p>for this type of task is need to convert these values to string. </p><p>You can convert these values before calling hScroll function. For that i neccesary to declare char array like this:</p><p>char scrolltext_2[]=&quot; * Example uint_16: ***** &quot;; </p><p>and write at scrolltext_2[24] (24 is position of first * in array)</p><p>Another example:</p><blockquote>// declaring variables<br>uint16_t myValue=1345; <br> String myString; <br> char scrolltext_3[]=&quot; Example uint_16t: ***** &quot;; </blockquote><blockquote>// before calling hScroll function<br>myString=String(myValue); //converting into a string<br> myString.toCharArray(scrolltext_3+24,5); //writing converted values to scrolltext<br></blockquote><p>I will return in 1-2 days with a complete example...I hope this will help you until then...</p>
<p>I just want to say thank you. I looked high and low for some code that would show this red/green matrix off. I am not too good at programming the arduino so just have to say thank you once again.</p>
<p>You're welcome! Glad to see that my work is useful. :)</p>
<p>BTW just wanted to say that mine took a max of 306 milliamp of power @ 5v to run it. I am using a Korad KD3005d Power Supply and when it lights up all the squares it takes only 306 ma of current. </p>

About This Instructable




More by Silvius:Reading 15 Rotary Encoders with Arduino and ATmega1284 Open Source TV Box - GeekBox AVR Transistor Tester 
Add instructable to: