Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Controlled Multi-Matrix LED Display

View and Edit Project In Cirkit DesignerImage of Arduino UNO Controlled Multi-Matrix LED Display

Circuit Documentation

Summary

This circuit consists of an Arduino UNO microcontroller connected to a series of MAX7219 8x8 LED Matrix modules. The Arduino UNO controls the LED matrices using a bit-banged SPI communication protocol. The matrices are daisy-chained together, allowing for control over a large display area using a minimal number of microcontroller pins. The circuit is designed to create visual patterns or display information across the LED matrix array.

Component List

Arduino UNO

MAX7219 8x8 LED Matrix

Wiring Details

Arduino UNO

MAX7219 8x8 LED Matrix

Documented Code

// This version uses bit-banged SPI.
// If you see tearing (jagged edges on the circles) try the version
// which uses AVR's hardware SPI peripheral:
// https://wokwi.com/arduino/projects/318868939929027156

#define CLK 12
#define DIN 11
#define CS  10
#define X_SEGMENTS   4
#define Y_SEGMENTS   4
#define NUM_SEGMENTS (X_SEGMENTS * Y_SEGMENTS)

// a framebuffer to hold the state of the entire matrix of LEDs
// laid out in raster order, with (0, 0) at the top-left
byte fb[8 * NUM_SEGMENTS];

void shiftAll(byte send_to_address, byte send_this_data)
{
  digitalWrite(CS, LOW);
  for (int i = 0; i < NUM_SEGMENTS; i++) {
    shiftOut(DIN, CLK, MSBFIRST, send_to_address);
    shiftOut(DIN, CLK, MSBFIRST, send_this_data);
  }
  digitalWrite(CS, HIGH);
}

void setup() {
  Serial.begin(115200);
  pinMode(CLK, OUTPUT);
  pinMode(DIN, OUTPUT);
  pinMode(CS, OUTPUT);

  // Setup each MAX7219
  shiftAll(0x0f, 0x00); //display test register - test mode off
  shiftAll(0x0b, 0x07); //scan limit register - display digits 0 thru 7
  shiftAll(0x0c, 0x01); //shutdown register - normal operation
  shiftAll(0x0a, 0x0f); //intensity register - max brightness
  shiftAll(0x09, 0x00); //decode mode register - No decode
}

void loop() {
  // Code to create visual patterns or display information
  // ...
}

// Additional functions to manipulate the LED matrix
// ...

The provided code initializes the Arduino UNO and the MAX7219 LED matrices and contains functions to control the LED states. The shiftAll function sends data to all connected MAX7219 modules, and the setup function initializes the matrices with the required configuration. The loop function is intended to contain the logic for creating visual patterns or displaying information. Additional functions are implied to be present for pixel manipulation and framebuffer management.