Today I will share following topics base on a bicolor matrix led 32×32:
- D.I.Y a bicolor led matrix 32×32.
- How to control led board above with NodeMCU ESP8266 via B.A.M method.
- Introduce and share my code for some cool real time clock projects with this bicolor led board.
Let’s start with some videos:
- Rainbow letters and images: is controlled by NODEMCU.
Handwritten Clock Version 2:
Tetris clock: is referenced from TobiasB48
Handwritten Clock Version 1:
Morphing Digital Clock: is referenced from HariFun.
Step 1: MATERIAL LIST
Main components include:
- 1pcs x Arduino Mega 2560. (Optional)
- 1pcs x NodeMCU ESP8266 V1.0.
- 16pcs x Bicolor Led Matrix 8×8, common anode (Code: 2088ABEG-5), dimension 60x60mm.
- 16pcs x 74HC595 – 8-Bit Shift Register DIP-16.
- 16pcs x ULN2803 – Transistor Array-8 NPN IC DIP-18.
- 16pcs x 2N3904 – TO-92 NPN General Purpose Transistor. (or 2N2222)
- 16pcs x TIP42C – POWER TRANSISTOR PNP 100V 6A.
- 2pcs x 74HC238 – 3 to 8 Line Decoder.
- 16pcs x 0.1uF Capacitors.
- 200pcs x R10.
- 20pcs x R1K.
- 40pcs x R10K.
- 1pcs x 5×7 Double Sided Printed Prototyping Board.
- 20pcs x XH2.54mm – 8P 20cm Wire Cable Double Connector.
- 4pcs x XH2.54mm – 4P 20cm Wire Cable Double Connector.
- 2pcs x XH2.54mm – 5P 20cm Wire Cable Double Connector.
- 10pcs x Male 40pin 2.54mm Header Socket Row Strip PCB Connector.
- 10pcs x Female 40pin 2.54mm Header Socket Row Strip PCB Connector.
- Some wires, acrylic plate.
- Power supply 5V, 10A. (I used a power supply 5V-40A for this project)
- 1 set of 9 V battery and battery clip connector (to check the led).
Step 2: SCHEMATIC
This is the circuit diagram of the whole project; it is a quite big file and you can download high resolution PDF file HERE. With this overall schematic, we will easily understand how to scan rows and columns for led matrices, as well as, how to apply the 4-bit BAM method during row and column scanning.
On the circuit diagram, I separated 32×32 = 1024 red and 32×32 = 1024 green LEDs in groups and connect default matrix pin in Fritzing to rows and columns buses. You have to connect color pins properly according to the specifications after purchasing bicolor led matrix.
NODECU pins are used as below:
// PINS USING ON NODEMCU #define blank_pin D8 // BLANK PIN - 74HC595 #define latch_pin D4 // LATCH PIN - 74HC595 #define clock_pin D5 // CLOCK PIN - 74HC595 #define data_pin D7 // DATA PIN - 74HC595 #define RowA_Pin D0 // A PIN - 74HC238 #define RowB_Pin D1 // B PIN - 74HC238 #define RowC_Pin D2 // C PIN - 74HC238 #define RowD_Pin D3 // D PIN - 74HC238 //#define OE_Pin D8 // ENABLE OUTPUT PIN - 74HC238 (Connect to blank_pin).
- I used 5 signals to control 2x74HC238 for implementing one 4 to 16 decoder. Then these 16 outputs will control 32 rows of bicolor led matrix through PNP and NPN transistors. In other words, my led panel have 1/16 scan rate, so only one row of 16 is on at a time. You can see how scan pattern a 32×32 led board with scan rate 1/16 looks like, at this link: https://www.sparkfun.com/sparkx/blog/2650
- OE PIN – 74HC238 and BLANK PIN – 74HC595 are both connect to NODEMCU – D8 pin. This is an important key to minimize flickering and noise because we only enable the OE pin (Output Enable) for 74HC595 (columns) and 74HC238 (rows) when we needed. I have also tested this Led board on Arduino Mega 2560 with 2 OE signals which are individually controlled, one for 74HC595 and the remaining signal for 74HC238. It also gave good results. Check detail at STEP 5.
Step 3: PCB BOARD DESIGN AND ETCHING
You can download as attached links for following schematics and PCB files:
I etched myself these printed circuit boards at home by Toner Transfer Method and concentrated ferrous chloride. The pictures below are the results that I did:
- Column Scanning Board: we need 2 sets of column scanning PCB for RED and GREEN color.
Read more: HAVE FUN WITH BICOLOR MATRIX 32×32