Sei sulla pagina 1di 24

ELECTRONICS HUB

P R OJ E C T S | T U TO R I A L S | C O U R S E S | K I T S

HOME PROJECTS MINI PROJECTS ARDUINO FREE CIRCUITS TUTORIALS SYMBOLS

DIY COURSES CONTACT US

YOU ARE HERE: HOME / ARDUINO / ARDUINO 8×8 LED MATRIX

Arduino 8×8 LED Matrix


JANUARY 9, 2018 BY ADMINISTRATOR — 21 COMMENTS

In this project, we will learn about LED Matrix Displays and two di erent projects on Arduino
8×8 LED Matrix Interface. The rst project will be a simple interface between Arduino and 8X8
LED Matrix to display information (even scrolling information and images can be displayed)
and the second project will be an advanced project where the 8×8 LED Matrix is controlled
through an Android device.

An LED matrix is a two dimensional array of LEDs that can be used to display symbols,
characters or even images. Based on the orientation of the LEDs in the matrix, there can be
two types of LED matrices.They are Common Row Anode and Common Row Cathode.
Arduino 8x8 LED Matrix

LED matrix modules are one of the commonly used display devices and are used in major
applications like electronic display panels and noti cation systems.

Select the Next Set of Arduino Projects You Want to Learn in Electronicshub: Arduino
Projects»

Table of Contents 
1. Project 1: Simple Arduino LED Matrix Interface
1.1. Circuit Diagram
1.2. Components Required
1.3. Component Description
1.3.1. Arduino Uno
1.3.2. LED Matrix
1.3.3. IC MAX 7219
1.4. Working
1.5. Code
2. Project 2: Arduino 8X8 LED Matrix Interface with Android Phone
2.1. Circuit Diagram
2.2. Components Required
2.3. Circuit Design
2.4. Controlling 8×8 LED Matrix through Android App
2.5. Download Android App
2.6. Code
3. Applications

Project 1: Simple Arduino LED Matrix Interface


Circuit Diagram
-50% -40%

-30% -30% -40%

Components Required
Arduino Uno board  [Buy Here]
LED Matrix – 8 x 8 LED dot matrix
IC1  – MAX 7219
R1 – 10 KΩ
C1 – 0.1 µF
C2 – 10 µF

Component Description
Arduino Uno

The project is based on the Arduino Uno microcontroller board. Out of the 14 available digital
input / output pins on the Arduino Uno, we need only three pins to implement this project.

One pin provides the clock signal to the LED display driver IC (MAX 7219) while another pin is
used to transmit the serial data to the IC for displaying on the LED matrix. The corresponding
pins must be appropriately mentioned in the program.

LED Matrix

An 8 x 8 LED matrix display is used in this project to display the information. LED matrices are
available in di erent styles like single color, dual color, multi-color or RGB LED matrix.

They are also available in di erent dimensions like 5 x 7, 8 x 8, 16 x 16, 32 x 32 etc. Based on the
arrangement of the LEDs in the matrix, an LED matrix can be either common row anode or
common row cathode.

In case of common row anode type LED matrix, the current sources (high or positive voltage)
are given to the rows A-D and the current sinks (low or negative voltage or ground) are given
to the columns 1-4.
In case of common row cathode type LED matrix, the current sources (high or positive voltage)
are given to the columns 1-4 and the current sinks (low or negative voltage or ground) are
given to the rows A-D.

The LED matrix used in this project is a common row cathode type LED matrix. While
developing the project, the type of LED matrix must be known and the program must be
written accordingly.

IC MAX 7219

The LED matrix can be driven in two ways. They are parallel (where each row or column are
sent with parallel data) and serial (where the data is sent serially and an IC is used to convert
this serial data into parallel data).

MAX 7219 is a common cathode display driver with serial input and parallel output. It is used to
interface microprocessors and microcontrollers with 64 individual LEDs (8 x 8 LED matrix for
example has 64 LEDs), seven segment LED displays up to 8 digits or bar graph displays.
The 8 x 8 LED matrix is connected to the MAX 7219 as shown in the circuit diagram and the
data input is received from the Arduino board to the MAX 7219.

