D.I.Y SMART RGB MATRIX 8x16

by tuenhidiy in Circuits > Arduino

42138 Views, 192 Favorites, 0 Comments

D.I.Y SMART RGB MATRIX 8x16

TITLE.jpg
FINISH3.jpg

In this project, I’ll show you how to make your own 8×16 RGB LED Matrix using Arduino Uno/ Nano. An LED Matrix can show scrolling messages, display animations, music spectrum analyzer … With integrating NodeMCU, it can be used as small screen to show weather information from internet or any process values when it connect to Ethernet PLC system.

So, let's watch my videos below and follow my instructables to start with building your own RGB LED Matrix.

  • Auto-rotate scrolling message test (update on November 6th, 2018): Using MPU-6050 with Kalman filter to calculate the angle when we rotate Led Matrix.

  • Animation Test

  • VU meter test: It shows music

    volume unit by

    using fix FFT transformation. Led Matrix will be connected to music player by audio jack 3.5mm.

  • Smart Display Test: Connecting to PLC system

  • Smart Display Test: Showing weather information from Internet

PARTS LIST & TOOL

BOM.jpg

SHEMATIC DIAGRAM

RGB LED MATRIX 8x16_schem.jpg

My RGB matrix panel with 128 x RGB LEDs is arranged in 8 rows and 16 columns, including:

  1. Led Matrix Board: is built on a single-side copper prototype PCB 9x15. With my instructables, Led Matrix can be plugged on top of the Driver Board, like a Shield.
  2. Driver Board: are built on a double-side copper prototype PCB 9x15. Driver Board handle column & row scanning to control Led Matrix Board above.

  • Column scanning: is done through 2x 74HC138 cascading connection to build 4 to 16 line decoder as diagram above. With this combination, it can accept 4 bit binary coded decimal number on its 4 inputs and can select one of its 16 outputs. And then it drive 16 corresponding PNP transistors (A1013).
  • Row scanning: through 3x 74HC595, 3 x ULN2803 for 3 colors: RED, GREEN, BLUE .

To control an individual color of common anode RGB LED, you set its column HIGH and its corresponding color row LOW.

We know that the brightness of a LED can be controlled by switching it on and off very rapidly. To do that, Pulse Width Modulation (PWM) is often chosen by using PWM pins on Arduino, beside that B.A.M is a another method to achieve the same thing.

For B.A.M, you can check at my instructables:

https://www.instructables.com/id/Interactive-Color...

https://www.instructables.com/id/BI-COLORS-MATRIX-...

Please follow next step to see my assembly for Led Matrix Board & Driver Board in detail.

BUILD THE MATRIX

There are a lot of ways to solder a led matrix and I will share my tip to do a led matrix like a compact shield from prototype board:

- Decide to purchase RGB Led size & type: For me, I used common anode type with size 5mm. There are a lot of ways to solder a led matrix that final purpose is connecting all anode pins of the LEDs in columns and the cathode pins (pin Red, Green, Blue) in rows.

- Arrange the LEDs in the prototype board in symmetrical form.

- Then, take the R, G, B pins of the first LED in first row and bend it down to the other LEDs and solder the pins which touch each other.

- Do the same with 2nd row until finish 8th row.

- Finish rows of Led matrix and we need to check every led because at this time, it is easy to fix if there are any broken led or any short circuit between the anode/ cathode pins.

- For led matrix column, I also bent the anode pin and connected them like we did with the cathode pins. To get an isolated gap between anode and cathode pins, we padded an ABS Round Plastic Pipe when bending led pin.

- At the vertical & horizontal end of prototype, I connect anode & all R, G, B pins to long pin male header for later connecting to Led driver board.

- Testing RGB led one more time.

- Finish Matrix Board

BUILD DRIVER BOARD

Driver Boards, including: column (layer) scanning (74HC138 + Transistor A1013), row scanning (74HC595 + ULN2803) and Arduino Uno/ Nano. Led Matrix is a shield that it can be plugged on top of the Driver Board.

  • Prepare the horizontal & vertical female header at Driver Board. At this time, I also soldered 16 x A1013 transistors with its outputs is aligned with corresponding columns of Led Matrix.

  • Testing whether male header of Led Matrix & female of Driver Board is matching together or not to correct it.

  • Visually checked the contacting between male and female.Well, it is matching together like that.

  • Following schematic below, I installed 3x 74HC595, 3 x ULN2803, 24 x 100Ω Resistors, 3 x 0.1uF Capacitors on prototype board and did soldering work. Each shift register 74HC595 will control one color so we have totally 3 shift registers for handling: Red, Green, Blue colors. Arduino pins assigned for SPI controlling:

