[Diao Ye learns programming] Arduino hands-on (163) --- large size 8x8 LED grid screen module

The reference to 37 sensors and modules has been widely circulated on the Internet. In fact, there must be more than 37 sensor modules compatible with Arduino. In view of the fact that I have accumulated some sensor and actuator modules on hand, in accordance with the concept of true knowledge (must be hands-on), for the purpose of learning and communication, here I am going to try and do more experiments one by one. Whether it is successful or not, it will be recorded ——Small progress or unsolvable problems, I hope to be able to throw bricks and spark jade.

[Arduino] 168 kinds of sensor module series experiments (data code + simulation programming + graphics programming)
Experiment 163: 6mm large size 8x8 LED square lattice module can be cascaded red, green, blue and white optional 8 levels of brightness

insert image description here
insert image description here
insert image description here

Knowledge point: MAX7219 chip
is a multi-digit LED display driver launched by MAXIM Company in the United States. It uses a 3-wire serial interface to transmit data and can be directly connected to the single-chip interface. Users can easily modify its internal parameters to realize multi-digit LED display. It contains hardware dynamic scanning circuit, BCD decoder, segment driver and bit driver. In addition, it also contains 8X8-bit static RAM inside, which is used to store the display data of 8 figures. Obviously, it can directly drive a 64-segment LED dot matrix display. When multiple MAX7219s are cascaded, more LED dot-matrix displays can be controlled. The displayed data is sent to MAX7219 for display after being processed by the single-chip microcomputer.

insert image description here
insert image description here
The MAX7219/MAX7221 serial input/output common-cathode display driver
is an integrated serial input/output common-cathode display driver. display or 64 individual LEDs. It includes an on-chip B-type BCD encoder, multi-channel scanning circuit, segment driver, and an 8*8 static RAM to store each data. Only one external register is used to set the segment current for each LED. The MAX7221 is compatible with SPI™, QSPI™, and MICROWIRE™, and it has segment drivers that limit the slew current to reduce EMI (electromagnetic interference). A convenient four-wire serial interface can interface with all common microprocessors. Each data address can be updated without rewriting all displays. The MAX7219/MAX7221 also allow the user to choose to encode or not encode each data. The entire device includes a 150µA low-power shutdown mode, analog and digital brightness controls, a scan limit register allowing the user to display 1-8 bits of data, and a detection mode that makes all LEDs illuminate.

insert image description here
MAX7219 internal structure diagram

insert image description here
As a dedicated LED display driver chip, MAX7219 can drive 8-bit digital display in dynamic form. It can also be cascaded with n slices of MAX7219 to drive 8 * n-bit digital display. The circuit between MAX7219 and the digital display is extremely simple, and almost no current-limiting resistor is used. Only 3 leads need to be connected between MAX7219 and the one-chip computer. After the single-chip computer sends the data to MAX7219, it can independently perform dynamic scanning and display without the intervention of the single-chip computer. For single-chip microcomputers, these digital displays seem to be performing static displays, which can be said to be the best choice for driving multi-digit digital displays.

insert image description here

The function of each pin of MAX7219:
DIN: serial data input terminal
DOUT: serial data output terminal, used for cascade expansion
LOAD: load data input
CLK: serial clock input
DIG0~DIG7: 8-bit LED bit line selection, from Sink current
SEG A~SEG G DP in common cathode LED 7-segment drive and decimal point drive
ISET: Connect to Vcc through a 10k resistor to set the segment current

insert image description here
MAX7219 Technical Parameters:
Type: LED Display Driver
Series: MAX7219
Digit Quantity: 8
Segment Quantity: 64
Mounting Style: SMD/SMT
Package/ Box: SOIC-Wide-24
Operating Power Supply Voltage: 4 V to 5.5 V
Power Supply Current—Maximum : 330 mA
Minimum Operating Temperature: - 40 C
Maximum Operating Temperature: + 85 C
Package: Reel or Tube
Height: 2.35 mm
Length: 15.6 mm
Product: LED Display Drivers
Width: 7.6 mm
High Level Output Current: - 2 mA
Low Power Flat Output Current: 5 mA
Pd-Power Dissipation: 941 mW
Factory Pack Quantity: 1000
Part Number Alias: MAX7219
Unit Weight: 734.500 mg