NOTE:

Pre-wired MAX 7219 and 8 x 8 LED matrix modules are available in the market. They can be
used for convenience.

Working
The aim of the project is to interface an Arduino Uno board with an 8 x 8 LED matrix to display
information.

Even though a single 8 x 8 LED matrix with corresponding MAX 7219 IC is used in this project,
multiple LED matrices can be connected in series for long scrolling display. Connect the
components as shown in the circuit diagram. The working of the system is as follows.

3 of the 14 available digital input / output pins are used to control the display driver IC MAX
7219. The 3 pins on the MAX7219 IC are clock, data in and load (or cs in case of MAX 7221 IC). A
maximum clock frequency of 10MHz can be applied. DIN (Data in) accepts the serial data from
the microcontroller or Arduino board.

It is 16 bit long where the rst 8 bits (D0 – D7) are for driving the columns (SEG A-G and DP of
the MAX 7219 IC) of the LED matrix and the next 8 bits (D8 – D15) are for driving the (DIG 0-7 of
the MAX 7219 IC) rows of the LED matrix.

The load pin (or CS or chip select pin in case of Max 7221 IC) latches the serial input data on its
rising edge.
Another important pin on MAX 7219 is the ISET, which sets the peak current to the segment to
drive all the LEDs. It is connected via a resistor (R1), which is called RSET. The capacitors lters
out any noise in the supply.

When the serial data in is sent using the Arduino (through the program), the serial data is
converted into segments and digits to drive columns and rows of the LED matrix. According to
the data sent, the corresponding LEDs on the matrix light up and display the message.

The program written here is for scrolling text display. It might be di cult to view long scrolling
data on a single 8 x 8 LED matrix. Hence, multiple LED matrices can be chained to form a long
matrix.

The no. of MAX 7219 ICs are equal to the no. of 8 x 8 LED matrices. In order to extend the
display to multiple LED matrices, the Data OUT (DOUT) pin of the rst MAX 7219 must be
connected to the Data IN (DIN) pin of the second MAX 7219 IC. This process must be continued
for multiple LED matrices.

(The positioning of the LED Matrix in the chain is important. The rst LED matrix must be
placed at the right of the chain.)

Code

1 #include <LedControl.h>

2
3 int DIN = 13;

4 int CS = 12;

5 int CLK = 11;

6
7
8 byte E[8] = {0x3C,0x20,0x20,0x3C,0x20,0x20,0x20,0x3C};

9 byte L[8] = {0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x3E};

10 byte C[8] = {0x1C,0x20,0x20,0x20,0x20,0x20,0x20,0x1C};

11 byte T[8] = {0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x10};

12 byte R[8] = {0x38,0x24,0x24,0x28,0x30,0x28,0x24,0x24};

13 byte O[8] = {0x1C,0x22,0x22,0x22,0x22,0x22,0x22,0x1C};

14 byte N[8] = {0x42,0x62,0x52,0x52,0x4A,0x46,0x46,0x42};

15 byte I[8] = {0x38,0x10,0x10,0x10,0x10,0x10,0x10,0x38};

16 byte S[8] = {0x1C,0x20,0x20,0x10,0x08,0x04,0x04,0x38};

17 byte H[8] = {0x22,0x22,0x22,0x3E,0x22,0x22,0x22,0x22};

18 byte U[8] = {0x22,0x22,0x22,0x22,0x22,0x22,0x22,0x1C,};

19 byte B[8] = {0x38,0x24,0x24,0x38,0x38,0x24,0x24,0x38};

20 byte smile[8]= {0x3C,0x42,0xA5,0x81,0xA5,0x99,0x42,0x3C};

21 byte neutral[8]= {0x3C,0x42,0xA5,0x81,0xBD,0x81,0x42,0x3C};


