MAX7219 and 8x8 LED Matrix on breadboard

MAX7219 and 8x8 LED Matrix on breadboard © CC0

Ever want to control an 8x8 LED Matrix? Here is a controller that can help.

  • 6,328 views
  • 0 comments
  • 8 respects

Components and supplies

About this project

After reading up on Project #21: "Creating an LED Matrix" from "The Arduino Workshop" I set out to find a 8x8 common cathode led matrix. I saw this MAX7219 8X8 Red Dot LED Matrix Kit on Amazon and even though I was looking to experiment with using two 74HC595's to control the rows and columns, this MAX7219 chip that did it all caught my curiosity. So I ordered the kit. Amazon Prime delivered quickly.

The MAX7219

The kit was relatively easy to solder. Both the 8x8 display and the MAX7219 are socketed so you can easily remove them if you want to use in a different project. From the looks of it, the board can be easily cascaded with other devices to create larger displays. John Boxall does exactly that in his book "The Arduino Workshop" and posts a copy of the project online here.

One single MAX7219 can also control up to 8 7-segment displays. Unlike my prior example, where each 7 segment display is driven by an individual 74HC595, the MAX7219 multiplexes the 7 segment displays so that only one is on at a time. This cuts the current usage and because of the persistence of vision it appears that all 8 digits are on constantly.

Software

The LedControl Arduino library has full support for the MAX7219 to control an 8x8 display. The library does all the shifting out and multiplexing of row and column LEDs. All you do is tell it the row and column of the LED you would like to turn on or off!

So here is a peek at my finished MAX7219 8X8 Red Dot LED Matrix Kit running the test program.

Code

LedControlC/C++
#include "LedControl.h" //  need the library
LedControl lc=LedControl(12,11,10,1); // 

// pin 12 is connected to the MAX7219 pin 1 - Data In
// pin 11 is connected to the CLK pin 13
// pin 10 is connected to LOAD pin 12
// 1 as we are only using 1 MAX7219

void setup()
{
  // the zero refers to the MAX7219 number, it is zero for 1 chip
  lc.shutdown(0,false);// turn off power saving, enables display
  lc.setIntensity(0,8);// sets brightness (0~15 possible values)
  lc.clearDisplay(0);// clear screen
}
void loop()
{
  for (int row=0; row<8; row++)
  {
    for (int col=0; col<8; col++)
    {
      lc.setLed(0,col,row,true); // turns on LED at col, row
      delay(25);
    }
  }

  for (int row=0; row<8; row++)
  {
    for (int col=0; col<8; col++)
    {
      lc.setLed(0,col,row,false); // turns off LED at col, row
      delay(25);
    }
  }
}

Comments

Similar projects you might like

Programming 8x8 LED Matrix

by SAnwandter1

  • 113,872 views
  • 26 comments
  • 105 respects

8X8 Matrix LED Snake Game (HTML5 Web Socket)

Project showcase by hmkim

  • 5,397 views
  • 1 comment
  • 14 respects

8x8 Matrix LED Snake Game (Smartphone Motion)

Project tutorial by hmkim

  • 4,577 views
  • 2 comments
  • 17 respects

Remote-Controlled 8x8 LED Matrix

Project showcase by hmkim

  • 4,421 views
  • 6 comments
  • 27 respects

Analog Clock with LED Matrix and Arduino

Project tutorial by LAGSILVA

  • 12,237 views
  • 8 comments
  • 39 respects
Add projectSign up / Login