Twin Display Pixel Matrix Analyzer

by emdee401 in Circuits > Arduino

1892 Views, 21 Favorites, 0 Comments

Twin Display Pixel Matrix Analyzer

F111X31LPE2AMAC.jpg
cvr2.jpg
IMG_1231.JPG
PCB_ASSEMBLED.png
cvr.jpg

This Spectrum Analyzer project is nothing other than amazing. It includes a Teensy microcontroller board that drives 2 displays simultaneously at a very high speed. With it's onboard audio chip, it is capable of doing a frequency analysis of the Audio in realtime to create a Stereo spectrum analyzer of 69 Channels.

Yep you understood me correctly! 69 channels in stereo…so that’s actually 138 frequency bins. On top of that, we will be displaying a stereo VU meter on the second display. So more or less we are really dealing with 140 channels.

But there is more: It can drive up to 3 pixel led matrixes at the same time.. so that adds another 768 LEDS

Best of all: It's open source!

Supplies

600px-MSP2807-008.jpg
TEENSY4.1_1-1500x1500w.jpg
ram.jpg

You will need:

  1. PCB with all components ( buy it pre-assembled or buy PCB only and add your own components)
  2. But it at my tindy store, all you need to add is displays, a fuse and a teensy controller 4.1 : BUY PCB HERE
  3. Use the gerbers to manufactor your own PCB. I suggets to use PCBWAY.COM You can download the needed gerber files here: DOWNLOAD GERBER FILES
  4. Two Displays type: ILI9341 this is the 2.8" version. You can also use the 3.2" version
  5. Teensy 4.1 microcontroller Board
  6. External Ram for the Teensy ( you need to solder that on to the teensy board)
  7. Fuse 2AT TR5 if you are using the onboard PSU ( you can use USB on teensy instead )
  8. Some headers or connectors to connect the wires, or solder directly onto to board.
  9. Headers
  10. Sockets
  11. One electret microphone if you'r using mic input
  12. Three push buttons to operate ( Two if you're not using the pixelled matrix )
  13. Three Potmeters, I use 10K versions ( only needed when you add the pixelled matrix)

Add External Ram to Your Teensy

ram2.jpg
ram3.jpg

We will be using two display and each display will use a few screen buffers. As the buffers are rather large in size, with the number of buffers we need, the internal memory is not enough. We need to add extra memory. Lukely for us, the Teensy 4.1 had the possibility to add an extra memory Chip.

I bought the Teensy 4.1 here: https://opencircuit.nl/product/teensy-4-1

You will need to add PSRAM on the intended socket as shown in the photo.

I used this chip: 8MB PSRAM64 I bought here: https://opencircuit.nl/product/8-MB-PSRAM-chip-voor-Teensy-4.1

Solder the Components on the PCB

F97PD0XLPE2AM88.png
F6RR0H3LPE2AM89.png
F7Q1JVFLPE2AM90.jpg
C11903C6-7EE7-4A68-B968-375FCCBCDCDA.jpeg

If you bought a PCB with pre-assembled components, you can skip this step.

Attached you'll find a list of all components you'll need to assemble the PCB.

The assembly picture will show you where to put what component.

Remember to start with the smallest components first; trust me, it will make your soldering life easier.

Adding the Remaining Components

top_noborder.png
Bottom_noborder.png
FHODBMDLPE2ASKO.jpg
F1AGJHPLPE2ASPD.jpg

There are only a few components you need to add.

There is the Teensy Module with the added extra RAM

Two Displays

A fuse of 2A if you are planning to use the onboard powersupply. If you are using the Teensy USB connector, you don't have to add that fuse.

You have to add some headers and sockets to install the displays and the Teensy. I wouldn'r recommend to leave those out. At some point, you might want to change some of those components and soldering those directly to the board will make that hard.


Connecting a Few Wires

Schematic_Twin-Audio-Visualizer-on-board-audio_2023-11-26.jpg
Scrap-Cables-AL-Recycling-Copper-Cable-Recycling-e1674342495583-768x1024.jpg

Since most components are directly connected to the pcb, the number of needed wires are kept to a minimum

You can look at the schematic for details, however in short, it comes down to this:

Potmeters ( brightness, peak delay, input gain) only if you are using a led matrix wil go to connectors CN5,CN6 and CN10. Connect the center of each potmeter to the center pin of the connector. connect the other 2 pins of the potmeter to the remaining pins of each connector. If your potmeter is reacting CCW instead of CW, or vise versa, simply swop the outer two pins of that potmeter.

Switches:

switch 1: CN2

Switch 2: CN4

Switch 3: CN12 pins labeled (- and s )

Microphone goes to connector CN11

Line in goes to connector CN3; the two outher pins are ground and the two inner pins are channel L and R

Power in goed to U1, pay attention to the markings on the board: + and - use 8-12VDC

Ledmatrix ( I used 3 matrixes in series. each matrix has 16 x 16 leds ) Connector CN10, look at the markings on the pcb to see the +,- and L ( L = data line )

Entering the World of the Matrix

61jvjNlnIdL._AC_UF894,1000_QL80_.jpg

I used a matrix of pixelleds that you can buy pre-assembled.

The one i used is this: 16 x 16 matrix I put three of those in series.

You could use other matrixes as well, even ledstrips could work but you wil have to adjust the firmware of this project.

Also, if you are using different kind of matrix, leds or ledstrip, you might have to change those settings in the firmware as well:

Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(kMatrixWidth, kMatrixHeight, LED_PIN,

 NEO_MATRIX_BOTTOM    + NEO_MATRIX_RIGHT +

 NEO_MATRIX_COLUMNS + NEO_MATRIX_ZIGZAG,

 NEO_GRB           + NEO_KHZ800);


Adding the TEENSY Board Plugin to Arduino

F42N617L4HAYDA7.png
FP8DT9GL4HAYDAH.png
FR9K6ULL4HAYDAI.png
FV4WJYGL4HAYDJL.png
FYBIQIGL4HAYDJM.png

I used Arduino IDE with Teesyduino:

  • Arduino IDE 1.8.15
  • Teensyduino, Version 1.54

You can download ARduino here: ARduino IDE Download

Click here for a tutorial about installing Arduino

Make sure you use the Arduino IDE and not the windows app ( incompatible with the Teensyduino )

You can download Teensyduino here: Download TeensyDuino

Click here for a tutorial about installing TeensyDuino

Adding the Needed Libraries

digitization-of-library-electronic-digitizing-ebook-e-book-preview.jpg

I did a succesful compilation using the following library versions:

  • Using library Wire at version 1.0
  • Using library Audio at version 1.3
  • Using library SPI at version 1.0
  • Using library SD at version 2.0.0
  • Using library SdFat at version 2.1.0
  • Using library SerialFlash at version 0.5
  • Using library ILI9341_T4-main at version 0.1
  • Using library tgx-main at version 0.5
  • Using library EEPROM at version 2.0
  • Using library OneButton at version 2.0.4
  • Using library IRremote at version 3.6.1
  • Using library TeensyID-main at version 1.3.3
  • Using library ILI9488_t3 at version 1.0
  • Using library Adafruit_NeoMatrix at version 1.2.0
  • Using library Adafruit_NeoPixel at version 1.7.0


Some of the mentioned library are part of the Arduino and/or Teensy framework but others need installing:

Programming

First you'll need to download the sketch here:

Download sketch

Best way to proceed is to copy all the files to a new folder.

It is important that all files stay together so if your Arduino want to rename the folder after opening, fine,,but make sure you copy all the other files to that folder. If you don't, compiling will give you error's like "not found"..

Compile and upload the sketch.

In case the upload to the Teensy will not start, you can press the button on the Teensy to help you..

Operating the Unit

gonio02.png
gonio03.png
spectrum01.png
spectrum02.png
spectrum03.png
spectrum04.png
spectrum05.png
spectrum06.png
spectrum07.png
spectrum08.png
spectrum09.png
analog01.png
analog02.png
analog03.png
digital01.png
digital02.png
digital03.png
gonio01.png

You don't need a manual to operate this unit.

It's straight forward.

Use the mic or hook up an audio source. There is one push button to select what input you are using

Another push button select the screen that is showing on the right display

The last switch is to select what pattern is displayed on the pixelled matrix

There are also 3 potmeters. ( 10....50K will do the job )

potmeter 1: Leddisplay intensity

potmeter 2: led display gain

potmeter 3: Peak delay time. ( how long before peak falls down to stack)

A Nice Housing for This Unit

DCIM_100APPLE_IMG_0205.jpg
DCIM_100APPLE_IMG_0206.jpg
DCIM_100APPLE_IMG_0207.jpg
DCIM_100APPLE_IMG_0208.jpg
DCIM_100APPLE_IMG_0209.jpg
IMG_0250.jpg
IMG_0251.jpg
IMG_0253.jpg
IMG_0254.jpg
IMG_0255.jpg
IMG_0256.jpg
IMG_1182.JPG
IMG_1192.JPG
IMG_1194.JPG
IMG_1195.JPG
IMG_1196.JPG
IMG_1197.JPG
IMG_1198.JPG

Show and Tell

IMG_1213.JPG
IMG_1204.JPG
IMG_1214.JPG
IMG_1205.JPG
IMG_1206.JPG
IMG_1207.JPG
IMG_1209.JPG
IMG_1210.JPG
IMG_1211.JPG
IMG_1212.JPG
IMG_1215.JPG
IMG_1216.JPG
IMG_1217.JPG
IMG_1218.JPG
IMG_1219.JPG
IMG_1220.JPG
IMG_1221.JPG
IMG_1222.JPG
IMG_1223.JPG
IMG_1224.JPG
IMG_1225.JPG
IMG_1226.JPG
IMG_1227.JPG
IMG_1228.JPG
IMG_1229.JPG
IMG_1230.JPG
cvr.jpg
I build another audio analyzer and it is special!

What better example then a video: https://youtu.be/MJjbBZXGAYU