How to Build custom character using pixeltomatrix to LED Matrix 8x8 Driven by MAX7219
What Will I Learn?
In this tutorial, you will learn the following
HARDWARE
- Step 1: Gather all the Requirements
Requirements
For this part, you will need the following arduino components
Difficulty
- Intermediate
Tutorial Contents
- Step 2: Build the circuit
Experimental Procedures
The arduino UNO R3
has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header and a reset button. 32k Flash Memory,
codes and programs can be uploaded on to it from the easy Arduino computer program. which makes it a very easy way to get started working with embedded electronics. The name R3 is the third, and latest version of Arduino Uno Board
The LED Matrix 8x8 Driven by MAX7219
The 8×8 LED matrix is made up of red 64 LEDs, the driver MAX7219 chip it is built in pcb to control the LED matrix, header PINs and sockets, one 10KOhm resistor, a 100nF capacitor, a 10uF electrolic capacitor where everything is connected. The LED matrix being used in this tutorial comes pre-soldered with the MAX7219 Controller this matrix typically used for displaying text, counters, symbols, numbers and etc.
Connection to arduino
the Driver MAX7219 has 5 pins the power pins GND / VCC , and the Digital pin output DIN,CS and CLK which will connect to specified arduino D pins.
- VCC - 5V
- GND - GND
- DIN - digital pin 10
- CS - digital pin 11
- CLK - digital pin 12
SOFTWARE
- Step 3: Download the Software and Libraries
If you’re ready to get started, click on the link below then select the version with your operating system.
Dowload the arduino Desktop IDE: https://www.arduino.cc/en/Main/Software
When the download is finished, un-zip it and open up the Arduino folder to confirm that click yes, there are some files and sub-folders inside. The file structure is important so don’t be moving any files around unless you really know what you’re doing.
Downlaod the LED Control Library: https://github.com/wayoda/LedControl
Once installed the Arduino desktop IDE and the Library. open the arduino software then locate the SKETCH tab at the top of the software, navigate ADD ZIP LIBRARY >> then look for the downloaded libraries in the download folder. SELECT the zip file then wait for the process. include all the libraries fo liquidcrystal display.
- Step 4: Create custom Graphics
I used pixeltomatrix It generates custom byte hex and binary for LED matrix after the design has been done to show which LED will stay on and Which LED will go off to properly represent the number and letter. download pixelmatric here: http://generator1116.rssing.com/chan-36314998/all_p1.html
- Customize the character by clicking the node box it will generate byte arrays which will use to build the code later.
- Once the Design is done click on GENERATE and copy the generated byte arrays for number 1.
0x00,0x10,0x30,0x50,0x10,0x10,0x7C,0x00
- Number 2
0x00,0x38,0x6C,0x0C,0x18,0x30,0x7C,0x00
- Number 3
0x00,0x78,0x08,0x38,0x08,0x08,0x78,0x00
- Number 4
0x00,0x00,0x48,0x48,0x78,0x08,0x08,0x00
- Number 5
0x00,0x3C,0x20,0x3C,0x04,0x04,0x3C,0x00
- Number 6
0x00,0x7C,0x40,0x7C,0x44,0x44,0x7C,0x00
- Number 7
0x00,0x3E,0x02,0x04,0x08,0x10,0x20,0x00
- Number 8
0x00,0x3C,0x24,0x3C,0x24,0x24,0x3C,0x00
- Number 9
0x00,0x78,0x48,0x78,0x08,0x08,0x08,0x00
- Letter S
0x00,0x00,0x7C,0x60,0x7C,0x0C,0x7C,0x00
- Letter T
0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x00
- Letter E
0x00,0x00,0x78,0x40,0x70,0x40,0x78,0x00
- Letter M
0x00,0x00,0x44,0x6C,0x54,0x44,0x44,0x00
- Letter I
0x00,0x10,0x00,0x10,0x10,0x10,0x38,0x00
Programming
- Step 5: Build the code
#include <LedControl.h> // include led control library
int DIN = 10; // define DIN pin to digital pin 10
int CS = 11; // define CS pin to digital pin 11
int CLK = 12; // define CLK to digital pin 12
byte digit0[]= {0x00,0x38,0x44,0x44,0x44,0x44,0x38,0x00}; // number 0 byte arrays custom character
byte digit1[]= {0x00,0x10,0x30,0x50,0x10,0x10,0x7C,0x00}; // number 1 byte arrays custom character
byte digit2[]= {0x00,0x38,0x6C,0x0C,0x18,0x30,0x7C,0x00}; // number 2 byte arrays custom character
byte digit3[]= {0x00,0x78,0x08,0x38,0x08,0x08,0x78,0x00}; // number 3 byte arrays custom character
byte digit4[]= {0x00,0x00,0x48,0x48,0x78,0x08,0x08,0x00}; // number 4 byte arrays custom character
byte digit5[]= {0x00,0x3C,0x20,0x3C,0x04,0x04,0x3C,0x00}; // number 5 byte arrays custom character
byte digit6[]= {0x00,0x7C,0x40,0x7C,0x44,0x44,0x7C,0x00}; // number 6 byte arrays custom character
byte digit7[]= {0x00,0x3E,0x02,0x04,0x08,0x10,0x20,0x00}; // number 7 byte arrays custom character
byte digit8[]= {0x00,0x3C,0x24,0x3C,0x24,0x24,0x3C,0x00}; // number 8 byte arrays custom character
byte digit9[]= {0x00,0x78,0x48,0x78,0x08,0x08,0x08,0x00}; // number 9 byte arrays custom character
LedControl lc=LedControl(DIN,CLK,CS,0);
void setup(){
lc.shutdown(0,false); //The MAX72XX is in power-saving mode on startup
lc.setIntensity(0,5); // Set the brightness, the maximum is 0,15
lc.clearDisplay(0); // and clear the display
}
void loop(){
byte s[]= {0x00,0x00,0x7C,0x60,0x7C,0x0C,0x7C,0x00}; // letter s byte arrays custom character
byte t[]= {0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x00}; // letter t byte arrays custom character
byte e1[]= {0x00,0x00,0x78,0x40,0x70,0x40,0x78,0x00}; // letter e byte arrays custom character
byte e2[]= {0x00,0x00,0x78,0x40,0x70,0x40,0x78,0x00};
byte m[]= {0x00,0x00,0x44,0x6C,0x54,0x44,0x44,0x00}; // letter m byte arrays custom character
byte i[]= {0x00,0x10,0x00,0x10,0x10,0x10,0x38,0x00}; // letter i byte arrays custom character
byte T[]= {0x00,0x00,0x7C,0x10,0x10,0x10,0x10,0x00};
printByte(s);
delay(1000); // set the delay time 1000 is eaqual to 1 sec
printByte(t);
delay(1000);
printByte(e1);
delay(1000);
printByte(e2);
delay(1000);
printByte(m);
delay(1000);
printByte(i);
delay(1000);
printByte(T);
delay(1000);
print0123456789();
lc.clearDisplay(0);
delay(1000);
}
void print0123456789()
{
printByte(digit0);
delay(1000);
printByte(digit1);
delay(1000);
printByte(digit2);
delay(1000);
printByte(digit3);
delay(1000);
printByte(digit4);
delay(1000);
printByte(digit5);
delay(1000);
printByte(digit6);
delay(1000);
printByte(digit7);
delay(1000);
printByte(digit8);
delay(1000);
printByte(digit9);
delay(1000);
}
void printByte(byte character [])
{
int i = 0;
for(i=0;i<8;i++)
{
lc.setRow(0,i,character[i]); // this is for blank
}
}
- Step 6; connect the arduino uno board nano/mega/r3 to your computer via type b usb cable, your computer will automatically scan the device driver, to verify the board of the arduino, on the IDE click >. TOOLS then verify the board type and PORT where the USB is connected.
- Step 7: copy the sketch code to arduino IDE sketch bar. click the UPLOAD icon on the upper right side toggle, it will automatically compile the sketch to check if theres an error with the code before uploading to the arduino board.
- Step 8: Test, once the code is succesfully upload the led should blink in designed character arrays, you can control the delays by changing the delay time on the code.
I hope this Tutorial might help you on your future activity. thank you.
Posted on Utopian.io - Rewarding Open Source Contributors
Thank you for the contribution. It has been approved.
You can contact us on Discord.
[utopian-moderator]
Hey @lapilipinas I am @utopian-io. I have just upvoted you!
Achievements
Suggestions
Get Noticed!
Community-Driven Witness!
I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!
Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x
This looks amazing thanks a lot Custom PCB : PCB Services