- Edited
Hello,
I have a problem using this MEMS microphone on Bela mini: https://learn.sparkfun.com/tutorials/mems-microphone-hookup-guide?_gl=1*1s04isu*_ga*MTYzMzE3MjQ1Ni4xNzAyMzkwMTI3*_ga_T369JS7J9N*MTcwNDY2MzYzMS4zLjEuMTcwNDY2MzY1MC40MS4wLjA.&_ga=2.144550133.1520399485.1704657639-1633172456.1702390127
datasheet: https://www.cdiweb.com/datasheets/invensense/admp401.pdf
I connect it to Bela mini to the A0 input and i use the following code in supercollider:
s = Server.default;
s.options.numAnalogInChannels = 2; // can only be 2, 4 or 8
s.options.numAnalogOutChannels = 2;
s.options.numDigitalChannels = 0;
s.options.maxLogins = 4; // set max number of clients
s.options.bindAddress = "0.0.0.0"; // allow anyone on the network connect to this server
s.options.blockSize = 16;
s.options.numInputBusChannels = 2;
s.options.numOutputBusChannels = 2;
// initialize scope
s.options.belaMaxScopeChannels = 8;
s.waitForBoot{
"Server Booted".postln;
(
SynthDef(\analog_to_audio, {
arg out=0;
var soundin = AnalogIn.ar(1).range(-1,1) *0.5;
//soundin = LeakDC.ar(soundin);
Out.ar(0, soundin.dup * 0.5)
}).send(s);
);
s.sync;
Synth.new("analog_to_audio", target: s);
};
ServerQuit.add({ 0.exit }); // quit if the button is pressed
No matter what analog pin I use, no matter if i put 0.1 uF capacitor between power lines nor if i use multiple capacitors between analog out on the MEMS and bela mini analog in - I ALWAYS hear some sort of electrical noise, fairly high pitched, that variates slightly but remains pretty much constant. Is there anything I am doing wrong? soldering looks ok, i tried different analog pins on bela, different ground and 3.3V lines, but no luck. Any ideas on how to troubleshoot this? I've also tried 2 MEMS of this same model and the problem remains.. I really don't know what could be causing this. It is occurring either USB powered from a computer, or USB wall powered (with the code running on boot), or powered via LiPo battery.
Appreciate anyone who can shed a light on this!
Robin