insert image description here
MAX7219 features:
1 10MHz serial port
2 Independent LED segment control
3 Digital decoding and non-decoding selection
4 150μA low-power shutdown mode
5 Digital and analog control of brightness
6 High voltage interrupt display
7 Common cathode LED Display driver
8 Segment driver with limited slew current to reduce EMI (MAX7221)
9 SPI, QSPI, MICROWIRE serial interface (MAX7221)
10 24-pin DIP and SO packages

insert image description here
Main features of the large-size 8x8 LED grid screen module:
1: Use MAX7219 dedicated driver chip, which can be cascaded;
2. Only need 3 IOs to drive, without MCU scanning, saving MCU resources;
3. Large-sized 6mm pixel-sized square dot matrix , available in red, emerald green, blue, white, the effect is very beautiful, can independently control the on and off of each point
4, supports 8-level brightness adjustment
5, the board has two 3mm mounting holes for easy fixing, and can be broken when splicing The installation holes are seamlessly spliced
​​6. Module size: 7.1*6.0 (cm)

insert image description here
Large size 8x8 LED grid screen module electrical schematic diagram

insert image description here
insert image description here
insert image description here
★ Can be driven to emit light under low voltage and low current conditions
★ Extremely short luminous response time (<0.1μs), good high frequency characteristics, good monochromaticity, high brightness
★ Small size, light weight, good impact resistance. Solid package , the packaging method is glue filling type, high stability
★ Long life, the service life is more than 50,000 hours
★ Can continuously scan and drive each byte
★ Good display effect, wide viewing
angle Uniform phenomenon
★ Products with a protective film on the surface can be torn off before use
★ Soldering temperature: 260℃, dwell time up to 5 seconds
★ When the working temperature is higher than 25℃, Ifm, ifp and Id must be reduced; the current reduction rate is -036mA/°C (DC drive), or -0.86mA/°C (pulse drive) power consumption rate is -0.75mW/°C. The working current of the product cannot be greater than 60% of Ifm or Ifp corresponding to the working temperature condition.
★ Blue, emerald green, white please take anti-static measures

insert image description here
Large size 8x8 LED grid screen wiring method:
(pins in the IN direction)
Arduino Uno — MAX7219
5V <—> VCC
GND <—> GND
12 <—> DIN
11 <—> CS
10 <—> CLK

insert image description here
[Arduino] 168 kinds of sensor module series experiments (data code + simulation programming + graphic programming)
Experiment 163: 6mm large-size 8x8 LED square lattice module can be cascaded red, green, blue and white optional 8-level brightness
1, Download library https://www.pjrc.com/teensy/arduino_libraries/Matrix_Sprite.zip
2. Project 1: Quickly scan all 64 dot matrices (useful for testing matrices)
3. Connection:
MAX7219 UNO
VCC →→→ →→ 5V
GND →→→→→ GND
DIN →→→→→ D12 (MOSI)
CS →→→→→ D11 (SS)
CLK →→→→→ D10 (SCK)
Arduino experimental open source code

/*

 【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)

 6mm大尺寸8x8LED方块方格点阵模块 可级联 红绿蓝白色 可选8级亮度

 1、下载库 https://www.pjrc.com/teensy/arduino_libraries/Matrix_Sprite.zip

 2、项目之一:快速扫描所有64个点阵(对于测试矩阵很有用)

 3、连线:

 MAX7219    UNO

 VCC →→→→→ 5V

 GND →→→→→ GND

 DIN →→→→→ D12 (MOSI)

 CS  →→→→→ D11 (SS)

 CLK →→→→→ D10 (SCK)

*/

#include <Sprite.h> //导入精灵矩阵库

#include <Matrix.h>

const int numChips = 1;

//DIN, CLK, CS, #chips

Matrix myLeds = Matrix(12, 10, 11, numChips);

void setup() {
    
    

 myLeds.clear();

}

