32x16 LED Matrix Panel and Arduino

51,437

69

61

Intro: 32x16 LED Matrix Panel and Arduino

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 () {
myMatrix.Init(Red_Pin,Green_Pin,CLK_Pin,RowA_Pin,RowB_Pin,RowC_Pin,RowD_Pin,OE_Pin,STB_Pin);
myMatrix.fillRectangle(0,0,31,4,red);
myMatrix.fillRectangle(0,5,31,10,green);
myMatrix.fillRectangle(0,11,31,15,yellow);
}

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 (){
myMatrix.Init(Red_Pin,Green_Pin,CLK_Pin,RowA_Pin,RowB_Pin,RowC_Pin,RowD_Pin,OE_Pin,STB_Pin);
}

void loop(){
 myMatrix.clearScreen();
 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); 
 myMatrix.clearScreen();
 myMatrix.drawHLine(0,31,7,green);
 myMatrix.drawHLine(0,31,15,green);
 myMatrix.drawVLine(0,0,15,yellow);
 myMatrix.drawVLine(31,0,15,yellow);
 myMatrix.printString(5,8,yellow,black,"Demo");
 myMatrix.hScroll(0,red,black,scrolltext_1);
 myMatrix.hScroll(0,black,green,scrolltext_1);
 myMatrix.hScroll(0,red,black,scrolltext_2);
 myMatrix.hScroll(0,red,black,scrolltext_3);
 myMatrix.hScroll(0,red,black,scrolltext_4);
}

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!

UPDATE:

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

3 People Made This Project!

Recommendations

  • Fix It! Contest

    Fix It! Contest
  • Furniture Contest 2018

    Furniture Contest 2018
  • Audio Contest 2018

    Audio Contest 2018

61 Discussions

0
None
jeffavery

3 days ago

Hi Silvius,

Thank you so much for this. I picked one of these panels up from Ebay and spent a bit of time finding this. In another post, you mention "I'm going to write a code to make diagnosis of that panel (without library / only simple bit-banging some pins in main loop)."

Did you end up writing that bit of code? If so, would you be willing to share? Thanks again for your work on this.

-Jeff

1 reply
0
None
ArduinoShed

24 days ago

Many thanks for your work on coding the library and making the documentation. I bought one of these kits to practice smd soldering. With your code the led matrix worked right out of the box. Could not have been simpler. Yeay! :)

1 reply
0
None
UmeshW3

9 months ago

can anyone share schematic and gerber files of PCB.

0
None
dancopy

1 year ago

Silvius! Souvenirs!
Did not you make any more code for this Display? I would like to do a clock + scrolling text but I am not aware enough.
I would also like to find this module already mounted (soldier);
Thank you

1 reply
0
None
Silviusdancopy

Reply 1 year ago

Right now I can't start to work at this task. In a few hours I leave for 10 days on vacation. So... when I come back I will talk about it. I think it can be done with the library as it is.

Keep in touch!

0
None
kemo

1 year ago

Ellw sir we are making a project on a rgb matrix display .We r using 32*16 rgb pannel we are using 5 rgb we did coding n all by we r facing a problem in a scrolling of text when we connect five rgb together same text is displaying on five rgb we want to scroll the text which is not happening ...Xo sir can u help us ....

2 replies
0
None
pvchaoskemo

Reply 1 year ago

Why dont you use the rgb library from Adafruit?

0
None
Silviuspvchaos

Reply 1 year ago

Yes, this RGY panels are not similar with RGB panels, so I can't help in this matter, even though I like the idea... (I do not have such a panel)

The good news is that there is much more documentation/code/libraries for these panels. The suggestion made by pvchaos is a good starting point.

0
None
pvchaos

1 year ago

Hi silvius its me again, in Tomas Kovacik library do you know how to write the sintaxis to write a CHAR or STRING with a different type of font?

Example: myMatrix.printChar(5,8,yellow,black,"Demo", how to select a library);

because I try different posiblities but I still can not compile.

1 reply
0
None
Silviuspvchaos

Reply 1 year ago

It seems that is like printString from my library only with an integer parameter uint8_t font added at the end.

So it should work like this:

myMatrix.printString(5,8,yellow,black,"Demo", 1); // for font 1

last parameter can be 0,1,2,3 and 4

I saw in the code that only 0....4 are valid values...

Please note that some added fonts are not complete ...

0
None
pvchaos

1 year ago

Hi SIlvius, how can I use the other fonts? set on the folder of myMATRIX library?

3 replies
0
None
Silviuspvchaos

Reply 1 year ago

no... original library does not have implemented this capability... my plan is to be developed in the future ...
until then... you can try this:
https://github.com/tomaskovacik/arduino/tree/master/myMatrix
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...

0
None
pvchaosSilvius

Reply 1 year ago

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

0
None
Silviuspvchaos

Reply 1 year ago

you can read also the article and comments here: http://openhardware.ro/mymatrix/

the library modified by Thomas Kovacik is made for 3 displays...

there are comments in the code... I tried to made the code easy to read and easy to understand...

you must to work hard :) ... if you want to have total control of this matrix... this project is just a starting point...

0
None
Silviusraahmajayagrs

Reply 2 years ago

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 "forced" to bit-bang some sort of SPI to output TWO color signal at the same time ( like a "DUAL" SPI )

0
None
Silviusraahmajayagrs

Reply 2 years ago

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:

1) I don't think will work with DND library because it's monochrome library

2) I think will work with myMatrix library but this is only an estimate...

So I think it would be good to be able to do some tests before buying something...