The Mico RP2040 Microphone Is Ideal for Machine Learning Applications

Add high-quality audio to any USB-capable host.

James Lewis
2 years agoMachine Learning & AI

Reliably capturing audio for machine learning applications demands a clear microphone. While inexpensive USB microphones are available, one embedded systems programmer found those mics had too much broadband noise. So, Mahesh Venkitachalam leveraged an open source software library and built Mico, a PDM-to-USB microphone powered by the Raspberry Pi RP2040 microcontroller.

Mico is slightly wider and twice the length of a USB-A connector. The PCB is just large enough to hold the RP2040 and its support components, along with a surface mount PDM microphone.

Venkitachalam chose an STMicroelectronics MP23DB01HPTR Pulse Density Modulation (PDM) microphone. These microphone types have replaced I2S-based mics in mobile devices because they are small and only require a few IO pins. For example, this one from ST only needs two pins for basic operation: the clock and the PDM data.

If you look at the RP2040's datasheet or pinout, you might notice "PDM pins" are missing. Venkitachalam picked the RP2040 because of its programmable IO (PIO) modules.

The RP2040's PIO is a small state machine running independently of the dual Arm Cortex-M0+ CPUs. Each PIO module can have up to 32 instructions from a handful of assembly-like opcodes that manage the IO pins. The result is a flexible GPIO structure that can interface with many protocols without having dedicated hardware.

Mico uses an open-source Pi Pico (RP2040) Microphone Library to drive the PIO module. It interfaces with PDM microphones. Since the PIO handles the IO, the C-code running on the Arm cores can process the audio information. One minor change Venkitachalam did to that code was adding an LED for activity.

The RP2040 appears to the host as a USB audio device. This design should allow Mico to work with any application that can access standard devices.

Micro Demo Video

If you want to make a Mico, check out this GitHub repository. It has the code, KiCad design files, and compiled firmware. There are also some additional details on this electronut.in a blog post.

James Lewis
Fan of making things that blink, fly, or beep. Host on element14 Presents, baldengineer.com, AddOhms, and KN6FGY.
Latest articles
Sponsored articles
Related articles
Latest articles
Read more
Related articles