0

I've got an Arduino Micro, and a MAX4466 ECM / AMP breakout board (https://www.adafruit.com/product/1063). I'm powering the Arduino Micro from the USB port.

On the MAX4466 (to the Arduino), I've wired VCC to 3.3v, GND to GND, and OUT to A0. I've also wired 3.3v to AREF.

Using the following code, I'm noticing significant noise spikes on the output, as shown in the graph below.

I'm not entirely sure what I've done wrong here, and would appreciate any input / criticism that could lead to getting a clean signal.

void setup()
{
   Serial.begin(9600);
   analogReference(EXTERNAL);
}


void loop()
{
   Serial.println(analogRead(0));
}

enter image description here

12
  • And if you sample at exactly 50Hz or a multiple thereof? Commented Jun 27, 2015 at 4:42
  • @IgnacioVazquez-Abrams I've just taken another sample, both with the above code, and with the above code, with addition of a call to delay by 20ms per sample. This screenshot shows the result: s21.postimg.org/4fplz8g8n/…. As you can see, the noise is much lower now, and I'm not seeing such massive peaks any more..although there are still some peaks, at a much lower amplitude.
    – Seidr
    Commented Jun 27, 2015 at 5:04
  • You could average the samples to get a lower noise. But it kind of depends on what you are trying to achieve. As you notice the noise only produces values lower than expected, not higher. So if you want to e.g. detect a clap, this kind of noise doesn't really affect your program, as you'd measure peaks. (PS try increasing the baudrate of the serial connection and see what that does.)
    – Gerben
    Commented Jun 27, 2015 at 13:04
  • You could try adding a resistor between 3.3v and AREF or even better an inductor.
    – Gerben
    Commented Jun 27, 2015 at 13:15
  • @Gerben thanks for the comments. I've actually got a sketch with 4 frame averaging ready, just haven't had a minute to test it yet :) RE the resistor, I've read the same about between A0 and GND. I'll see if I can pick up a few different resistors later and give them a try :) Will report back
    – Seidr
    Commented Jun 27, 2015 at 13:21

2 Answers 2

1

The OP itself solve it:

Ok - so I suspected that it was the Arduino at fault.. Turns out it's a cheap Chinese clone. After purchasing an official Micro, and wiring up the same component, I'm getting a nice clean signal (bar a small amount of acceptable noise), which is reflecting input tones accurately. Thanks again for all the input!

0

Interesting plot. Gives me the impression that your reference is sagging, consider adding some local storage (tant/ceramic capacitors) across the cpu's power in pins and across the cpu's Reference pin. Would also be interesting to know if adding more delay between measurements would improve performance. Thanks for sharing you issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.