Pages: [1]   Go Down
Author Topic: Problem with MSGEQ7 and Arduino  (Read 557 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 31
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,


Following this tutorial (http://www.uduino.com/Tutorials/7) I hooked up an Uno with a MSGEQ7 display filter IC. Using his code:

Code:
int analogPin = 0; // read from multiplexer using analog input 0
int strobePin = 2; // strobe is attached to digital pin 2
int resetPin = 3; // reset is attached to digital pin 3
int spectrumValue[7]; // to hold a2d values

void setup()
{
 Serial.begin(9600);
 pinMode(analogPin, INPUT);
 pinMode(strobePin, OUTPUT);
 pinMode(resetPin, OUTPUT);
 analogReference(DEFAULT);

 digitalWrite(resetPin, LOW);
 digitalWrite(strobePin, HIGH);

 Serial.println("MSGEQ7 test by J Skoba");
}

void loop()
{
 digitalWrite(resetPin, HIGH);
 digitalWrite(resetPin, LOW);

 for (int i = 0; i < 7; i++)
 {
 digitalWrite(strobePin, LOW);
 delayMicroseconds(30); // to allow the output to settle
 spectrumValue[i] = analogRead(analogPin);

 // comment out/remove the serial stuff to go faster
 // - its just here for show
 if (spectrumValue[i] < 10)
 {
 Serial.print(" ");
 Serial.print(spectrumValue[i]);
 }
 else if (spectrumValue[i] < 100 )
 {
 Serial.print(" ");
 Serial.print(spectrumValue[i]);
 }
 else
 {
 Serial.print(" ");
 Serial.print(spectrumValue[i]);
 }

 digitalWrite(strobePin, HIGH);
 }
 Serial.println();
}

See pics for breadboarding and setup. I'm using my iPhone for audio input, and I've verified that I am using the ground and the left channel.

All I get is a repeat of the same numbers:

 803 803 798 803 803 803 802
 803 803 802 803 802 803 803
 803 803 800 803 803 802 803
 799 803 802 803 802 804 802
 804 803 802 801 803 804 803
 803 803 802 803 804 797 804
 802 803 803 803 803 799 803
 804 801 802 802 803 801 803
 803 800 803 801 803 803 803
 803 802 802 802 803 803 803
 804 803 804 803 803 801 804
 804 803 803 804 801 803 803

When I remove the wires for audio input the readout does not change. What am I doing wrong here?

Logged

Offline Offline
Sr. Member
****
Karma: 3
Posts: 250
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What's the sound your sampling fixed tone or a song
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 31
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Song, so I was hoping to see a lot of variance in the readings.
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6144
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You might have blown the input to the chip.  I would have suggested a 22k resistor before the capacitor on the input, to help limit the input.
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't remember the wiring offhand to see if thaats right, but I remember when I first starting playing around with the msgeq7 the biggest problem was miswiring, aalso I couldn't tell from the pic but make sure the audio source ground is connected properly
do you have an a small speaker you can connect to the audio source using the same connections? Idk how you connected to it but sometimes if you just cut the cord off eearphones that wire is enameled and maybe its not connected well enough, if you have an oscilloscope take a look at the audio while its connected as well as the output of the msgeq7 and see if it doesn't match the arduinos serial output
Logged

Offline Offline
Edison Member
*
Karma: 5
Posts: 1730
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Also idk how much experience you have with breadboards or the specs on that one but make sure the rails are connected all the way across, I notice to get a ground from the middle of the rail and usually the rails are actually separated in groups
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I have this identical problem.  I'm wondering if OP found a solution.

Thanks,
Dan
Logged

Pages: [1]   Go Up
Jump to: