AhmedDarwish
Published © CC BY-NC

Dancing Fountain: Arduino with MSGEQ7 Spectrum Analyzer

Using the Arduino to control 3 modes of Spectrum Analyzing Technique with the MSGEQ7.

IntermediateFull instructions provided17,646
Dancing Fountain: Arduino with MSGEQ7 Spectrum Analyzer

Things used in this project

Hardware components

3.5 Audio Jack
×1
MSGEQ7 Spectrum Analyzer IC
×1
Perma-Proto Breadboard Half Size
Perma-Proto Breadboard Half Size
×1
LED (generic)
LED (generic)
×7
Arduino Mega 2560
Arduino Mega 2560
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires

Story

Read more

Custom parts and enclosures

Schematic connection for the MSGEQ7

The main connection for the MSGEQ7 before connecting it to the Arduino.

Schematics

LED as digital outputs

In this connection, we can get the outputs as digital signals. The LEDs flash upon the strength of the input frequencies' power.

LEDs as PWM outputs

In this connection, we can get the outputs as PWM digital signals. The LEDs fade and shine upon the strength of the input frequencies' power.

Pumps as digital outputs

In this connection, we can get the output as digital signals. The pumps runs and the LEDs flash upon the strength of the input frequencies' power.

Code

Source Raw Code

C/C++
This code is a raw code used to test the functionality of the MSGEQ7 IC
#define msg7RESET 3
#define msg7Strobe 2
#define msg7DCout 0

const int LEDpins[7] = {4,5,6,7,8,9,10};

void setup() {

for (int x=0; x<7; x++)
{
pinMode(LEDpins[x], OUTPUT);
}
pinMode(msg7RESET, OUTPUT);
pinMode(msg7Strobe, OUTPUT);
}

void loop()
{
digitalWrite(msg7RESET, HIGH);
delay(5);
digitalWrite(msg7RESET, LOW);

for (int x = 0; x < 7; x++)
{
digitalWrite(msg7Strobe, LOW);
delayMicroseconds(35);
int spectrumRead = analogRead(msg7DCout);

int PWMvalue = map(spectrumRead, 0, 1024, 0, 255);
if (PWMvalue < 50)
PWMvalue = PWMvalue / 2;
analogWrite(LEDpins[x], PWMvalue);
digitalWrite(msg7Strobe, HIGH);
}
}

Credits

AhmedDarwish

AhmedDarwish

1 project • 1 follower

Comments