- BLANK PIN (ENABLE) -----> 3 (PD2)

- LATCH PIN -----------------> 2 (PD3)

- CLOCK PIN (SCK) ----------> 13

- DATA PIN (MOSI)------------> 11

  • For column circuit, I use 4 signals from Arduino Nano for multiplexing 2 x 74HC138 to control 16 RGB led's columns through 16 x A1013 transistors circuit. It is need to connect 560Ω resistor between pole B of transistor and 74HC138 for polarization. Arduino PORTD pins were used for multiplexing as follows:

- D4 (PD4) connect to A0.

- D5 (PD5) connect to A1.

- D6 (PD6) connect to A2.

- D7 (PD7) connect to A3.

Note: 74HC138 has active low outputs, it means this chip sets the selected pin low and all others high. Below is Truth table for this combination:

Note: Back side of above picture is the 1st version that I test with Arduino Uno with some male headers.

- Soldering DC female jack for power supply and female header for Arduino Nano.

- Installing Arduino Nano on prototype board. I also reserved space for NodeMCU for further future extension. This nodeMCU communicate to Arduino Nano through I2C protocol and it is pre-connected.

- Cleaning the boards, check again all RGB leds on Matrix board, continuity checking with a Multimeter. And then, connecting Led Matrix & Driver Board together. Here is the final results that I achieved.

PROGRAMMING & PICTURES

https://github.com/tuenhidiy/Smart-RGB-Matrix

  • Some project pictures:

BECOME SMART MATRIX

So, to develop this project, with existing hardware configuration I can make this RGB led matrix smarter through SPI, I2C and Ethernet interfaces.

  • SPI & BAM: Arduino Nano show process values on RGB Matrix.
  • I2C: Arduino Nano comunicate to NodeMCU to get raw values.
  • Ethenet: NodeMCU communicate to PLC (like temperature/ pressure/ flow ... daily production, daily delay and some production KPIs...) or get values from internet, like weather information.

My testing picture with PLC is as below. You can check interface between NodeMCU and PLC S7-300 at my topic:

https://www.instructables.com/id/ARDUINO-HACK-PLC-...

BECOME AUTO-ROTATE MATRIX

MPU6050_NODMCU RGB LED MATRIX 8x16_schem.jpg

Soldering MPU-6050 on the Driver Board following schematic above (Fritzing file download here). I used MPU-6050 with Kalman filter to calculate the angle when we rotate Led Matrix. For Kalman Filter library, you can refer at address:

https://github.com/TKJElectronics/KalmanFilter

In my opinion, it works perfectly and accurately when values reading from MPU-6050 is passed through this filter.

Arduino code for Auto-Rotate RGB Matrix on my GitHub:

https://github.com/tuenhidiy/Auto-Rotate-RGB-Matri...

Please pay attention to 2 lines in the subroutine below. After reading values from MPU-6050, AngleX will be in range: -180 to 180 and I based on this to determine text direction showing on Led Matrix.

read_MPU6050();
AND
uint8_t pos = (kalAngleX >0 ? 1:0);
void hScroll_colorwheel_MPU(uint8_t y, Color Bk_color, char *mystring, uint8_t font, uint8_t delaytime, uint8_t dir)
{
  int offset =0;
  Color setcolor, For_color;
for ((dir) ? offset=0 : offset=((lenString(mystring)-8)*8-1) ; (dir) ? offset <((lenString(mystring)-8)*8-1) : offset >0; (dir) ? offset++ : offset--)
  {
    read_MPU6050();
    
      for (byte xx=0; xx<16; xx++)
      {
        for (byte yy=0; yy<8; yy++)
            {
              get_colour(colourPos + 8*(yy+xx), &For_color.red, &For_color.green, &For_color.blue);
              uint8_t pos = (kalAngleX >0 ? 1:0);
              if (pos)
              {
              if (getPixelHString(xx+offset,yy,mystring))              
                setcolor = For_color;             
              else setcolor=Bk_color;
                LED(xx,(yy+y),setcolor.red, setcolor.green, setcolor.blue);
              }
              else
              {
                if (flipbyte(getPixelHString((xx+offset),yy, mystring)))              
                setcolor = For_color;           
                else setcolor=Bk_color;
                LED(15-xx,7-(yy+y),setcolor.red, setcolor.green, setcolor.blue);
              }
            }
        }
        delay(delaytime); 
        increment_colour_pos(2); 
      }

}

My first testing video is as below:

Thank for watching !!!