Arduino 8x8 DOT_Matrix

About: I love DIY Electronics

Wassup Guys!!

In this instructable, I'm going to show you how to Interface with LED Dot 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 it also serves as a basic to getting started with controlling a large number of LEDs using the Arduino Uno.

Step 1: Components Needed

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

  1. Arduino Uno
  2. 8x8 LED matrix with MAX7219
  3. Breadboard
  4. Header Wires
  5. 5V power supply
  6. Arduino IDE

Step 2: Circuit

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 Arduino 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 four Arduino pins to control the LEDs.

The connections are very simple, no soldering skills required.

The Connections are:
Max7219 CLK = Arduino digital pin10

Max7219 CS = Arduino digital pin9

Max721 DIN = Arduino digital pin8

Max721 GND = Arduino digital GND

The VCC pin from the LED matrix should be connected to an external 5v power supply (5v 1A recommended), each pin of the Arduino is capable of providing a max current of 40mA. And the 5V regulator is capable of providing a max current of 200mA. The led matrix requires higher operating current.

Step 3: CODE

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

#include <LedControl.h>

int DIN = 12; int CS = 11; int CLK = 10;

LedControl lc=LedControl(DIN,CLK,CS,0);
void setup(){

lc.shutdown(0,false); //The MAX72XX is in power-saving mode on startup lc.setIntensity(0,15); // Set the brightness to maximum value lc.clearDisplay(0); // and clear the display }

void loop(){
byte a[8] = {0x3C,0x42,0xA5,0x81,0xA5,0x99,0x42,0x3C}; printByte(a); delay(1000); }

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

Step 4: Library Setup

Before you get started with coding you need Arduino IDE.

To download Arduino IDE and for Arduino setup, you can check my previous instructable. And for this Instructable you need LedControl Matrix LIbrary, you can download it from the link below.

"LED Control Library"

Ok, let's begin with coding.

Step 5: Generate Paterns

To generate patterns you need Pixel to matrix converter. The converter file is attached below, you can download and use it.

The patterns are generated by editing an array in the code to the required hex array, this hex array can be generated by downloading the converter and using the tool to generate hex strings, after you have generated the string you can copy and paste the string in the sample code from the previous step to generate custom patterns.

Step 6: OUTPUT

That's all viewers.

Hope you enjoy by trying various patterns.

Thank you.



    • PCB Contest

      PCB Contest
    • Make it Glow Contest 2018

      Make it Glow Contest 2018
    • Big and Small Contest

      Big and Small Contest



    Tip 11 days ago

    It is much faster and take program storage if you use the SPI library. It requires though that you use pin 13 SCL for clock and pin 11 MOSI (Master Out Slave In) for DIN (Data In) on the MAX7219. In this way you dont use the shiftOut() but let Atmel do the shift out for you.

    If for some reason pin 13 and 11 is used for something else the LedControl can come in handy. Otherwise avoid it.