8x8 LED Matrix Using Arduino
8x8 LED Matrix Using Arduino
This module will be interfaced with Arduino for displaying alphabets, hence the matrix
display. First of all for interfacing LED matrix with Arduino, we need to download a library
specifically designed for LED MATRIX. This library will be available at:
https://github.com/shaai/Arduino_LED_matrix_sketch/archive/master.zip
After downloading the Zip file, extract the contents to ARDUINO folder. (Go to local disk where
ARDUINO NIGHTLY software is installed, open the folder, search for folder named library,
extract the contents of zip file in that folder, restart the program you will now be able to use features
for matrix interface)
Components Required
Hardware: Arduino Uno, Power supply (5v), 100 uF capacitor (connected across power supply)
Software: Arduino Nightly
Now for using the special futures called by installing new library, we need to establish few
commands in program and are stated below.
#include "LedControlMS.h"
#define NBR_MTX 1
LedControl lc=LedControl(4,3,2, NBR_MTX);
lc.writeString(0,"CIRCUITDIGEST");
lc.clearAll();
First we need to call the header file for interfacing a LED matrix to Arduino Uno. That is #include
"LedControlMS.h", this header file call the library special functions.
We have a feature with these modules we can connect many number of modules in series and
program them together as a single display. This feature comes in handy when we need a display unit
which could display multiple characters at a time. So we need to tell the controller how many
displays we are connecting.
In this module there are mainly three pins; data flow from UNO to module takes places with these
three pins. The pins are DATAIN (data receiving pin), CLOCK (clock pin), and CHIPSELECT
(command receiving pin).
Now we need to tell the UNO where we are connecting these pins. This is done by command
LedControl lc=LedControl(4,3,2, NBR_MTX); . lc.writeString(0,"CIRCUITDIGEST");, this
command is used for telling UNO which characters are to be displayed on the LED matrix. With the
above the display shows CIRCUITDIGEST, with each character once.
We need to clear the display chip memory before sending any other data, this is done by command
lc.clearAll();".
By this way we can easily interface a 8x8 LED matrix to Arduino Uno.
Code:
#include "LedControlMS.h"
//pin 4 is connected to the DataIn
// pin 3 is connected to the CLK
//pin 2 is connected to LOAD
#define NBR_MTX 1 //number of matrices attached is one
LedControl lc=LedControl(4,3,2, NBR_MTX);//
void setup()
{
for (int i=0; i< NBR_MTX; i++)
{
lc.shutdown(i,false);
/* Set the brightness to a medium values */
lc.setIntensity(i,8);
/* and clear the display */
lc.clearDisplay(i);
delay(100);
}
}
void loop()
{
lc.writeString(0,"CIRCUITDIGEST");//sending characters to display
lc.clearAll();//clearing the display
delay(1000);
}
Video:
https://youtu.be/VrW6Bo876kw
URL :http://circuitdigest.com/microcontroller-projects/arduino-8x8-led-matrix