The 8×8 Matrix LED you can adjust brightness by using Arduino Sketch, the 8×8 LED has many applications in real life such as electronic display panel or signage display projects and display clock, etc. The LED matrix can be driven in two ways parallel or serial, in this test were going to use serial communication in order to save the interface. The serial driven matrix are dynamic it can display the LED MATRIX row by row or column by column. below are the device details and electronic parts required.
The MAX7221 and MAX7219
The MAX7221 and MAX7219 provide as easy way to control an array of 64 LEDs or up to 8 digit made of 7 SEGMENT display with a minimum of electronic components. These chip it has a single resistor and 1 or 2 capacitors, the data is send to the chip using a SPI compatible protocol using 3 of the digital pins on the Arduino. If you going to control more that 8 7SEGMENT display or more than 64 LEDS the chip can be cascaded. The library witch has been used on this demo can support up to 8 cascaded device, which add up to 512 LEDS that be light individually using 3 pins on your Arduino. The MAX7221 or MAX7219 is more suitable for controlling LEDS, if you’ll going to switch from Arduino to a different controller you need to use the MAX7221, this chip support fully SPI compatible interface. The library which is use on this lab can cope both types of devices, and the visual appearance are both same.
If you want to learn more about the MAX7XXX series, just download the components datasheets below.
8×8 Matrix LED
8X8 MATRIX LED MODULE w/d MAX7219
Electronic Parts
- 8×8 LED Matrix
- MAX7219
- 10uF 25V Electrolytic capacitor
- 10K Resistor
- 0.1uF Capacitance Ceramic Capacitor
- Headers and receptacles.
Schematics Diagram
Specification of LED MTRIX Module
- Operating Voltage > DC 4.7 v ~ 5.3v | Typical Voltage: 5v
- Operating Current > 320mA | Max Operating Current: 2A
- Operating Temperature > 0 Degree Celsius ~ 50 Degree Celsius | Typical Temperature: 25 Degree Celsius
Wiring Diagram
Demo Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 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 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
/* 14CORE | 8x8 MATRIX LED DEMO SKETCH */ int MAXPINCLK = 10; // Define Digital Port 10 int MAXPINCS = 9; // Define Digital Port 9 int MAXPINDIN = 8; // Define Digital Port 8 unsigned char x; //occupies bytes on the memory unsigned char y; //occupies bytes on the memory unsigned char disp1[38][8]={ {0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C}, //Char 0 {0x10,0x18,0x14,0x10,0x10,0x10,0x10,0x10}, //Char 1 {0x7E,0x2,0x2,0x7E,0x40,0x40,0x40,0x7E}, //Char 2 {0x3E,0x2,0x2,0x3E,0x2,0x2,0x3E,0x0}, //Char 3 {0x8,0x18,0x28,0x48,0xFE,0x8,0x8,0x8}, //Char 4 {0x3C,0x20,0x20,0x3C,0x4,0x4,0x3C,0x0}, //Char 5 {0x3C,0x20,0x20,0x3C,0x24,0x24,0x3C,0x0}, //Char 6 {0x3E,0x22,0x4,0x8,0x8,0x8,0x8,0x8}, //Char 7 {0x0,0x3E,0x22,0x22,0x3E,0x22,0x22,0x3E}, //Char 8 {0x3E,0x22,0x22,0x3E,0x2,0x2,0x2,0x3E}, //Char 9 {0x8,0x14,0x22,0x3E,0x22,0x22,0x22,0x22}, //Char A {0x3C,0x22,0x22,0x3E,0x22,0x22,0x3C,0x0}, //Char B {0x3C,0x40,0x40,0x40,0x40,0x40,0x3C,0x0}, //Char C {0x7C,0x42,0x42,0x42,0x42,0x42,0x7C,0x0}, //Char D {0x7C,0x40,0x40,0x7C,0x40,0x40,0x40,0x7C}, //Char E {0x7C,0x40,0x40,0x7C,0x40,0x40,0x40,0x40}, //Char F {0x3C,0x40,0x40,0x40,0x40,0x44,0x44,0x3C}, //Char G {0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x44}, //Char H {0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x7C}, //Char I {0x3C,0x8,0x8,0x8,0x8,0x8,0x48,0x30}, //Char J {0x0,0x24,0x28,0x30,0x20,0x30,0x28,0x24}, //Char K {0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7C}, //Char L {0x81,0xC3,0xA5,0x99,0x81,0x81,0x81,0x81}, //Char M {0x0,0x42,0x62,0x52,0x4A,0x46,0x42,0x0}, //Char N {0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C}, //Char O {0x3C,0x22,0x22,0x22,0x3C,0x20,0x20,0x20}, //Char P {0x1C,0x22,0x22,0x22,0x22,0x26,0x22,0x1D}, //Char Q {0x3C,0x22,0x22,0x22,0x3C,0x24,0x22,0x21}, //Char R {0x0,0x1E,0x20,0x20,0x3E,0x2,0x2,0x3C}, //Char S {0x0,0x3E,0x8,0x8,0x8,0x8,0x8,0x8}, //Char T {0x42,0x42,0x42,0x42,0x42,0x42,0x22,0x1C}, //Char U {0x42,0x42,0x42,0x42,0x42,0x42,0x24,0x18}, //Char V {0x0,0x49,0x49,0x49,0x49,0x2A,0x1C,0x0}, //Char W {0x0,0x41,0x22,0x14,0x8,0x14,0x22,0x41}, //Char X {0x41,0x22,0x14,0x8,0x8,0x8,0x8,0x8}, //Char Y {0x0,0x7F,0x2,0x4,0x8,0x10,0x20,0x7F}, //Char Z }; void MX7219_WRITE_byte(unsigned char DATA) { unsigned char x; digitalWrite(MAXPINCS,LOW); for(x=8;x>=1;x--) { digitalWrite(MAXPINCLK,LOW); digitalWrite(MAXPINDIN,DATA&0x80);// Extracting a bit data DATA = DATA<<1; digitalWrite(MAXPINCLK,HIGH); } } void MX7219_WRITE(unsigned char address,unsigned char dat) { digitalWrite(MAXPINCS,LOW); MX7219_WRITE_byte(address); // The address code of the LED MX7219_WRITE_byte(dat); //The data figure on LED digitalWrite(MAXPINCS,HIGH); } void InitMAX7219(void) { MX7219_WRITE(0x09, 0x00); //Set decoding BCD MX7219_WRITE(0x0a, 0x03); //Set the brightness MX7219_WRITE(0x0b, 0x07); //Set scan & limit 8 LEDs MX7219_WRITE(0x0c, 0x01); //On power-down mode is 0,normal mode is 1 MX7219_WRITE(0x0f, 0x00); //To test display 1 EOT,display 0 } void setup() { pinMode(MAXPINCLK,OUTPUT); pinMode(MAXPINCS,OUTPUT); pinMode(MAXPINDIN,OUTPUT); delay(50); InitMAX7219(); } void loop() //Loop { for(y=0;j<38;y++) // Just replace the "j" to y... { for(x=1;x<9;x++) MX7219_WRITE(x,disp1[y][x-1]); delay(500); } } |
Download the source code here | ZIP
Download the MAX7XXX code library here | ZIP
Download the Datasheet here | PDF
I was looking at the schematic but its not clear on the 8 x 8 led can you please send me a clearer schematic. Thanks.