Food Living Outside Play Technology Workshop
Multiple LED Matrixes with Arduino
by tumaku on August 19, 2013
Table of Contents
Multiple LED Matrixes with Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Intro: Multiple LED Matrixes with Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Step 1: Components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Step 2: Arduino Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Step 3: Wiring of common PINs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Step 4: Wiring of Data PINs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Step 5: Wiring of Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Step 6: Arduino sample sketch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Step 7: Sketch file (just in case) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Step 8: Scroll "MAKESPACE MADRID" . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
http://www.instructables.com/id/Multiple-LED-Matrixes-with-Arduino/
Intro: Multiple LED Matrixes with Arduino
This project is based on a workshop that we organised at Makespace Madrid . In a previous instructable we already introduced how to manage a single LED matrix with
Arduino. In this project we connect multiple matrixes to display text messages.
It is recommended that you have followed the previous instructable before you do this one.
Step 1: Components
For this project, you need the following components:
- Arduino Uno board
- 4 MAX7219 Red Dot Matrix Module
- 17 jumper wires M/M (male/male)
- 3 jumper wires F/M (female/male)
- Breadboard
Although this instructable uses an Arduino Uno board, you can use other Arduino (compatible) boards
IMPORTANT: The LED matrix is common cathode. This module does not work with common anode matrixes.
Step 2: Arduino Library
If you have not installed the Arduino library yet (LEDControlMS), do it now. You can find the library and the installation instructions here .
http://www.instructables.com/id/Multiple-LED-Matrixes-with-Arduino/
Step 3: Wiring of common PINs
The LED Matrix modules have two sets of male header PINs, one for input (the PINs located closer to the MAX 7219 chip) and one for output.
All the PINs are named in the modules.
The difference between input and ouput only applies to the data PIN (DIN and DOUT).
For the rest of the PINs (VCC, GND, CS and CLK), the PIN at the input header is physically connected/shortcut to the PIN at the output header (this is because all the
MAX7219 are daisy-chained sharing an SPI bus ).
Enough talking. Let's wire the LED matrixes:
First use the breadboard to plug the matrixes. Plug them through the input headers (the MAX7219 chip should be below the LED matrix). and the output header PINs
should show up at the top).
Place the four matrixes next to each other so that there is no space left between them (see picture)
Now you have to connect all the VCC PINs of all the four matrixes. Use 3 jumper wires (M/M) and connect using the breadboard holes:
- VCC of matrix 1 with VCC of matrix 2
- VCC of matrix 2 with VCC of matrix 3
- VCC of matrix 3 with VCC of matrix 4
To avoid errors connecting the wrong cable to the wrong PIN, it is recommended that you use different wire colours for different PINs (red colour in the pictures for VCC )
Repeat the same process to connect all the GND PINs of the four matrixes (yellow colour in the pictures)
Repeat the same process to connect all the CS PINs of the four matrixes (blue colour in the pictures)
Repeat the same process to connect all the CLK PINs of the four matrixes (white colour in the pictures)
http://www.instructables.com/id/Multiple-LED-Matrixes-with-Arduino/
http://www.instructables.com/id/Multiple-LED-Matrixes-with-Arduino/
Step 4: Wiring of Data PINs
The four LED matrixes are daisy-chained and this requires that the DATA output (DOUT ) of one matrix is input to the next matrix (DIN ).
Connect using F/M jumper wires (orange colour in the picture):
- DOUT of matrix 1 (header PINs) with DIN of matrix 2 (hole in breadboard)
- DOUT of matrix 2 (header PINs) with DIN of matrix 3 (hole in breadboard)
- DOUT of matrix 3 (header PINs) with DIN of matrix 4 (hole in breadboard)
Step 5: Wiring of Arduino
Now you have to connect Arduino to the first LED matrix.
Use 5 M/M jumper wires to connect:
LED Matrix 1 Arduino Colour of wire in picture
(hole in breadboard)
VCC 5V Red
GND GND Yellow
DIN D12 Orange
CS D10 Blue
CLK D11 White
It is important that you double-check all the wires and connections. One wire wrongly connected (or disconnected) is enough to prevent the correct working of the 4
matrixes.
http://www.instructables.com/id/Multiple-LED-Matrixes-with-Arduino/
Step 6: Arduino sample sketch
Download the arduino sketch below (you will need to unzip it), open it from your arduino IDE and upload it to your Arduino
Note1: if the version of your Arduino IDE is "quite" old (0.x) you will need to change the extension of the arduino sketch from .ino to .pde (MakeSpaceTitle_LEDMatrix.ino
-> MakeSpaceTitle_LEDMatrix.pde)
Note2: Before uploading the sketch, make sure that you have selected the right card and serial port for your arduino
File Downloads
MakeSpaceTitle_LEDMatrix.zip (851 bytes)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'MakeSpaceTitle_LEDMatrix.zip']
http://www.instructables.com/id/Multiple-LED-Matrixes-with-Arduino/
Step 7: Sketch file (just in case)
If you have been able to open the sketch file in the previous step, skip this step.
Here is the sketch file with .txt extension. For security reasons, instructable does not allow to upload files with uncommon extensions such as .ino used by arduino
sketches.
Open a new sketch in your arduino IDE and copy the text content of this file. You can then upload it to your arduino as explained in the previous step.
File Downloads
MakeSpaceTitle_LEDMatrix.txt (1 KB)
[NOTE: When saving, if you see .tmp as the file ext, rename it to 'MakeSpaceTitle_LEDMatrix.txt']
Step 8: Scroll "MAKESPACE MADRID"
If everything worked fine, your LED matrixes should start scrolling the text "MAKESPACE MADRID" as shown in the video.
Study the code in the example sketch and update it to display other texts or create new effects.
Just one hint: most of the methods in the library have a first parameter called 'addr' or 'matrix'. This is the index of the matrix that the command refers to. This index starts
from 0, so in our example, the matrix connected to the arduino board is index 0 and the last matrix is index 3 (see picture).
And now, if you really want to learn, dive into the code of the library to understand how it works and create new functions to make the most of your LED matrixes.
Related Instructables
LED Matrix with Office Cube Pong with 8x8 GUI Controlled Buzz Wire
Arduino by How to Make an Hour Glass by Led Matrix on LED Matrix by Alarm Clock by
tumaku Individually robboz4 Arduino (video) ben_k hertzgamma
Addressable by bsoares
LED Matrix Sign
by at0mbxmb
http://www.instructables.com/id/Multiple-LED-Matrixes-with-Arduino/
Advertisements
http://www.instructables.com/id/Multiple-LED-Matrixes-with-Arduino/