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.
volume unit by
using fix FFT transformation. Led Matrix will be connected to music player by audio jack 3.5mm.Electronic components & tools can be purchased from ebay as links below:
1. Electronic components:
2. Tools
Screwdriver
My RGB matrix panel with 128 x RGB LEDs is arranged in 8 rows and 16 columns, including:
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.
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
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.
- BLANK PIN (ENABLE) -----> 3 (PD2)
- LATCH PIN -----------------> 2 (PD3)
- CLOCK PIN (SCK) ----------> 13
- DATA PIN (MOSI)------------> 11
- 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.
https://github.com/tuenhidiy/Smart-RGB-Matrix
So, to develop this project, with existing hardware configuration I can make this RGB led matrix smarter through SPI, I2C and Ethernet interfaces.
My testing picture with PLC is as below. You can check interface between NodeMCU and PLC S7-300 at my topic:
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 !!!