Vous êtes sur la page 1sur 6

Home / Arduino / Arduino 88 LED Matrix

Arduino 88 LED Matrix


T.K. HAREENDRAN

88 LED Matrix modules are now widely available, and fortunately they are easy to use with our
favorite Arduino microcontroller. 88 LED Matrix module have many applications in real life,
such as various types of electronic display panels.

The LED matrix can be driven in two ways (parallel or serial). Here we drive it in the serial
manner in order to save interface (needs only three data lines). The serial-driven LED matrix
actually dynamically displays the LEDs (row-by-row or column-by-column). The persistence of
vision for humans is about 0.1s, so as long as we can serially display all 8 rows/columns within
0.1s, well see a complete character or pattern.

Our project is infact an Arduino with Serially Interfaced MAX7219 Operates an 8X8 LED
Matrix to display a heart pattern. The MAX7219 IC is a serial input/output common-cathode
display driver that interfaces microprocessors to a 7-segment numeric LED displays of up to 8

digits, bar-graph displays, or 64 individual LEDs. For convenience, here an 88 LED matrix,
integrated with a MAX7219 IC setup, available as a pre-wired module is used. Typical
specification of this LED Matrix Module is shown below:

Operating Voltage: DC 4.7V 5.3V

Typical Voltage: 5V

Operating Current: 320mA

Max Operating Current: 2A

Wiring Instructions
1.

Connect Arduino pin8 to DIN on 88 LED Matrix

2.

Connect Arduino pin9 to CS of 88 LED Matrix

3.

Connect Arduino pin10 to CLK of 88 LED Matrix

4.

Connect an external 5VDC (1A) to VCC of 88 LED Matrix

5.

Connect external 5VDC supplys GND, to the GND of 88 LED Matrix Module

Note that the 8x8LED Matrix Module should be common-grounded with Arduino, ie, always
remember to interconnect the Arduino GND terminal with the external 5VDC power supply
GND terminal. Connect pins according to the instructions given above, and download the sketch
into Arduino board. If everything seems right, you can power up the Arduino (and the LED
matrix) to see the LED matrix circularly displays a sweetheart pattern!

Wiring Diagram

Warning!
Before powering up, ensure that corresponding wires are properly connected.

Arduino Sketch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

/*
* Arduino Sweet Heart
* An Arduino & 8x8 LED dot matrix project
* Using Max7219 IC
* Designed by T.K.Hareendran
* Tested at TechNode Protolabz
* 17 July 2014
* http://www.electroschematics.com
*/
unsigned char i;
unsigned char j;
int Max7219_pinCLK = 10;
int Max7219_pinCS = 9;
int Max7219_pinDIN = 8;
unsigned char disp1[19][8]={
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Heart Pattern
0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,

21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73

0x00,
0x00,
0x00,
0x40,
0x60,
0x60,
0x60,
0x60,
0x60,
0x60,
0x60,
0x60,
0x60,
0x60,
0x60,

0x00,
0x00,
0x80,
0x80,
0x80,
0x90,
0x90,
0x90,
0x90,
0x90,
0x90,
0x90,
0x90,
0x90,
0x90,

0x00,
0x80,
0x80,
0x80,
0x80,
0x80,
0x88,
0x88,
0x88,
0x88,
0x88,
0x88,
0x88,
0x88,
0x88,

0x40,
0x40,
0x40,
0x40,
0x40,
0x40,
0x40,
0x44,
0x44,
0x44,
0x44,
0x44,
0x44,
0x44,
0x44,

0x40,
0x40,
0x40,
0x40,
0x40,
0x40,
0x40,
0x40,
0x44,
0x44,
0x44,
0x44,
0x44,
0x44,
0x44,

0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x08,
0x08,
0x08,
0x08,
0x08,
0x88,

0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x10,
0x10,
0x10,
0x90,
0x90,

0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x00,
0x20,
0x60,
0x60,
0x60, // Heart Pattern

};
void Write_Max7219_byte(unsigned char DATA)
{
unsigned char i;
digitalWrite(Max7219_pinCS,LOW);
for(i=8;i>=1;i--)
{
digitalWrite(Max7219_pinCLK,LOW);
digitalWrite(Max7219_pinDIN,DATA&0x80);
DATA = DATA<<1;
digitalWrite(Max7219_pinCLK,HIGH);
}
}
void Write_Max7219(unsigned char address,unsigned char dat)
{
digitalWrite(Max7219_pinCS,LOW);
Write_Max7219_byte(address);
Write_Max7219_byte(dat);
digitalWrite(Max7219_pinCS,HIGH);
}
void Init_MAX7219(void)
{
Write_Max7219(0x09, 0x00);
Write_Max7219(0x0a, 0x03);
Write_Max7219(0x0b, 0x07);
Write_Max7219(0x0c, 0x01);
Write_Max7219(0x0f, 0x00);
}
void setup()
{
pinMode(Max7219_pinCLK,OUTPUT);
pinMode(Max7219_pinCS,OUTPUT);

74
75
76
77
78
79
80
81
82
83
84
85
86
87
88

pinMode(Max7219_pinDIN,OUTPUT);
delay(50);
Init_MAX7219();
}
void loop()
{
for(j=0;j<19;j++)
{
for(i=1;i<9;i++)
Write_Max7219(i,disp1[j][i-1]);
delay(500);
}
}