8*8 Single and Bi-Color Led Matrix Pin Configuration with max7219
Overview
In this tutorial, we will learn how to interfacing single and bi-color 8*8 dot matrix display using max 7219 with Arduino Uno. It also called led matrix display. Nowadays, the most common and popular display is led matrix display. A led matrix display is a 2D(two dimensional) patterned led array. Generally, it is used to display any characters, symbols, and images.
You can watch the following video below:-
Components Required
The following component needed for this tutorial:-- Arduino Uno
- 8*8 Single Color Display
- 8*8 Bi-color Display
- Max 7219 IC
- 15k Resistor
- 47uf Capacitor
- 0.1uf Capacitor
- Breadboard
- Some Jumper Wire
Dot Matrix Display Pinout
Single color led matrix has 16 pins. The pin configuration has been given below:-Fig 1.1: 16 Pins Single Color Display Display |
Fig 1.2: 24 Pins Bi-color Display Pinout |
Max7219 Pinout
The Max 7219 has 24 pins. The following below figure shows max7219 pin configuration.Fig 2.1: Max7219 pinout |
Circuit Schematic
The circuit diagram of the led matrix display and Arduino interfacing below:-
A typical 8x8 bi-color matrix display has two colors red and green. Thay has 24 pins. 8 pins are used to control 8 different columns. Rest of the 16 pins are used to control 8 different columns. 8 pins for red color and the remaining 8 pins for green color. Fig 1.2 shows the row and column pin number of the 8*8 bi-color display.
To control a led matrix display we need to 16 I/O pins of a microcontroller. Max7219 driver ic is used to reduce the use of microcontroller I/O pins. They have 24 pins(Fig 2.1). By using this driver it will be controlled by three I/O pins of a microcontroller.
The circuit will be connected to following below:-
The source code is given below:-
You can download the library from here:-
https://github.com/MajicDesigns/MD_MAX72XX
https://github.com/MajicDesigns/MD_Parola
Fig 3.1: Arduino and dot matrix display interfacing |
Circuit Description
The single color 8*8 led matrix display has 16 pins. 8 pins are used to control 8 different rows. Rest of the 8 pins are used to control 8 different columns. Fig 1.1 shows the row and column pin number of the 8*8 single color display.A typical 8x8 bi-color matrix display has two colors red and green. Thay has 24 pins. 8 pins are used to control 8 different columns. Rest of the 16 pins are used to control 8 different columns. 8 pins for red color and the remaining 8 pins for green color. Fig 1.2 shows the row and column pin number of the 8*8 bi-color display.
The circuit will be connected to following below:-
Max7219 Driver Dot Matrix Display
Pin_2 ----------------------- Row_1
Pin_3 ----------------------- Row_4
Pin_5 ----------------------- Row_6
Pin_6 ----------------------- Row_2
Pin_7 ----------------------- Row_3
Pin_9 ----------------------- Row_7
Pin_10 ----------------------- Row_5
Pin_11 ----------------------- Row_2
Pin_14 ----------------------- Clm_7
Pin_15 ---------------------- Clm_2
Pin_16 ---------------------- Clm_6
Pin_17 ---------------------- Clm_1
Pin_20 ---------------------- Clm_5
Pin_21 ---------------------- Clm_3
Pin_22 ---------------------- Clm_8
Pin_23 ---------------------- Clm_4
- The 22uf and 47uf capacitor will be connected between 5v and GND.
- Pin 18 will be connected to 5v through a 15k resistor.
- Max7219 Vcc (Pin 19) to 5V Pin of Arduino.
- Max7219 GND (Pin 4 and 8) to GND Pin of the Arduino.
- Max7219 DIN(Pin 1) to Digital Pin 11 of the Arduino.
- Max7219 CS (Pin 12) to Digital Pin 10 of the Arduino.
- Max7219 CLK (Pin 13) to Digital Pin 13 of the Arduino.
Source Code
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
// Define the number of devices we have in the chain and the hardware interface
// NOTE: These pin numbers will probably not work with your hardware and may
// need to be adapted
#define MAX_DEVICES 1
#define CLK_PIN 13
#define DATA_PIN 11
#define CS_PIN 10
char ABC[]={'1','2','3','4','5','6','7','8','9','0','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','A','B','C','D'};
// Hardware SPI connection
MD_Parola P = MD_Parola(CS_PIN, MAX_DEVICES);
// Arbitrary output pins
// MD_Parola P = MD_Parola(DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
void setup(void)
{
P.begin();
}
void loop(void)
{
for (int i=0;i<=sizeof(ABC);i++)
{
int x = ABC[i];
P.write(x);
delay(1000);
}
}
You can download the library from here:-
https://github.com/MajicDesigns/MD_MAX72XX
https://github.com/MajicDesigns/MD_Parola
No comments