void loop() {
    
    

 byte x, y;

 // 一次点亮一个 LED,从左到右扫描

 // 从上到下......对于测试矩阵很有用

 for (y = 0; y < 8; y++) {
    
    

  for (x = 0; x < (numChips * 8); x++) {
    
    

   myLeds.write(x, y, HIGH);

   delay(40);

   myLeds.write(x, y, LOW);

  }

 }

}


Arduino experiment scene diagram

insert image description here
Download related driver library
1. https://github.com/riyas-org/max7219
2. https://github.com/wayoda/LedControl

3、 https://www.pjrc.com/teensy/arduino_libraries/Matrix_Sprite.zip
4、 Https://github.com/shaai/Arduino_LED_matrix_sketch/archive/master.zip

insert image description here
[Arduino] 168 sensor module series experiments (data code + simulation programming + graphics programming)

Experiment 163: 6mm large size 8x8 LED square grid lattice module can be cascaded with red, green, blue and white optional 8 levels of brightness

Project 2: Flash the welcome face on the screen (interval 1 second)

Arduino experiment open source code

/*

 【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)

 6mm大尺寸8x8LED方块方格点阵模块 可级联 红绿蓝白色 可选8级亮度

 项目之二:在屏幕上闪烁欢迎面孔(间隔1秒)

 接脚连线:

 MAX7219    UNO

 VCC →→→→→ 5V

 GND →→→→→ GND

 DIN →→→→→ D12(数据)

 CS  →→→→→ D11(负载)

 CLK →→→→→ D10(时钟)

*/

#include <Sprite.h>

#include <Matrix.h>

Matrix myMatrix = Matrix(12, 10, 11);// Matrix(DIN, CLK, CS)

void setup(){
    
    

}

void loop(){
    
    

 myMatrix.clear(); // 显示清屏

 delay(1000);

 myMatrix.write(1, 5, HIGH); // 打开相关位置的像素(点阵)

 myMatrix.write(2, 2, HIGH);

 myMatrix.write(2, 6, HIGH);

 myMatrix.write(3, 6, HIGH);

 myMatrix.write(4, 6, HIGH);

 myMatrix.write(5, 2, HIGH);

 myMatrix.write(5, 6, HIGH);

 myMatrix.write(6, 5, HIGH);

 delay(1000);

}


Arduino experiment scene diagram
insert image description here

[Arduino] 168 sensor module series experiments (data code + simulation programming + graphics programming)

Experiment 163: 6mm large size 8x8 LED square grid lattice module can be cascaded with red, green, blue and white optional 8 levels of brightness

Project 3: Display sine wave dynamic graphics on the screen

Arduino experiment open source code

/*

 【Arduino】168种传感器模块系列实验(资料代码+仿真编程+图形编程)

  6mm大尺寸8x8LED方块方格点阵模块 可级联 红绿蓝白色 可选8级亮度

 项目之三:在屏幕上显示正弦波动态图形

 接脚连线:

 MAX7219    UNO

 VCC →→→→→ 5V

 GND →→→→→ GND

 DIN →→→→→ D12(数据)

 CS  →→→→→ D11(负载)

 CLK →→→→→ D10(时钟)

*/

#include <Sprite.h>

#include <Matrix.h>

Matrix myMatrix = Matrix(12, 10, 11);// Matrix(DIN, CLK, CS)

// 创建一个新的 Sprite 实例, 8 像素宽,4 像素高

Sprite wave = Sprite(

        8, 4,

        B00011000,

        B00100100,

        B01000010,

        B10000001

       );

void setup() {
    
    

}

int x = 0;

void loop() {
    
    

 myMatrix.write(x, 2, wave);   // 将精灵程序放在屏幕上

 myMatrix.write(x - 8, 2, wave); // 再次放置精灵,在屏幕上的其他地方

 delay(75);           // 稍等一下

 myMatrix.clear();        // 为下一个动画帧清除屏幕

 if (x == 8)           // 如果到达动画序列的末尾

 {
    
    

  x = 0;            // 从头开始

 }

 x++;              // 向右推进 x 坐标

}

Arduino experiment scene diagram

insert image description here

Guess you like

Origin blog.csdn.net/weixin_41659040/article/details/131750472