22 byte frown[8]= {0x3C,0x42,0xA5,0x81,0x99,0xA5,0x42,0x3C};
23
24 LedControl lc=LedControl(DIN,CLK,CS,1);

25
26 void setup(){
27 lc.shutdown(0,false);

28 lc.setIntensity(0,5);

29 lc.clearDisplay(0);

30 }

31
32 void loop()

33 {

34 printByte(smile);

35 delay(1000);

36
37 printByte(neutral);

38 delay(1000);

39
40 printByte(frown);

41 delay(1000);
42
43 printByte(E);

44 delay(1000);

45
46 printByte(L);
47 delay(1000);

48
49 printByte(E);

50 delay(1000);

51
52 printByte(C);

53 delay(1000);

54
55 printByte(T);

56 delay(1000);
57
58 printByte(R);

59 delay(1000);

60
61 printByte(O);
62 delay(1000);

63
64 printByte(N);

65 delay(1000);

66
67 printByte(I);
68 delay(1000);
69
70 printByte(C);
71 delay(1000);

72
73 printByte(S);

74 delay(1000);

75
76 lc.clearDisplay(0);

77 delay(1000);

78
79 printByte(H);

80 delay(1000);
81
82 printByte(U);

83 delay(1000);

84
85 printByte(B);
86 delay(1000);

87
88
89 lc.clearDisplay(0);

90 delay(1000);
91 }

92
93
94 void printByte(byte character [])

95 {
96 int i = 0;

97 for(i=0;i<8;i++)

98 {

99 lc.setRow(0,i,character[i]);

100 }
101 }

Arduino LED Matrix hosted with by GitHub view raw

NOTE

The program uses a library called LedControl. This library must be added to the Arduino
IDE and the header le LedControl.h must be included in the program.
The use of this library le is to enable multiple MAX 7219 ICs to be integrated and also
provide scrolling text. The library can be downloaded from this link.
Project 2: Arduino 8X8 LED Matrix Interface with Android
Phone
The second circuit in the Arduino 8×8 LED Matrix Interface series is based on Bluetooth
Communication and Android Phone. In this project, we have interface Arduino with an Android
phone using Bluetooth Communication and the 8×8 LED Matrix connected to Arduino through
MAX7219 is controlled through a dedicated application on the Android Phone.

We have already seen in the previous project as how the 8×8 LED Matrix and the MAX7219 IC
are connected. So, I’ll skip that part of the connection and proceed with how MAX7219 IC is
interfaced with Arduino.

But I haven’t mentioned the Pin Diagram of a typical 8×8 LED Matrix in the previous circuit. So,
to have a ful lment, the following image shows the pin out of an 8×8 LED Matrix.

As you can observe, an 8×8 LED Matrix consists of 16 pins: 8 Rows and 8 Columns. Usually, the
Rows are associated with the Anodes of the LEDs and the Columns are associated with the
Cathodes of the LEDs.

Circuit Diagram

Components Required
Arduino UNO
MAX7219 IC Board
8×8 LED Matrix
HC-05 Bluetooth Module
Android Phone with App installed

Circuit Design
Since the communication between Arduino and MAX7219 is based on SPI Communication
Protocol, all we need is three pins from Arduino (Data, Clock and Chip Select). The CS, CLK and
DIN pins of the MAX7219 IC Board are connected to pins 10, 11 and 12 of the Arduino.

As we are using the Bluetooth connection between Arduino and Android device, the RX and
TX pins of the HC-05 Bluetooth Module are connected to TX and RX pins of the Arduino (Pins 1
and 0).
Controlling 8×8 LED Matrix through Android App
A dedicated app for Android based devices is designed for this project. The layout of the app
which is already installed on a mobile phone is shown in the following image.

The app has 8×8 squares (each corresponding to one LED on the 8×8 LED Matrix), a Reset
button and a Disconnect button. Touching a particular square will turn ON the particular LED in
the 8×8 LED Matrix.

