MKR1000 ADC can record audio?

Where can I find the MKR1000 microcontroller's ADC input spect? looking for DC & AC spec
is the ADC designed for audio application? or design only for slow sensor application?

Hi @johnsadiq

The SAMD21 microcontroller's ADC specification can be found in the datasheet, section 33:

1 Like

No, but it has I2S interface so you can connect external dedicated audio ADC

1 Like

The microcontroller (SAM D21) is 12 bits at up to 350ksps, so it's certainly capable of audio capture. It's not going to be audiophile quality, but it's capable of better than telephony quality.

What is it you plan on doing with the audio?

1 Like

I have a MAX4466, My goal is to have audio from the microphone be able to be read from the microprocessor and ultimately save into an SD card. before concerning with the SD card portion, My thoughts are to connect a speaker to the microphone and have it act as a bridge from microphone to speaker just to see If audio comes out clear enough to record someone speaking.
(As I should mention this is for educational purpose only)

The MAX4466 will be good enough to get you going with your experiments, but in my experience one would like more gain in microphone module interfacing directly to an Arduino ADC.

I've had much better results with the max9814 modules. These have considerably higher voltage gain, the gain is configurable, integral automatic gain control, and are DC offset so no ADC input bias network is required.

yes I have the MAX9814 as well, would the portenta H7 work better for the microphone?

do you know would I need op amp from the microphone to boost the signal?

Yes, you need a preamp. A microphone puts-out a few millivolts (depending on the sensitivity of the mic and the loudness of the sound). You need around 1V (AKA "line level"). The 9814 & 4466 ARE preamp chips.

Electret condenser mics need power, and the ADC typically requires a biased input because they can't handle the negative-half of the AC audio waveform. If you buy a microphone board/module, all of that is usually taken care of for you.

If you're writing your own code "from scratch" the Audacity website has a nice introduction to how digital audio works.

And if you want to write WAV files to an SD card, here is the WAV format specification.

Save yourself some time and just write the raw audio samples into SD card. Audacity can import raw PCM audio.

003

1 Like

oh I didnt know this is possible. but ultimately this there's a bigger image for this but I'm trying to take it step by step. ultimately I want the audio to be saved in the SD card and then to be able to use the Wifi chip to transfer the data to a web app to be view able

Get yourself INMP441 microphone or 2 if you want stereo, it connects to I2S directly and works really good. You definitely dont want to start sampling with inbuilt ADC when you practiclly have system capable of supperior quality in your hands

Been there, done that. I have an STM32 board, and I'm using it to prototype a voice streaming solution via WiFi. If you have the raw audio samples already, you can actually put that into a raw UDP packet and have VLC listen to it. It is soft of a cheap spectrum analyzer since VLC can "visualize" the data

vlc --network-caching=200 --demux=rawaud --rawaud-channels=1 --rawaud-samplerate=8000 udp://@:56000

I use it to test my stuff, you just need to know the sample rate and PCM format (signed 8, 16, 24 etc), though there's a bug in VLC that it can't processed stereo when streamed via raw UDP socket.

1 Like

I'm trying to look at the datasheet trying to figure out where to wire the MAX9814 to the microcontroller but I don't know which pin is the ADC pin. I think I will go with the idea hzrnbgy mentioned and just send the digital data to the SD card and have the conversation be done on the windows side to convert the digital to .wav

Thank you that's a good idea to send the raw data. I will probably do 8 so I won't have to deal with compression and uncompression. I'm trying to find examples or any leads toward how to take the data and save it onto an SD card but not entirely sure about how to do so and what format would I save it as?

On the module the "out" pin goes to the microcontroller ADC input pin.

Vdd goes to to power on the microcontroller, either 3.3 V or 5 V, consistent with the microcontroller voltage.

gnd goes to the microcontroller ground connection.

gain is used to set the maximum gain, you can leave this unconnected which gives 60 dB gain (unless automatic gain control kicks in).

AR is used to modify the characteristics of the automatic gain control. You can leave this unconnected.

For the microcontroller ADC input pin, I'm having trouble finding which pin is that

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.