## Introduction: Spectrum Analyzer

This project was for 'Creative Electronics', a Beng Electronics Engineering 4th year module at the University of Málaga, School of Telecommunications (https://www.uma.es/etsi-de-telecomunicacion/).

The project has been designed and assembled by Carlos Almagro, Diego Jiménez and Alejandro Santana, we have made a “box music player” controlled by a Arduino Mega (we have chosen it because Arduino Leonardo wasn't powerful enough for the neopixel matrix), that shows through a 8x32 neopixel matrix the spectrum of music. The main idea is to sample the sound signal in 8 bars (one bar in order to represent each frecuency interval, until 20kHz).

The signal enters through a jack 3.5 port and goes to the arduino and the speakears, previous step of being amplified.

## Step 1: Components and Materials

Arduino Mega (brandElegoo)

Placa de soldadura a doble cara

4 resistencias de 220

4 leds

2 old speakers

2 resistances of 330

2 insertion push buttons

1 resistance of 470

1 condenser of 10uF

1 condenser of 220uF

1 resistance of 1K

1 resistance of 100k

2 UA741

Insertion Pines male and female

2 amplifiers PAM8403

## Step 2: Hardware

As we know, the voltage range that can be input to Arduino is in the range of 0 [V] to 5 [V], but the voltage range of the audio signal outputted from the earphone terminal of the personal computer etc. is -0.447 [ V] to 0.447 [V].

That means that the voltage swings even to the minus side and the amplitude is too small Directly to Arduino Audio signal can not be input. Therefore, in this circuit, first, the voltage is pulled up by 2.5 [V], which is half the voltage of 5 [V], then input to the analog pin of Arduino after passing through the amplifier circuit to increase the amplitude It is configured. Then we are going to analyze the circuit diagram:

1. Midpoint potential superimposing / noninverting amplifier circuits X1 and X2 are stereo mini jacks. Since it is simply connected in parallel, it can be either input or output. We can see, only one of the stereo audio signals is captured. R17 is for adjusting the sensitivity of the spectrum analyzer. Through C1, one side of R17 is connected to the midpoint potential. By doing so, it is possible to superimpose a voltage corresponding to the midpoint potential to the input audio signal. After that there is no irreversible amplifier circuit. In addition, it is necessary to use op amp with rail-to-rail output (full swing output).

2. Midpoint potential generating circuit (rail splitter) R9, R10, R11 divide the power supply voltage in half and input it to the voltage follower. R11 is for fine adjustment of the midpoint potential. I think that it is good to use a multi-turn semi-fixed resistor here.

3. Analog power supply LPF circuit R6 and C3 constitute a low pass filter with extremely low cutoff frequency and use it as a power supply for operational amplifiers. By doing this, noise mixed from the main power supply is cut. Since the voltage of VCC drops below + 5V because R6 is in series with the power supply, this voltage is input to the analog reference voltage pin of Arduino. The program sets the reference voltage source externally.

4. SPI voltage divider circuit for the LED panel controller Connect the LED panel controller here, but since the voltage that can be input to the LED panel controller is 3.3 V, the voltage dividing resistor is inserted.

Finally we only have to conect the neopixel panel to the digital pins I/O of the arduino.

We have taken this hardware designs from here http://blog.livedoor.j

we haven't seen any mention to license in this page, but we feel the need of mention and thanking it.

We've made a two buttons controller for change the diffent modes and we regulate the audio volume with a vaiable resistance.

## Step 3: Software

We have developed a program that applies the fourier transform to the analogic input signal throught the FFT library (wich you can download in the own arduino IDE), and it samples the signal for showing 8 frecuency intervals. It can choose among 4 different modes of lighting show.

## Step 4: The Case

The case design is totally free and diferent in each project, the only requirement is that all the components and circuits fit inside and can show the neopixel matrix.