LED Matrix with SPI MAX7219

2024-04-18, by Frank Delporte

Roberto Marquez shared a project with us that uses Java to interface with a MAX7219 SPI device to control an LED matrix. It’s inspired by the blog Raspberry Pi and SPI 8×8 LED matrix example with Java and Pi4j, but differs in that it is Web-enabled via Spring Boot. This project is the starting point to create a weather station in combination with the BMP280, see BME280 Sensor (temp, humidity, pressure) via Pi4J, I2C, and JBang.

While working on his project, Roberto contributed extra LED character definitions for the Pi4JLedMatrixSpi.java single-file application in the Pi4J V2 JBang project.



This demo project uses:

  • Raspberry Pi 2 Model B V1.1
  • 8x8 LED Matrix with Max7219 SPI


  • DIN -> blue -> MOSI -> header 19
  • CS -> purple -> CE0 -> header 24
  • CLK -> white -> SCLK -> header 23
  • VCC -> 5V -> header 2
  • GND -> ground -> header 9

Project and Code

Check the README in the project sources of Roberto for more info.