I am trying to build a device for monitoring ambient noise in a room. I am using SparkFun ESP32 Thing MCU together with SparkFun Sound Detector(electret mic + opamp LMV324m). Nothing fancy, just read output from microphone with ADC.

My debuq/measurement setup(connected to breadboard) tried with and without L1, R1, C1 and C2: setup_schematic

I have two problems:

  • High prority: when ESP32 is running, it creates a lot of noise on the microphone's AUDIO output. Most significant are spikes every 100ms. As you can hear on recording or see below. These spikes are also present on ENVELOPE output.

  • Lower priority: When ESP32 is turned off, or if it is connected alone to +5V USB without esp32, there is still lot of noise from the microphone module itself. As you can hear on recording when I turned off esp32.

Output from AUDIO recorded using laptop: (0s - 5s : esp32 ON) (5s - 10s : esp32 OFF, I pushed and hold RESET button) (10s - 15s : esp32 turned ON again) https://instaud.io/236W

Spikes every 100ms on AUDIO output audio_spikes


I have tried to:

  • use L1, R1, C1 and C2 components as you can see in schematics (all combinations of them)
  • create primitive shielding of microphone modul using copper plate and tin box connected to GND.
  • separate esp32 from mic to approx. 1m distance (used longer cable)
  • use thick ass copper cables instead of cheap chinnese breadboard ones

with no success

  • \$\begingroup\$ why is there an inductor on your esp GND? \$\endgroup\$ – BeB00 Apr 16 '18 at 12:34
  • \$\begingroup\$ @BeB00 when connecting AGND with GND, it is sometimes done using small inductance, ferrite bead or something like that, It should act as low pass filter, thats why \$\endgroup\$ – Parrrot Apr 16 '18 at 12:46
  • 1
    \$\begingroup\$ Sparkfun Sound Detector "The Sound Detector is an analog circuit, and as such, it’s more sensitive to noise on the power supply than most digital circuits. Since the capsule is effectively a voltage divider sitting across the power rails, it will transcribe any noise on the supply lines onto the capsule output." - what happens if you power the sound detector with a battery? \$\endgroup\$ – Bruce Abbott Apr 16 '18 at 12:51
  • \$\begingroup\$ @BruceAbbott I did not tried that since I have no battery available, but I will get one and see. However, this device should be powered from USB... and yes, I believe that power supply is main problem but I thought that some magic voltage stabilizer could solve my problem... \$\endgroup\$ – Parrrot Apr 16 '18 at 13:07

Implementing a filter was the right idea, however, your current filter works on frequencies above 10 kHz and is totally ineffective against the noise you have. You will need a much bigger cap to efficiently filter out that 10Hz signal.

At such a low frequency, using a passive RLC filter isn't very practical. I would suggest using a separate power supply here. If that is not possible, you could re-generate the supply voltage for the sound detector from ESP32 +5V supply using a DC-DC converter. Then you will only have to filter out the converter noise, which will be somewhere in 100kHz range.

  • \$\begingroup\$ Thank you very much. This sounds quite reasonable. I will try to lower frequency of that filter and see what that does. Then I will look for DC-DC converter you mentioned. Do you know any particular model that could fit my needs? Just to lower time of my research :-) \$\endgroup\$ – Parrrot Apr 17 '18 at 6:24

Shown below is the picture that the OP drew but I've added a red line showing where there could be a problem: -

enter image description here

Noisy power supply currents in the red wire will generate a small volt drop along the length of that wire and this adds noise to the audio signal from the sparkfun sound detector as received by the laptops microphone input.

Ideally, you would star-point the audio cable's signal_return directly to the sparkfun detector's GND pin. However, there is no guarantee that this may work noise-free because internally (on the sparkfun module) that ground may be also subject to pickup due to internal logic currents flowing that are unassociated with the audio.

You could also try using an audio transformer to isolate the grounds because the USB is also throwing in an "extra" factor as it is sourced from the Laptop. It might be tricky to solve.

Another thing to try is forming a 10:1 audio attenuator wih resistors - I expect that the microphone input is sensitive enough to cope with this amount of (signal+noise) attenuation with the benefit that the audio signal from the sparkfun module might be able to drive higher signal hence SNR increases.


You appear to have a ground loop present with the laptop ground -> usb cable -> mic ground. Try eliminating this first. If this doesn't solve it, consider moving your ground inductor, to isolate the laptop ground. The sound detector ground can also inject noise into the output.

Edit for clarity: Image edited to show ground loop

See the attached image edited to show the ground loop. With longer wires, the inductor will allow low frequency currents to pass, but will pick up high frequency noise, and the laptop mic will convert this to signal.

  • \$\begingroup\$ Sorry, I can't figure out what exactly you are suggesting to isolate. \$\endgroup\$ – Dmitry Grigoryev Apr 16 '18 at 13:46
  • 1
    \$\begingroup\$ @eoinm90 I am aware of this possible "ground loop" but I have tried it without LAPTOP MIC IN connected, even with different laptops, plugged and unplugged from power supply with slight changes in noise, but no big improvement. I don't know what do you mean by "moving your ground inductor, to isolate the laptop ground" \$\endgroup\$ – Parrrot Apr 16 '18 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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