6

I’d like to try using my voice as an input to my Pico. I think I should be able to define a pair of one-word voice commands, and train a Tensor Flow Lite Micro for Pico model on them.

What I can’t figure out is if I can connect a microphone to the Pico. I hope it might be possible to connect a small mic through the ADC GPIO pins, but I’m uncertain and my research has no conclusive answer, one way or the other.

Any thoughts on viability, or suggestions for making it a reality, would be much appreciated. Thanks in advance

BitFlow
  • 235
  • 1
  • 3
  • 7

2 Answers2

4

I think this blog post details almost exactly what you want to do.

They connect an analogue microphone to one of the ADC pins on the pico. The ADC then samples the raw voltage from the analogue microphone and places the digitised data (i.e. audio data) into a ring buffer. They then run a TensorFlow model on one of the RP2040 cores, which continuously extracts data from the ring buffer and processes it in (near) real time. So as long as the processing data through the TnesorFlow model can keep up with the audio data from the ADC then yes, it is very possible.

2

Yes, you can actually hook up an analog electret mic and use Pi Pico's inbuilt ADC to convert to Digital values. Then you need to convert those PCM values to suitable PDM values which can be fed into the feature provider.

Because it has DMA, no CPU cycles are wasted to access mic data from ADC. I read somewhere that we can sample up to 0.5 MHz using the built-in ADC !! a lot more than we need - 16khz.