Spectrum Headphone

Summary

This project is for making a audio (music) frequency spectrum analyzer / visualizer using Arduino.

What are you going to build? What des it do? Why are you excited to build it? I’m building a spectrum analyzer the project uses an arduino micro to perform an fft (Fast Fourier Transform) on the incoming audio signal and display the results as a frequency vs. volume graph on the earcups of the headphones. credit: https://www.anhadsawhney.com/#/headphones/ ( source project)

Plan

There is an lm384 based amplifier and circuitry for a 2.5v dc offset before the arduino to ensure that the audio fills the entire range of its ADC (Analog to Digital Converter). Originally, the code used will be official ST7735 Tft library from Adafruit. Unfortunately this driver is very slow and I have to create very minimal graphics to ensure a fast response time and low latency with respect to the incoming audio signal. Later, I will switch to a 3rd party library which will allow me to implement more graphical elements such as different colors and an average amplitude indicator.Everytime the lower frequencies of the signal spikes, the display colors invert. This gives a better impression that the display is moving with the beat of the music.

What steps are you going to take to build it? What tools are you going to use? What will you do first, second, third, etc.? Arduino board (ATmega328P) has built in Analog To Digital converter (ADC) which is being used here for converting input audio signal into digital samples. ADC is configured to sample input signal with the clock frequency of 38.46khz. This is achieved by configuring ADC prescaler to 32. Sampling frequency of 38.64Khz means that digital samples can reproduce input frequency of upto 19.32Kz (Nyquist’s theorem) which is good enough for audio signals.

As I mentioned in the beginning, the intended purpose of this project is to display frequency spectrum of audio music signal. Hence left and right audio channels are mixed together and fed into the A0 analog input of the ADC. You may use a audio splitter cable so that you can feed same music simultaneously into spectrum analyzer and into another amplifier ( if needed ).ADC is configured to use external reference voltage. In this project reference voltage for is derived from the 3.3v stabilized voltage source on the Arduino board. As analog signal oscillates above and below zero voltage level we need a DC bias at the analog input of the ADC. This ensure that ADC output doesn’t clip on the negative cycles of the input signal. Same 3.3v stabilized voltage is divided with two resistors R1 & R2 and then fed into the analog input for DC bias. With this DC bias ADC will produce 512 in the output even if the input signal is disconnected. Later in the code this 512 which is caused by DC bias is being subtracted so that the reading represent the actual input signal variation.Frequency response of the system was tested by feeding sine wave generated by one of the online signal generator website. It is verified that system is able to respond for frequencies

The projects I build and the art I make are all explorations of ideas that interest me, and ways to learn new skills. Since much of what I do is built on the work of others

Budget

ProductSupplier/LinkCost
Audio Technica ATH-50x Headphoneshttps://arcus-www.amazon.in/Audio-Technica-ATH-M50x-Over-Ear-Professional-Headphones/dp/B00HVLUR86$151 (deliver charge included)
Arduino Microhttps://robu.in/product/original-arduino-micro-no-headers/?gclid=CjwKCAiAqaWdBhAvEiwAGAQltjwJuJy3di_P510ILxbI7BXjyh3kCLHJ0avgW-L0lOxNmu-EgVFexRoCS9gQAvD_BwE$19.95
Protoboardhttps://robu.in/product/zy-208-3220pts-breadboard-4pcs-830pts-mb-102/?gclid=CjwKCAiAqaWdBhAvEiwAGAQltkMGepM2BIH85uo43mMfxx0ffWr6soxKKg-Qrf6K7fvAtGnr4wy6BRoCNyIQAvD_BwE$13.66
9v Battery with holder and switchhttps://www.amazon.in/Electronicspices-Battery-Holder-Switch-holder/dp/B08L57WTNN$1.08
Female Headershttps://www.amazon.in/Robo-India-Header-Relimate-Connector/dp/B00RUNYE66$2.72
Lm384 and IC Sockethttps://www.amazon.in/Audio-Amplifier-Romtek-Matching-sockets/dp/B07KYDNQ3J$5.40
Electrolic and Ceramic Capacitorshttps://robu.in/product/10-uf-25v-through-hole-electrolytic-capacitor-pack-of-40/ and https://robu.in/product/100nf-0603-surface-mount-multilayer-ceramic-capacitor-pack-of-40/$1.82
Resistorshttps://www.amazon.in/Resistors-Assortment-Tolerance-Excellently-Breadboards/dp/B07D2Z45CG?th=1$29
Jumper Wireshttps://robu.in/product/20cm-dupont-wire-color-jumper-cable-2-54mm-1p-1p-female-female-40pcs/?gclid=CjwKCAiAqaWdBhAvEiwAGAQltkDX_Bzh786v2ejrurNHUXmR1gjxpdL3Tiz1SD5i78Rpq36leV-8kxoCtZQQAvD_BwE0.60$
3d Printed Casehttps://robu.in/product/transparent-acrylic-case-shell-enclosure-gloss-box-for-arduino-uno-r3/?gclid=CjwKCAiAqaWdBhAvEiwAGAQltpATfOKL0bFpp0jebivBGJwx2-ulj3dApk3w1z6On9r0Dd_W-E-N3hoChHQQAvD_BwE1$
Ribbon Cablehttps://robu.in/product/52911/?gclid=CjwKCAiAqaWdBhAvEiwAGAQltmA62fGLbiuXaZOd0XbyPS2vLAmM4yKIWTERmFg3FSkWy7G8VuOp4xoCM3cQAvD_BwE1.5$
Color TFT LCD Display with MicroSD Card-(2 quantity)https://www.electronicscomp.com/1.8-inch-spi-128x160-tft-lcd-display-module-with-pcb-for-arduino?gclid=CjwKCAiAqaWdBhAvEiwAGAQltiQOfNt7kbnJ7quUxpwRQOwDBYWHsfFfq9GIKW3LYVdG5nRzLg9QnRoCIfQQAvD_BwE(2) 14$
soldering machinehttps://thinkrobotics.in/products/soldering-iron?variant=33115304034390&currency=INR&utm_medium=product_sync&utm_source=google&utm_content=sag_organic&utm_campaign=sag_organic2.3$
solderhttps://www.amazon.in/Electronicspices-Rosin-Solder-Electrical-Soldering/dp/B07YX7GC4N/ref=sr_1_4?keywords=rosin+core+solder&qid=1672840249&sr=8-41.80$
fume fanhttps://robu.in/product/dc-5v-0-06a-5015-double-ball-centrifugal-fan-with-xh2-54-2p-30cm-cable-size505015mm/?3.90$
Total249.7$