LED Matrix
Drive an 8x8 LED matrix from the Arduino.
- Intermediate
- Displays
- 2 parts
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
- Arduino Uno
- LED Matrix 8x8
Wiring
- Arduino Uno 5V → LED Matrix 8x8 VCC
- Arduino Uno GND → LED Matrix 8x8 GND
- Arduino Uno D12 → LED Matrix 8x8 DIN
- Arduino Uno D13 → LED Matrix 8x8 CS
- Arduino Uno D11 → LED Matrix 8x8 CLK
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
- Blink the chip-select line faster by changing both delay(1000) lines to delay(250).
- Use a different chip-select pin: change 13 to 10 in the code and move the CS wire to D10 in the editor.