SparkFun Spectrum Shield DEV-13116

Hi

I have bought a sparkfun spectrum shield.

I carefully soldered header pins onto the spectrum board and I have tried it on a mega and 2 different Arduino Uno’s.

Does it work on Arduino Uno and Mega? Or do I need a Redboard?

I connected pins 7 to 13 to 330 ohm resistors and some yellow LEDs while I wait for red ones. And the common ground from the breadboard. As per sparkfun page on hook up. On the Mega these pins will be PWM. I want on off for the leds.

I have tried the spark fun demo. This does a chase of the LEDs 1 to 7 in a loop but not audioreactive.

I tried the spectrum analyser software which reads and writes input on the serial monitor and plotter.

I have tried the pulse width modulation on the mega. The LEDs are dim and seem to react to the audio input from phone or computer but not in time to the rhythm and still flash when there is no audio signal.

I have tried powering the mega from a powersupply.

None of the software seems to show audio reactive LEDs in time with the music.

I really want to operate relay modules with bass or frequency responsive but if I can get the LEDs working I am very close.

Can you please advice?

Are there any updates codes or forums with people having similar problems?

My thoughts are audio interference, defective board, bad code or defective Arduino.

Any help much appreciated.

Thanks

Max

It sounds like everything is working separately…which usually points to a code issue. I would recommend fiddling around and changing the programming until getting the desired result

Share a photo of the wiring/setup and the code/pins being used

HI.

I have been playing with code and asking chat gpt to help.

I have tested Leds are turning on or connected right with a simple program.

https://cdn.sparkfun.com/assets/learn_t … kup_bb.jpg

I have the board wired as in the link.

https://github.com/sparkfun/Spectrum_Sh … m_Demo.ino

https://github.com/sparkfun/Spectrum_Sh … M_Demo.ino

These are the 2 codes i have been trying and attempting to tweak.

/******************************************************************************

SparkFun Spectrum Shield Demo

Toni Klopfenstein @ SparkFun Electronics

December 2015

https://github.com/sparkfun/Spectrum_Shield

This sketch shows the basic functionality of the Spectrum Shield, working with a basic RGB LED Matrix.

The Spectrum Shield code is based off of the original demo sketch by Ben Moyes @Bliptronics.

This sketch is available in the Spectrum Shield repository.

Development environment specifics:

Developed in Arduino 1.6.

This code is beerware; if you see me (or any other SparkFun employee) at the local, and you’ve found our code helpful, please buy us a round!

Distributed as-is; no warranty is given.

*********************************************************************************/

// Declare Spectrum Shield pin connections

#define STROBE 4

#define RESET 5

#define DC_One A0

#define DC_Two A1

// Define LED connections on the Arduino/Shield

int LED = {7, 8, 9, 10, 11, 12, 13};

// Define spectrum variables

int freq_amp;

int Frequencies_One[3];

int Frequencies_Two[3];

int i;

// Define LED frequency ranges

int ledFrequencyRanges[2] = {

{60, 130}, // LED 7 - Frequency range 20Hz to 60Hz

{140, 200}, // LED 8 - Frequency range 60Hz to 250Hz

{200, 500}, // LED 9 - Frequency range 250Hz to 500Hz

{500, 1000}, // LED 10 - Frequency range 500Hz to 1000Hz

{1000, 2000}, // LED 11 - Frequency range 1000Hz to 2000Hz

{2000, 4000}, // LED 12 - Frequency range 2000Hz to 4000Hz

{10000, 15000} // LED 13 - Frequency range 4000Hz to 6000Hz

};

/Setup Loop*****/

void setup() {

// Set LED pin configurations

for (i = 0; i < 5; i++) {

pinMode(LED*, OUTPUT);*
digitalWrite(LED, LOW);
}

// Set Spectrum Shield pin configurations
pinMode(STROBE, OUTPUT);
pinMode(RESET, OUTPUT);
pinMode(DC_One, INPUT);
pinMode(DC_Two, INPUT);
digitalWrite(STROBE, HIGH);
digitalWrite(RESET, HIGH);

// Initialize Spectrum Analyzers
digitalWrite(STROBE, LOW);
delay(1);
digitalWrite(RESET, HIGH);
delay(1);
digitalWrite(STROBE, HIGH);
delay(1);
digitalWrite(STROBE, LOW);
delay(1);
digitalWrite(RESET, LOW);
}
/Main Function Loop***/
void loop() {
Read_Frequencies();
Light_LEDs();

}
/Pull frequencies from Spectrum Shield*/
void Read_Frequencies() {
// Read frequencies for each band
for (freq_amp = 0; freq_amp < 7; freq_amp++) {
Frequencies_One[freq_amp] = analogRead(DC_One);
Frequencies_Two[freq_amp] = analogRead(DC_Two);
digitalWrite(STROBE, HIGH);
digitalWrite(STROBE, LOW);
}
}
/Light LEDs based on frequency detection**********/
void Light_LEDs() {
for (i = 0; i < 7; i++) {
// Check if frequency range matches LED
if (Frequencies_Two >= ledFrequencyRanges[0] && Frequencies_Two < ledFrequencyRanges[1]) {
digitalWrite(LED, HIGH);
} else {
digitalWrite(LED, LOW);
}
}
}
This is the latest code after an evening of many codes with chat gpt. :slight_smile:
The effect of the project i am looking for is leds flashing on in time to the beats or different frequencies. When this is acheived the next stage will be sending the voltage to relays turning on and off in time to the music.
I have tried a line in from a mixer, phone and laptop. With one code i was getting interference with a usb cable which meant flickering leds with no signal.
I have thought i made need pots as an input to adjust frequency ranges live as the board processes different songs. Is the board meant for live or prerecorded. I think the video with chris taylor and the fire used a pre recorded track.
Can you recomend another way to process live sound beats and trigger relays if we cant get the board to work.
Thank

The effect so far is that when i adjust frequency ranges i seem to get 2 of 3 leds close to sync in the 1st 3 bands but only 2 leds with certain songs when ranges are tweaked. Pin out 7 8 and 9 sometimes seem to sync but on low frequency’s. Sometimes i get 2 coming on at the same time close to the beat. I am using pins 7,8,9,10,11,12,13. I have tried donna summers i feel love, drumming loops on youtube and drum and bass songs.