Problem with Arduino + Electret Mic + LED Strips + Library

Hey all. This might not belong in sensors, but it could be an audio filtering issue so I'm putting it here for now.

I'm trying to build an ambient sound visualization using addressable LED strips.



The raw microphone reading seems to be oscillating when I use the ledStrip.add() method to update the strip. It will oscillate from about 400-900. My strip lights up successfully, but it just goes back and forth between these values. If I comment out ledStrip.add() and just read the mic via Serial Monitor, the oscillation stops (but in that case, the strip doesn't get written to).

This could be an issue with the LED Strip Controller library, but I really can't figure it out. I've been stuck on this for a few days. Any guidance/pointers would be greatly appreciated. Thank you!

As an old Broadcast Engineer who has wired miles of microphone cables, I'd say this sounds like an electrical interference problem.

Here's an idea: LISTEN to the mikes. Just connect some HiFi/boombox with a Line Input to the output of the microphone. Disconnect the LEDs. Have someone talk near the mike, and get set so your can hear that well, but not up to the feedback point. NOW turn the LEDs on. Hear some buzzing and crackling etc?? If so, you have to start paying attention to your cabling, carefully separating all the low-level microphone stuff from those pulsing, zapping LEDs. What kinds of cabling are you using??

Power the LEDs separately from the rest, with only a common ground to Arduino.

Tell us what you find out.