I have sets of LED lights hooked up to an arduino and MSGEQ7 and they play to the audio. They’ve been working great for months but today all of a sudden they stay full blue and green at the same time but no red, so they appear teal. They stopped responding to the music at all. They just stay blue/green constantly whether i restart the arduino, computer, or anything.
I tried replacing the entire arduino board with a brand new one and they do the same thing.
I tried removing the MSGEQ7 chip but they do the same thing.
I tried removing the audio cable but they do the same thing.
I even tried swapping out the mosfets from each color but they do the same thing. I also rewired the entire breadboard thinking it was the wiring, nothing.
The only time they turn off is when i set the threshold over 800 in the code for the arduino or if i disconnect the GND wire. If i disconnect the 5V wire then they blink randomly all different colors, including red.
I havent replaced any capacitors or resistors yet and i dont have another MSGEQ7 to swap out, if thats the problem. I do have an MSGEQ7 shield from sparkfun but i just got it in the mail this week and dont know anything about it.
Can someone help me modify my code and rewire so i can try subbing in the shield? Or does anyone have any suggestions? Im going to go to radio shack tomorrow and replace all the resistors and capacitors but i dont think thats the problem.
This is my schematic:
And this is my code:
int analogPin = 0; // MSGEQ7 OUT
int strobePin = 2; // MSGEQ7 STROBE
int resetPin = 4; // MSGEQ7 RESET
// MSGEQ7 OUT pin produces values around 50-80
// when there is no input, so use this value to
// filter out a lot of the chaff.
int filterValue = 80;
// LED pins connected to the PWM pins on the Arduino
int ledPinR = 9;
int ledPinG = 10;
int ledPinB = 11;
// Read from MSGEQ7 OUT
// Write to MSGEQ7 STROBE and RESET
// Set analogPin’s reference voltage
analogReference(DEFAULT); // 5V
// Set startup values for pins
// Set reset pin low to enable strobe
// Get all 7 spectrum values from the MSGEQ7
for (int i = 0; i < 7; i++)
delayMicroseconds(30); // Allow output to settle
spectrumValue = analogRead(analogPin);
- // Constrain any value above 1023 or below filterValue*
spectrumValue = constrain(spectrumValue*, filterValue, 1023);*
* // Remap the value to a number between 0 and 255*
spectrumValue = map(spectrumValue*, filterValue, 1023, 0, 255);*
* // Remove serial stuff after debugging*
* // Write the PWM values to the LEDs*
* // I find that with three LEDs, these three spectrum values work the best*
* analogWrite(ledPinR, spectrumValue);*
* analogWrite(ledPinG, spectrumValue);*
* analogWrite(ledPinB, spectrumValue);*