CYTHEIA AIOpen the editor

LED Matrix

Drive an 8x8 LED matrix from the Arduino.

Open this circuit and run it

Opens in your browser with the parts, wiring and code already in place. Press Run to watch it work, then change anything you like.

How it works

An 8×8 LED matrix module driven by a MAX7219-style chip needs only three signal wires: DIN (data in) on pin 12, CLK (clock) on pin 11 and CS (chip select) on pin 13, plus power and ground. The chip scans the 64 LEDs itself; the Arduino’s job is to send it commands and patterns over those three lines.

This starter sketch sets the three pins as outputs and toggles the chip-select line, pin 13, on and off every second, printing “Matrix ON” and “Matrix OFF” to the Serial tab. It is a wiring check rather than a finished display driver: to draw real patterns you send data to the chip, usually with a library such as LedControl. In the simulator the matrix draws a diagonal line of lit LEDs whenever it is powered.

Parts

Wiring

Arduino code

// LED Matrix
void setup() {
  pinMode(13, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(11, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  digitalWrite(13, HIGH);
  Serial.println("Matrix ON");
  delay(1000);
  digitalWrite(13, LOW);
  Serial.println("Matrix OFF");
  delay(1000);
}

Try changing it

Open this circuit and run it

Next challenge

More projects in Displays