About: Arduino fan!

In this tutorial we will learn how to control the MAX7219 Led matrix with Arduino by displaying a simple text.

Watch a demonstration video.

Step 1: What You Will Need

  1. Arduino UNO (or any other Arduino)
  2. LED MATRIX. We are going to use the FC-16 module which has four casacaded 8×8 LED Matrix Displays and a built-in MAX7219 LED Driver for each display.
  3. Jumper wires
  4. Visuino program: Download Visuino

Step 2: The Circuit

  1. Connect LED Matrix pin[VCC] to Arduino pin[5V]
  2. Connect LED Matrix pin[GND] to Arduino pin[GND]
  3. Connect LED Matrix pin[DIN] to Arduino digital pin[11]
  4. Connect LED Matrix pin[CS] to Arduino digital pin[10]
  5. Connect LED Matrix pin[CLK] to Arduino digital pin[13]

Note: Read also the part for Troubleshooting below

Step 3: Start Visuino, and Select the Arduino UNO Board Type

To start programming the Arduino, you will need to have the Arduino IDE installed from here:

Please be aware that there are some critical bugs in Arduino IDE 1.6.6. Make sure that you install 1.6.7 or higher, otherwise this Instructable will not work! If you have not done follow the steps in this Instructable to setup the Arduino IDE to program Arduino UNO! The Visuino: also needs to be installed. Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2

Step 4: In Visuino Add Components

  1. Add "Clock Generator" component
  2. Add "Text Value" component
  3. Add "Counter" component
  4. Add "Integer Multi Source"
  5. Add "Maxim LED Display Controller SPI MAX7219/MAX7221" component

Step 5: In Visuino Set Components

  1. Select "ClockGenerator1" and in the properties window set "Frequency" to: 5
  2. Select "Counter1" and in the properties window set Max>Value to 0 and Min>Value to -170

    Note: -170 is the distance on X (length of the text), that the text will travel from left to the right, you can play with this number to get the right length
  3. Select "IntegerMultiSource1" and in the properties window set "Output Pins" to: 3
  4. Select "TextValue1" and set the "Value" (This is the text you want to display on the LED Matrix): ARDUINO LED MATRIX PROJECT
    1. Select "LedController1" and in the properties window select "Pixel Groups" and click on the 3 dots.
      In the "PixelGroups" window drag "2D Graphics" from right side to the left side
      Select "2D Graphics1" on the left side and in the properties window set :
      - "Height" to 8
      - "Mirror Horizontal" to true
      - "Orientation" to goUp
      - "Reverse Horizontal" to True
      - "Reverse Vertical" to False
      - "Width" to 32
      - Select "Elements" and click on the 3dots

      In the "Elements" window drag "Fill Screen" to the left, expand "Text" and drag "Text Field" to the left side.
      Select "Text Field1" and in the properties window set "Wrap" to False, Select "X" and click on the "Pin" icon and select "Integer SinkPin" <<see the picture

      Close All windows
    2. Select "LedController1" and in the properties window set "Intensity" to 0.1 <

    Step 6: In Visuino Connect Components

    1. Connect "ClockGenerator1" pin [Out] to "Counter1" pin[In]
    2. Connect "Counter1" pin [Out] to IntegerMultiSource1 pin [In]
    3. Connect "IntegerMultiSource1" pin[0] to "LedController1" > Text Field1 > X
    4. Connect "IntegerMultiSource1" pin[1] to "LedController1" > Fill Screen1 > Clock
    5. Connect "IntegerMultiSource1" pin[2] to "TextValue1" pin [Clock]
    6. Connect "TextValue1" pin[Out] to "LedController1" > Text Field1 > In
    7. Connect "LedController1" pin [Chip Select] to Arduino digital pin[10]
    8. Connect "LedController1" pin [Out SPI] to Arduino pin[SPI In]

    Step 7: Generate, Compile, and Upload the Arduino Code

    In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.

    Step 8: Play

    If you power the Arduino UNO module, the LED Matrix will start to Display the text from left side to the right side.

    Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable, you can download it here and open it in Visuino:

    Step 9: Troubleshooting

    In my case When powering the Arduino the LED Matrix was blinking and the Text was not fully displayed. The reason for this was because MAX7219 chip is very sensitive to any voltage interference.

    To solve that I added a 47uf electrolytic capacitor between the LED Matrix VCC(+) and GND(-), make sure you connect the capacitor right, + on (VCC) and - on the (GND)