The color of the square will turn Red, as an indication that the LED is turned ON. Touching the
square once again will turn OFF the corresponding LED and the color of the square will revert
back to grey.

A Reset button is given at the bottom, using which you can reset the 8×8 LED Matrix i.e. all the
LEDs will be turned OFF. The disconnect button will get disconnected from the Bluetooth.

NOTE: The app utilizes the Bluetooth feature of the phone. Hence, necessary permissions
must be given. Also, the HC-05 Bluetooth Module must be paired with the device (Phone).
Download Android App
You can download and install the App used in this project for Android Devices. Use this link to
install the App.

Code

1 #include <LedControl.h>
2
3 int DIN = 12;
4 int CS = 10;
5 int CLK = 11;
6
7
8 int row=0;

9 int col=0;
10 int temp=0;
11 int data=0;
12
13 LedControl lc=LedControl(DIN,CLK,CS,1);

14
15 void setup()
16 {
17 lc.shutdown(0,false);
18 lc.setIntensity(0,5);
19 lc.clearDisplay(0);

20 Serial.begin(9600);
21 }
22
23
24
25
26 void loop()
27 {
28 if(Serial.available() > 0)
29 {
30 data = Serial.read();// it returns ascii value if we send one in the phone
31 if(data < 96)
32 {
33 if(temp==0)
34 {
35 row=data-48;
36 temp=1;
37 }
38 else
39 col=data-48;
40 }
41
42 else if(data=='n')
43 {

44 lc.setLed(0,row,col,true);
45 Serial.println('n');
46 Serial.println(row);
47 Serial.println(col);
48 temp=0;

49 }
50 else if(data=='f')
51 {
52 lc.setLed(0,row,col,false);
53 Serial.println('f');

54 Serial.println(row);
55 Serial.println(col);
56 temp=0;
57 }
58
59 else if(data=='r')
60 lc.clearDisplay(0);
61 }
62
63
64 }
65

Arduino_8x8_LED_Matrix_Android_Phone.ino hosted with by GitHub view raw

Applications
Arduino based 8 x 8 LED matrix display uses only 3 pins of the Microcontroller. Hence, it
can be used in applications where displaying information is a part of the system in which
other pins of the microcontroller can be used for other peripherals.
LED Matrix is a basic form of display device that is used for displaying information at
public places like bus or train stations.
Multiple LED matrices can be combined to form large displays and can be used to
display images with multi colors.

-40%

FILED UNDER: ARDUINO

Comments

ss says
MAY 2, 2016 AT 7:46 PM

i need H le … just now dont working

Reply

Anaya Singh says


SEPTEMBER 8, 2018 AT 6:53 AM

the h le is given look clearly on the page

Reply
Ravi says
DECEMBER 7, 2017 AT 6:24 AM

really nice..

Reply

shrishail wali says


FEBRUARY 13, 2018 AT 5:33 AM

my project has not working what i can do

Reply

Sunil madiwal says


MARCH 13, 2018 AT 11:17 AM

This project is very nice and easy

Reply

Hoang says
MARCH 19, 2018 AT 7:01 AM

Thank you so much!


I did it.
<3

Reply

Ankit Kumar Singh says


APRIL 12, 2018 AT 3:57 AM

Send me full code for this project. Email _ hay.ankitsingh@gmail.com

Reply

Ravi says
APRIL 13, 2018 AT 12:08 AM

Hi,
we have provided everything in the website – code, link for the app.

Reply

adi says
JULY 27, 2018 AT 5:14 AM

Is Max 7219 chip compatible for 8×8 led matrix common anode displays? i need
help, please share with me schematic diagram of max7219 + 8×8 led matrix
common anode module. thank you

Reply

Ankit Kumar Singh says


APRIL 25, 2018 AT 12:38 PM

For control using app, which code i have to copy (code without the app or with app code)
with the library?

Reply

Ravi says
APRIL 26, 2018 AT 1:52 AM

Use the second code (which is below the Download App link).

Reply

Mir Uzaif Talpur says


