ATtiny85 - Spectrum Analyzer on RGB Led Matrix 16x20
Introduction: ATtiny85 - Spectrum Analyzer on RGB Led Matrix 16x20
Continuing with ATtiny85, today I'd like to share how to build a music spectrum analyzer on 16x20 RGB led matrix. The music signal FFT transformation and LED Bit Angle Modulation are all carried out by one DigiSpark ATtiny85.
Please watch my video below:
Step 1: Things We Need
Main components are as follows:
* 1 x DigiSpark ATtiny85.
* 320 x 5mm Common Anode RGB LEDs.
* 16 x A1013 Transistors.
* 2 x Shift Register 74HC595N.
* 9 x Power Logic 8-Bit Shift Register TPIC6B595N.
* 12 x 0.1uF Decoupling Capacitors.
* 100 x 100Ω Resistors.
* 16 x 1kΩ Resistors.
* 4 x 10kΩ Resistors.
* 1 x Single-Side Copper Prototype PCB Size A4.
* 2 x Clear Acrylic Plate Size A4.
* 2 x Male & Female 40pin 2.54mm Header.
* 1 x Power Supply Adapter 5V/2A.
* 1 x DC Power Supply Female Socket.
* 1 x DC Power Supply Screw Type.
* 8 x Copper Standoff Spacers 20mm.
* 1 x 3.5mm Audio Jack.
* 2 meter x Rainbow Color Flat Ribbon Cable.
Step 2: Schematic
You can download the project schematic in PDF format HERE.
The components for controlling a RGB led matrix 16x20:
* Columns (cathodes) scanning: including 3 groups of TPIC6B595N to control 20 columns, each group includes 3 x TPIC6B595N for 3 colors (Red, Green & Blue), for example with blue color:
* Rows (anodes) scanning: including 2 x 74HC595N and 16 x A1013 transistor to control 16 rows.
Step 3: Soldering and Arrangement
Firstly, I soldered 320 RGB leds on the PCB, from outer edge of the PCB I left about 15~16 holes to reserve space for control components.
As picture above, I soldered all cathode pins in same column (total 20 columns - cathode with R, G, B pin) together after aligning leds on the top side.
After soldering 20 led columns, I soldered anode led pins in same row ( total 16 rows - anode) together by bending anode led pins so that there is a gap between the rows and columns, avoiding them touching each other.
The 16x20 RGB led matrix has been done!
Then around this led matrix, I soldered all row (2 x 74HC595N + 16 x A1013) and column (9 x TPIC6B595N) scanning components, female header for ATtiny85, 3.5mm audio jack and power supply socket.
I didn't use wires in this project but instead I used the led pins which were left from many led related projects.
I want all components and connections to be seen, so I covered the top and botom of PCB by clear arcylic plates.
Done!!! And I can put it on my tea table for decoration.
If you have a PCB project, please visit the NEXTPCB website to get exciting discounts and coupons.
* Only $0 for 1-4 layer PCB Prototype: https://www.nextpcb.com/pcb-quote?act=2&code=tunen...
* New customer get $100 coupons, register at: https://www.nextpcb.com/register?code=tunendd
Step 4: Programing and How It Works
The project code is as below:
/*
Tested with Arduino 1.8.13, the ATTinyCore and libraries:
https://github.com/SpenceKonde/ATTinyCore
https://github.com/JChristensen/tinySPI
https://github.com/kosme/fix_fft
Connections:
- DigiSpark ATtiny85 P0 (PB0) - BLANK PIN OF 74HC595 & TPIC6B595.
- DigiSpark ATtiny85 P1 (PB1) - DATA PIN OF TPIC6B595
- DigiSpark ATtiny85 P2 (PB2) - CLOCK PIN OF 74HC595 & TPIC6B595.
- DigiSpark ATtiny85 P3 (PB3) - LATCH PIN OF TPIC6B595 & 74HC595
- DigiSpark ATtiny85 P4 (PB4) - AUDIO PIN. 485