Ardiuno 8*8 LED matrix display MAX7219

 

ARDUINO 8*8 LED MATRIX DISPLAY MAX7219

In this instructable I'm going to show you how to Interface with LED matrix using an Arduino and MAX7219 IC, this project can be used to make low resolution images using LEDs. This project is very simple to build and serves as a basics to getting started with controlling a large number of LEDs using the Arduino Uno.




SEE THE FULL TUTORIAL VIDEO 

For this project we will be using the MAX7219 which is display driver IC, which works with SPI communication. An 8x8 LED matrix has 64 Pins in total if all the cathodes are connected together while an Arudino has only 14 digital pins, and the Arduino is not capable of providing 64 LEDs with enough current so we use the MAX7219, which needs only two Arduino pins to control the LEDS.

Here is the list of components required to build this project -

  • Arduino Uno
  • 8x8 LED matrix with MAX7219 
  • Jumper Wire

Connections 


  • MAX7219 CLK   => Arduino digital pin8
  • MAX7219 CS     => Arduino digital pin9
  • MAX7219 DIN    => Arduino digital pin10
  • MAX7219 GND  => Arduino  GND pin
  • MAX7219 Vcc    => Arduino 5v pn
                                         
By completing the above connections we are done with the hardware part of the project now we are left only with software (code).

The code can be found below, this is the code to generate an OPEN pattern and BORDER pattern on the LED matrix. The code is simple to understand and you can change the patterns of the LEDs in the code.

GENERATE THE PATTERN

 We can generate patterns by using the application for which the link is given below you can download and use 
DOWNLOAD THE APPLICATION =>Download Application to change



CODE

//know to robo knowtorobo.blogspot.com
//LED 8x8 Matrix Display 

#include <LedControl.h>
int DIN = 10;
int CS =  9;
int CLK = 8;

LedControl lc=LedControl(DIN,CLK,CS,0);

void setup(){
 lc.shutdown(0,false);       
 lc.setIntensity(0,15);      //Adjust the brightness maximum is 15
 lc.clearDisplay(0);    
}

void loop(){ 
    
   
    //lines
    byte d3[8]= {0xFF,0x81,0x81,0x81,0x81,0x81,0x81,0xFF};
    byte d4[8]= {0x00,0x7E,0x42,0x42,0x42,0x42,0x7E,0x00};
    byte d5[8]= {0x00,0x00,0x3C,0x24,0x24,0x3C,0x00,0x00};
    byte d6[8]= {0x00,0x00,0x00,0x18,0x18,0x00,0x00,0x00};
    byte d7[8]= {0x00,0x00,0x3C,0x24,0x24,0x3C,0x00,0x00};
    byte d8[8]= {0x00,0x7E,0x42,0x42,0x42,0x42,0x7E,0x00};
    byte d9[8]= {0xFF,0x81,0x81,0x81,0x81,0x81,0x81,0xFF,};
    
    //open
    byte b1[8]= {0x00,0x31,0x49,0x85,0x85,0x49,0x31,0x00};
    byte b2[8]= {0x00,0xCF,0x28,0x28,0xCE,0x08,0x0F,0x00};
    byte b4[8]= {0x00,0x84,0xC4,0xA4,0x94,0x8C,0x84,0x00};
 


//open
    printByte(b1);
    delay(500);
    printByte(b2);
    delay(500);
    printByte(b4);
    delay(500);
    
    
//lines
    printByte(d3);
    delay(200);
    printByte(d4);
    delay(200);
    printByte(d5);
    delay(200);
    printByte(d6);
    delay(200);
    printByte(d7);
    delay(200);
    printByte(d8);
    delay(200);
    printByte(d9);
    delay(200);
 
}

void printByte(byte character [])
{
  int i = 0;
  for(i=0;i<8;i++)
  {
    lc.setRow(0,i,character[i]);
  }
}



Comments

Popular posts from this blog

Information about H-Bridge

How to make Automatic Sanitizer dispenser

Snake game using arduino uno and led dot matrix display MAX7219