LED Dot Matrix Display

Aus Aptofun WIKI
Wechseln zu: Navigation, Suche

AptoFun Dot Matrix MAX7219 Module Mcu LED Display Control Kit for Arduino/Rasperry Pi

Introduction

A Dot-Matrix Display is a display device which contains light emitting diodes aligned in the form of matrix.This Dot matrix displays are used in applications where Symbol, Graphic, Characters, Alphabets, Numerals are need to be displayed together in static as well as Scrolling motion.Dot Matrix Display is manufactured in various dimensions like 5x7,8x8,16x8,128x16, 128x32 and 128x64 where the numbers represent LED's in rows and columns, respectively.Also these displays comes in different colors such as Red, Green, Yellow, Blue, Orange, White.

DIS0002.jpgEpro.gif

Working of Dot Matrix Display

In Dot matrix display,multiple LED's are wired together in rows and columns,in order to minimize the number of pins required to drive them.The matrix pattern is made either in row anode-column cathode or row cathode-column anode pattern.In row anode-column cathode pattern, the entire row is anode while all columns serve as cathode which is shown below and it is vice-versa in row cathode-column anode pattern.
Row anode-Column Cathode Pattern

In a 8×8 matrix,the LED's would need 64 I/O pins, one for each LED pixel. By wiring all the anodes together in rows (R1 through R8), and cathodes in columns (C1 through C8), the required number of I/O pins is reduced to 16. Each LED is addressed by its row and column number.Characters can be displayed by fast scanning of either rows or columns.To display a character,the row and column pins should be pulled low and high according to that character.For example,the row and column pins should be enabled as per the table given below to display a character 'M' in which the red marks denotes that led is on.

Row and Column values of character "M"& Display showing the corresponding character "M"

Interfacing Dot Matrix Display with Arduino UNO

Hardware and Software Required

  • Dot Matrix LED Display(8x8)
  • MAX7219 IC
  • Arduino UNO
  • Arduino IDE 1.0.6 Version

How to interface Dot Matrix Led Display with Arduino UNO

Before interfacing Dot matrix with Arduino,we need to connect the Max7219 IC which is an Led driver to the Dot matrix display.The reason behind using this led driver is that it drives the 64 Led's simultaneously which in turn reduces the number of wires so that the user will find it easy to connect the display to the Arduino board.

The MAX7219 has four wire SPI interface(we need only this four wires to interface it to the Arduino board):

  • Data - MOSI - Master Output Serial Input.
  • Chip select - Load (CS) - active low Chip select.
  • Clock - SCK(max 10MHz)
  • Ground.

Now,the Dot matrix display could be connected to the Arduino board as follows:

  • DIN is connected to Digital pin 8
  • CS is connected to Digital pin 9
  • CLK is connected to Digital pin 10
  • Vcc and Gnd to 5V and Gnd

Program to Turn On the Led

The program given below is an example to turn On and Off the Led at each row and column.The user can download the library file along with few built-in examples here:Datei:LedControlMS.zip

 1  #include <LedControlMS.h>
 2  LedControl lc=LedControl(12,11,10,1); // 
 3  
 4  // pin 12 is connected to the MAX7219 pin 1
 5  // pin 11 is connected to the CLK pin 13
 6  // pin 10 is connected to LOAD pin 12
 7  // 1 as we are only using 1 MAX7219
 8  
 9  void setup()
10  {
11   // the zero refers to the MAX7219 number, it is zero for 1 chip
12   lc.shutdown(0,false);// turn off power saving, enables display
13   lc.setIntensity(0,8);// sets brightness (0~15 possible values)
14   lc.clearDisplay(0);// clear screen
15  }
16  void loop()
17  {
18   for (int row=0; row<8; row++)
19   {
20     for (int col=0; col<8; col++)
21     {
22       lc.setLed(0,col,row,true); // turns on LED at col, row
23       delay(25);
24     }
25   }
26  
27   for (int row=0; row<8; row++)
28   {
29     for (int col=0; col<8; col++)
30     {
31       lc.setLed(0,col,row,false); // turns off LED at col, row
32       delay(25);
33     }
34   }
35  }

References