For those of you who remember the eighties, this will no doubt bring back fond memories when every piece of audio equipment in the known universe was at the time equipped with a plethora of LEDs.
More specifically the ubiquitous Graphic Equaliser or 'Graphic EQ'.
This Instructable is centred around the MSGEQ7 to create a simple 2 Channel Graphic EQ (actually a simple spectrum analyser) and documents my first, poor attempt at using the Arduino Uno R3, the Arduino development environment and coding in 'C' for well over a decade.
To make the above the circuit you require no tools, a basic knowledge of electronics and the following parts/libraries;
- 3 off prototyping wires male/male connectors in the picture above (Red, Black and Green) to connect to the Light Dependant Resistor (LDR).
- 5 off prototyping wires male/female connectors again in the picture above (Red, Black, Blue, Green and Yellow) to connect to the 8x8 Led Matrix.
- 2 off 8x8 Led Matrices. From leading-star on Amazon. £1.90 (This was the price at the time of purchase, but I have noticed they are slightly more expensive, priced at £2.09 at the time of writing this Instructable).
- 1 off LDR. From Farnell.
- 1 off 22K Resistor. From Farnell
- 1 off Arduino Uno. From Proto-Pic £18.65. www.proto-pic.co.uk/arduino-uno/
- 1 off Spectrum Shield. From Proto-Pic. £22.25. www.proto-pic.co.uk/spectrum-shield/
- The Arduino LedControl library in Git Hub. https://github.com/wayoda/LedControl/releases
The circuit allows for the display of left and right audio channels. Seven of the columns of each 8x8 display represent a scaled analogue of the following frequency components present in the audio signal path at any transient in time.
16kHz, 6.26kHz, 2.5kHz, 1kHz, 400Hz, 160Hz and 63Hz
The data sheet for the MSGEQ7 can be found here; https://www.sparkfun.com/datasheets/Components/General/MSGEQ7.pdf
The last column represents a rolling average value of all the frequency components.
Audio is supplied to the Spectrum Shield via either of the on board 3.5mm Jack sockets, the other socket is used to route this audio to a speaker.
The circuit diagram for the Spectrum Shield can be found here; http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Dev/Arduino/Shields/SpectrumShield-v14.pdf
The LDR is used to programmatically dim the 8x8 LED Matrix displays if the ambient light level drops to allow better contrast for the viewer.
Step 1: Detailed Design
The above picture shows how to connect up the rest of the circuit to the Spectrum Shield and the two 8x8 LED matrices. There is a copy of the Arduino sketch used to drive the display attached below.
Step 2: Tidy Up
This bit is for the more experienced electronics enthusiast and requires some specialist tools, such as soldering iron, pliers, snips etc.
Now the software was working I tidied up the circuit and committed to a veroboard design which fitted neatly on top of the stacked Arduino Uno and Spectrum Shield pair.
Finally I modified the pins on the 8x8 LED Matrices such that they were perpendicular to the circuit board and would be a push fit into the 0.1" pitch headers on the veroboard.
Detailed pictures above.
Step 3: Putting It All Together
The video above shows the fully assembled design using the veroboard assembly.
There are three tracks playing on the iPod.
- Right Channel Frequency Sweep
- Left Channel Frequency Sweep
- Some random music with a broad spectral density (shows more lights)
Oh, and I forgot to mention. I shamelessly ripped some code to show the scrolling text at start up, though I did make some minor changes swapping row for column due to the 90 degree orientation of the displays.
Scrolling source from here; http://tronixstuff.com/2013/10/11/tutorial-arduino-max7219-led-display-driver-ic/
Full copy of software attached below.
Step 4: Closing Comments
Though I finally settled on a design using the spectrum shield, more through lazy convenience than for any other reason, I had initially started out intending to construct my own circuit from scratch.
I have included this section for useful background information, in case you wish to go down the self construct not buy route.
Using the circuit show above, which is a slightly modified rip of the MSI Corp datasheet, I assembled a single channel Graphic EQ.
The attached a video (apologies in advance for the choice of music) shows the live display in action.
The top trace on the digital scope shows the trigger line from the Arduino to the MSGEQ7 and the bottom the clocked output from the MSGEQ7. The level of which is a scaled analogue representing the frequency content from 63Hz ... 16KHz.
Strictly speaking the code to control the MSGEQ7 need only issue the one reset pulse and continually cycle 7 pulses. In the end I settled for issuing a reset pulse each read cycle, mainly because it made the code easier.