Electronic – ESP32 microcontroller generates noise on microphone

esp8266microcontrollermicrophonenoisesparkfun

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

AUDIO FFT, ESP32 OFF (LEFT), ESP32 ON (RIGHT)
fft

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

Best Answer

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.