LED Martix Kit User Guide V2
LED Martix Kit User Guide V2
Revision History
Number Doc Title 8*8 LED Matrix Shield User Guide Version 2.0
Content
1Description ...................... 2Hardware configuration and Connection methods ..... 7 2.1 Hardware configuration ......................... 7 2.2 Connection methods ............................ 11 3Code ............................................. 13
1. Description
This product is a serially driven 8x8 LED Matrix kit powered by MAX7219. It only needs three data lines and two power lines. The 8x8 LED Matrix is easy to use and compatible with Arduino, and its LED brightness adjustment can be implemented in software. This product comes in the form of a kit. It includes the following components: MAX7219 Electrolytic cpaacitor10uF/25V Resistor10K Capacitance0.1uF Headers and receptacles.
8x8 LED Matrix kit has many applications in real life, such as various types of electronic display panels. If the LED matrix is not driven by any peripherals, itll waste the interface of devices, and the LED
4
brightness will be impaired due to insufficient power, so that we cannot get ideal display effect.
The LED matrix can be driven in two ways: parallel or serial. We usually drive it in the serial manner in order to save interface. The serial-driven LED matrix actually dynamically displays the LEDs, i.e., displays the LEDs row-by-row or column-by-column. The persistence of vision for humans is about 0.1s, so as long as we can serially display all 8 rows/columns within 0.1s, well see a complete character or pattern.
The 8*8 LED Matrix kit is arranged according to the rows and columns All the cathode pins of red LED connected together in each column, and each LEDs anode pin connected together with the anode pin in same row. In order to drive the LED matrix module, we use a driver chip Max7219 in the module. Set an on-off in a row of the LED matrix module every time by the proper frequency. As mentioned previously, to illumine all the LEDs at the same time visually, actually only 8 LEDs are lighted in each moment. The LED dot matrix has 16 PINs, and we use MAX7219 to drive all the PINs. The 8x8 LED Matrix Shield is controlled by the communication between MAX7219 and Arduino.
2Hardware
As this product is in a form of a kit, we will need to assemble it. In the following, we are going to show the assembly steps:
Step 8: Lay down C2, and install the MAX7219 and LED matrix to their receptacles.
(2) Arduino
10
The schematics of the LED matrix is attached below. Please follow the following instructions to connect hardwares. (1) (2) (3) (4) (5) The 8x8 LED Matrix must be common-grounded with the Arduino module. Connect Arduino pin 8 to DIN on the LED Matrix; Connect Arduino pin 9 to CS on the LED Matrix Connect Arduino pin 10 to CLK on the LED Matrix Use independent power supply for the 8x8 LED Matrix Shield, and the supply voltage is 5V/2A.
11
Schematics of the 8x8 LED Matrix 2.3 Testing Steps (1)ConnectingConnect Arduino pin8 to DIN on 8*8LED Matrix Connect Arduino pin9 to CS on 8*8LED Matrix Connect Arduino pin10 to CLK on 8*8LED Matrix
(2) Check the corresponding interfaces are properly connected. (3) Powering up the Arduino demo board with AC adapter.
12
(4) ObservationThe LED matrix should circularly display the digits 0 to 9 on LED screen first, then the characters A to Z, as shown in the above figure.
3Software
Software preparation The only necessary software is Arduino 1.0, as shown below.
The timing diagram for Max7219 and its Serial-Data Format are attached below with its Electronic Characteristics.
13
unsigned char disp1[38][8]={ {0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C},//0 {0x10,0x18,0x14,0x10,0x10,0x10,0x10,0x10},//1 {0x7E,0x2,0x2,0x7E,0x40,0x40,0x40,0x7E},//2 {0x3E,0x2,0x2,0x3E,0x2,0x2,0x3E,0x0},//3 {0x8,0x18,0x28,0x48,0xFE,0x8,0x8,0x8},//4 {0x3C,0x20,0x20,0x3C,0x4,0x4,0x3C,0x0},//5 {0x3C,0x20,0x20,0x3C,0x24,0x24,0x3C,0x0},//6 {0x3E,0x22,0x4,0x8,0x8,0x8,0x8,0x8},//7 {0x0,0x3E,0x22,0x22,0x3E,0x22,0x22,0x3E},//8 {0x3E,0x22,0x22,0x3E,0x2,0x2,0x2,0x3E},//9 {0x8,0x14,0x22,0x3E,0x22,0x22,0x22,0x22},//A {0x3C,0x22,0x22,0x3E,0x22,0x22,0x3C,0x0},//B {0x3C,0x40,0x40,0x40,0x40,0x40,0x3C,0x0},//C {0x7C,0x42,0x42,0x42,0x42,0x42,0x7C,0x0},//D {0x7C,0x40,0x40,0x7C,0x40,0x40,0x40,0x7C},//E
14
LinkSprite Technologies, Inc {0x7C,0x40,0x40,0x7C,0x40,0x40,0x40,0x40},//F {0x3C,0x40,0x40,0x40,0x40,0x44,0x44,0x3C},//G {0x44,0x44,0x44,0x7C,0x44,0x44,0x44,0x44},//H {0x7C,0x10,0x10,0x10,0x10,0x10,0x10,0x7C},//I {0x3C,0x8,0x8,0x8,0x8,0x8,0x48,0x30},//J {0x0,0x24,0x28,0x30,0x20,0x30,0x28,0x24},//K {0x40,0x40,0x40,0x40,0x40,0x40,0x40,0x7C},//L {0x81,0xC3,0xA5,0x99,0x81,0x81,0x81,0x81},//M {0x0,0x42,0x62,0x52,0x4A,0x46,0x42,0x0},//N {0x3C,0x42,0x42,0x42,0x42,0x42,0x42,0x3C},//O {0x3C,0x22,0x22,0x22,0x3C,0x20,0x20,0x20},//P {0x1C,0x22,0x22,0x22,0x22,0x26,0x22,0x1D},//Q {0x3C,0x22,0x22,0x22,0x3C,0x24,0x22,0x21},//R {0x0,0x1E,0x20,0x20,0x3E,0x2,0x2,0x3C},//S {0x0,0x3E,0x8,0x8,0x8,0x8,0x8,0x8},//T {0x42,0x42,0x42,0x42,0x42,0x42,0x22,0x1C},//U {0x42,0x42,0x42,0x42,0x42,0x42,0x24,0x18},//V {0x0,0x49,0x49,0x49,0x49,0x2A,0x1C,0x0},//W {0x0,0x41,0x22,0x14,0x8,0x14,0x22,0x41},//X {0x41,0x22,0x14,0x8,0x8,0x8,0x8,0x8},//Y {0x0,0x7F,0x2,0x4,0x8,0x10,0x20,0x7F},//Z };
void Write_Max7219_byte(unsigned char DATA) { unsigned char i; digitalWrite(Max7219_pinCS,LOW); for(i=8;i>=1;i--) { digitalWrite(Max7219_pinCLK,LOW); digitalWrite(Max7219_pinDIN,DATA&0x80);// Extracting a bit data DATA = DATA<<1; digitalWrite(Max7219_pinCLK,HIGH); } }
void Write_Max7219(unsigned char address,unsigned char dat) { digitalWrite(Max7219_pinCS,LOW); Write_Max7219_byte(address); Write_Max7219_byte(dat); //address //data
figure
code
of LED
on LED
15
void Init_MAX7219(void) { Write_Max7219(0x09, 0x00); Write_Max7219(0x0a, 0x03); Write_Max7219(0x0b, 0x07); Write_Max7219(0x0c, 0x01); Write_Max7219(0x0f, 0x00); } //decoding
BCD 8
LEDs
//brightness //scanlimit
void setup() {
4. Demo
(1) Open Arduino development environment.
16
(2) Copy the source code we provide into Arduino compiler, and compile them.
17
(4) Connect pins according to the schematics, and download codes into Arduino board. Youll see the LED matrix circularly display the digits 0-9 and the characters A-Z.
18
19
Add1067 S Hover St, Unit E-186,Longmont, CO 80501 Tel 720-204-8599 (MST: 9:00am-5:00pm) 720-279-0774 (MST: 6:00pm- 3:00am)
20