Devices & Components
Arduino Mega 2560 Rev3
LED (generic)
MSGEQ7 Spectrum Analyzer IC
Perma-Proto Breadboard Half Size
3.5 Audio Jack
Hardware & Tools
Wire Stripper & Cutter, 18-10 AWG / 0.75-4mm² Capacity Wires
Software & Tools
Arduino IDE
Project description
Code
Source Raw Code
c_cpp
This code is a raw code used to test the functionality of the MSGEQ7 IC
1#define msg7RESET 3 2#define msg7Strobe 2 3#define msg7DCout 0 4 5const int LEDpins[7] = {4,5,6,7,8,9,10}; 6 7void setup() { 8 9for (int x=0; x<7; x++) 10{ 11pinMode(LEDpins[x], OUTPUT); 12} 13pinMode(msg7RESET, OUTPUT); 14pinMode(msg7Strobe, OUTPUT); 15} 16 17void loop() 18{ 19digitalWrite(msg7RESET, HIGH); 20delay(5); 21digitalWrite(msg7RESET, LOW); 22 23for (int x = 0; x < 7; x++) 24{ 25digitalWrite(msg7Strobe, LOW); 26delayMicroseconds(35); 27int spectrumRead = analogRead(msg7DCout); 28 29int PWMvalue = map(spectrumRead, 0, 1024, 0, 255); 30if (PWMvalue < 50) 31PWMvalue = PWMvalue / 2; 32analogWrite(LEDpins[x], PWMvalue); 33digitalWrite(msg7Strobe, HIGH); 34} 35} 36
Source Raw Code
c_cpp
This code is a raw code used to test the functionality of the MSGEQ7 IC
1#define msg7RESET 3 2#define msg7Strobe 2 3#define msg7DCout 0 4 5const 6 int LEDpins[7] = {4,5,6,7,8,9,10}; 7 8void setup() { 9 10for (int x=0; x<7; 11 x++) 12{ 13pinMode(LEDpins[x], OUTPUT); 14} 15pinMode(msg7RESET, OUTPUT); 16pinMode(msg7Strobe, 17 OUTPUT); 18} 19 20void loop() 21{ 22digitalWrite(msg7RESET, HIGH); 23delay(5); 24digitalWrite(msg7RESET, 25 LOW); 26 27for (int x = 0; x < 7; x++) 28{ 29digitalWrite(msg7Strobe, LOW); 30delayMicroseconds(35); 31int 32 spectrumRead = analogRead(msg7DCout); 33 34int PWMvalue = map(spectrumRead, 0, 35 1024, 0, 255); 36if (PWMvalue < 50) 37PWMvalue = PWMvalue / 2; 38analogWrite(LEDpins[x], 39 PWMvalue); 40digitalWrite(msg7Strobe, HIGH); 41} 42} 43
Downloadable files
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.
LEDs as PWM outputs

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.
Pumps as digital outputs

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.
Pumps as digital outputs

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.
LED as digital outputs

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.
LEDs as PWM outputs

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

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

Comments
Only logged in users can leave comments