JULY 30, 2018 AT 4:52 AM

Brother i am glad that you are did this great work because my teacher rejected my recent
project of Mobile Phone Controlled Vehicle using bluetooth but now worries now i can buy
led module and can use old components of my ex project Thank you

Reply

pAVAK says
AUGUST 19, 2018 AT 3:25 AM

HOW TO CONTROL 4 MODULE OF SAME….PLEASE SEND ME CODE.

Reply

Namrata says
AUGUST 27, 2018 AT 3:12 AM

How to cascade 4 led matrix?


please provide the code

Reply
Margarita says
AUGUST 31, 2018 AT 8:30 AM

I am currently doing the one with the android phone. I’ve copied the codes and everything.
I was also able to connect my phone to HC-05 with the app but the thing is that the led
matrix won’t light up. Please help!!

Reply

Evert Dankert says


NOVEMBER 9, 2018 AT 4:03 AM

Hi, in your schedule, I think you mixed RXD and TXD connection.

Reply

chayaphon kingmanao says


DECEMBER 6, 2018 AT 8:03 PM

Very Nice !!

Reply

Roelke says
DECEMBER 15, 2018 AT 12:39 PM

Help i’m in mirror

Reply

Shiki says
DECEMBER 30, 2018 AT 10:11 AM
Hi, how can I control multiple dot matrix displays individually? By the post you’ve written, it
seems like the multiple displays would display the same thing in each one

Reply

guy says
MAY 4, 2019 AT 5:48 AM

where can i get the led control h library

Reply

Rajdeep Sarkar says


MAY 5, 2019 AT 3:41 AM

What is the app on android. Please tell me.

Reply

Leave a Reply
Your email address will not be published. Required elds are marked *

Comment
Name *

Email *

Website

POST COMMENT

Search this website

PCB Assembly Services

-40% -40%

-30% -50% -40%


-40%

PROJECTS BY CATEGORY

Arduino Projects (200+)


Electronics Projects (250+)
Mini Project Circuits (160+)
Mini Project Ideas (150+)
ECE Projects (150+)
EEE Projects (150+)
8051 Projects (110+)
Raspberry Pi Projects (101+)
Electrical Project Ideas (100+)
Embedded Projects (100+)
Latest Electronics Ideas (100+)
Microcontroller Mini Projects (100+)
Robotics Projects (100+)
VLSI Projects (100+)
Solar Projects (100+)
IOT Projects (100+)

Communication Projects (70+)


LED Projects (70+)
Power Electronics Projects (60+)
RFID Projects (60+)
Home Automation Projects (50+)
Matlab Projects (50+)
EIE Projects (50+)
Wireless Projects (50+)
LabView Projects (45+)
Zigbee Projects (45+)
GSM Projects (40+)
555 Timer Circuits (40+)
Sensor Projects (40+)
ARM Projects (60+)
DTMF Projects (30+)
PIC Projects (30+)
Electrical Mini Projects (25)
ESP8266 Projects (15)

KITS

Best Drone Kits [12]


3D Printer Kits [12]
Best Robot Vacuum Clears [14]
Best Waveform Generators [12]
RGB LED Strip Light Kits [20]
Best LED Christmas Light Kits [13]

SUBSCRIBE FOR UPDATES

Enter your email address:


SUBSCRIBE

GENERAL PROJECTS PROJECTS

Tutorials Electrical Mini projects


Symbols Electronics Microcontroller

Courses Embedded Arduino


Calculator Power Solar
Contact Robotics Free circuits
HomeZene ARM Home Automation

Best Arduino Kits IOT Seminar Topics


Electronics Questions

TUTORIALS TUTORIALS FOLLOW US

Capacitors Ampli ers Instagram

Resistors IO Devices Youtube


Filters Thyristors Facebook
Diodes DC Circuits Google Plus

Transistors Number System Twitter


TS EAMCET 2019

[footer_backtotop]
Copyright © 2019 Electronicshub.org

Potrebbero piacerti anche