You are on page 1of 7

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 * Arduino Sweet Heart

3 * An Arduino & 8x8 LED dot matrix project

4 * Using Max7219 IC

5 * Designed by T.K.Hareendran

6 * Tested at TechNode Protolabz

7 * 17 July 2014

8 * http://www.electroschematics.com

9 */

10

11 unsigned char i;

12 unsigned char j;

13

14 int Max7219_pinCLK = 10;

15 int Max7219_pinCS = 9;

16 int Max7219_pinDIN = 8;

17
18 unsigned char disp1[19][8]={

19 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Heart


Pattern

20 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,

21 0x00, 0x00, 0x00, 0x40, 0x40, 0x00, 0x00, 0x00,

22 0x00, 0x00, 0x80, 0x40, 0x40, 0x00, 0x00, 0x00,

23 0x00, 0x80, 0x80, 0x40, 0x40, 0x00, 0x00, 0x00,

24 0x40, 0x80, 0x80, 0x40, 0x40, 0x00, 0x00, 0x00,

25 0x60, 0x80, 0x80, 0x40, 0x40, 0x00, 0x00, 0x00,

26 0x60, 0x90, 0x80, 0x40, 0x40, 0x00, 0x00, 0x00,

27 0x60, 0x90, 0x88, 0x40, 0x40, 0x00, 0x00, 0x00,

28 0x60, 0x90, 0x88, 0x44, 0x40, 0x00, 0x00, 0x00,

29 0x60, 0x90, 0x88, 0x44, 0x44, 0x00, 0x00, 0x00,

30 0x60, 0x90, 0x88, 0x44, 0x44, 0x08, 0x00, 0x00,

31 0x60, 0x90, 0x88, 0x44, 0x44, 0x08, 0x10, 0x00,

32 0x60, 0x90, 0x88, 0x44, 0x44, 0x08, 0x10, 0x20,

33 0x60, 0x90, 0x88, 0x44, 0x44, 0x08, 0x10, 0x60,

34 0x60, 0x90, 0x88, 0x44, 0x44, 0x08, 0x90, 0x60,

35 0x60, 0x90, 0x88, 0x44, 0x44, 0x88, 0x90, 0x60, // Heart


Pattern

36

37 };

38

39 void Write_Max7219_byte(unsigned char DATA)

40 {

41 unsigned char i;

42 digitalWrite(Max7219_pinCS,LOW);

43 for(i=8;i>=1;i--)

44 {
45 digitalWrite(Max7219_pinCLK,LOW);

46 digitalWrite(Max7219_pinDIN,DATA&0x80);

47 DATA = DATA<<1;

48 digitalWrite(Max7219_pinCLK,HIGH);

49 }

50 }

51

52 void Write_Max7219(unsigned char address,unsigned char dat)

53 {

54 digitalWrite(Max7219_pinCS,LOW);

55 Write_Max7219_byte(address);

56 Write_Max7219_byte(dat);

57 digitalWrite(Max7219_pinCS,HIGH);

58 }

59

60 void Init_MAX7219(void)

61 {

62 Write_Max7219(0x09, 0x00);

63 Write_Max7219(0x0a, 0x03);

64 Write_Max7219(0x0b, 0x07);

65 Write_Max7219(0x0c, 0x01);

66 Write_Max7219(0x0f, 0x00);

67 }

68

69 void setup()

70 {

71

72 pinMode(Max7219_pinCLK,OUTPUT);
73 pinMode(Max7219_pinCS,OUTPUT);

74 pinMode(Max7219_pinDIN,OUTPUT);

75 delay(50);

76 Init_MAX7219();

77 }

78

79 void loop()

80 {

81 for(j=0;j<19;j++)

82 {

83 for(i=1;i<9;i++)

84 Write_Max7219(i,disp1[j][i-1]);

85 delay(500);

86 }

87 }

88

Previous
Contest #4: Guess what it is?

Next
A Primer on Solar Charge Controls

You might also like