Earlier this year, I was doing audio experiments with Machine Learning (ML) on the Raspberry Pi, and was looking for a compact USB microphone. The one which is commonly available is shown below.
While it was convenient to plug this in and access it from Python using *pyaudio*, the sound quality from this mic was terrible. Extremely noisy with poor (distance) sensitivity.
Ultimately I completed my audio recognition project using an I2S microphone which had a much better audio quality.
But I kept thinking about this problem, and did some research on I2S to USB bridge ICs. I found a couple of ICs like the Si Labs CP2615, but they looked obsolete. I also looked at the Cypress FX2 series with I2S support, and that seemed like a possible option, provided I was willing to put in a fair amount of work.
Recently, I've been working with the Raspberry Pi Pico. I've been dazzled with the RP2040 - especially with the PIO and the documentation and software support provided by the company. The Pico uses TinyUSB which has audio support, which got me thinking - surely someone must have thought of making a USB mic with this? And sure enough, Sandeep Mistry has done just that, with his Microphone Library for Pico open source project. So I already had firmware for my project. Now I just needed to make the hardware. Thus the idea of **Mico** was born.
I wanted a compact design for the mic, but I knew it was difficult to make it as small as the noisy mic shown above, due to the size of the RP2040 chip and mechanical design considerations. So I opted for a simple design with a reliable USB Type-A plug. I initially toyed with the idea of making the USB connector as part of the PCB, but that meant a thicker PCB and higher costs, so I dropped the idea. I also added an LED to the board for ease of testing.
The RP2040 needs very few extra components to get going, so Mico has a simple schematic.
I did some research on PDM microphones and chose MP23DB01HPTR which seems to have a good range. I chose a bottom-ported once because I wanted the top side of Mico to be bare for the title and logo.
Here's the PCB design.
I adapted the firmware for Mico from Sandeep Mistry's project mentioned earlier. The only minor addition I did is to add a PIO based blinky program and change some description strings.
# In Action
Here's Mico in action:
Here’s a comparison of the noisy mic and Mico in Audacity on Windows 10, with both recordings from the same distance.
You can see how low the sensitivity is for the first mic. Now let’s normalize the audio.
You can see the high level of noise in the first mic. The contrast tool in Audacity shows about 36 dB RMS foreground/background separation for Mico vs. 21 dB RMS for the other mic.
The audio quality from Mico is quite good, so I am very happy with this project.
This was a very quick project, and I was very happy that the PCB worked in the very first run. This project also reaffirmed my faith in Open Source projects. I could build on top of prior work, and in turn, I am open sourcing Mico so others can learn and adapt it for their projects.
I am grateful to Sivaprakash. S for the PCB design assembly of the Mico prototypes. I also thank Sandeep Mistry for open sourcing his RP2040 PDM microphone project, without which this project would have never taken off.
Mico is an Open Source Hardware Project. You can download design files and code for Mico from my github repo below:
When you have it set up, send me a link, and I will donate a little. I would like to have a few of these, but set up to record to permanent memory independently -- for a microphone array project. But I guess I will have to wait. Once a crowdfund gets started, then many people want the product(s) and everyone has to wait. Often the demand is so high, and the money rolls in, the people lose focus and the whole thing fails. You have to treat it like an investment and a corporation - make sure to incorporate, have a lawyer, accountant, general manager and board of directors/advisors. Run it like a standard company, and the paperwork is easier, the headaches many, but manageable. Starting something is hard, but after a few years, it should settle down. Piecemeal it, and it will stretch out forever.
I think I am just going to use Raspberry Pi, Intel and AMD systems and just buy microphones. My only issue is getting good microphones that automatically record with time stamps and careful management - so I can use sets of them for algorithm development and applications. I am only 73 now, I should not feel so old and tired. But all I want to do is finish a few problems I have read about and experimented with for the last 55 years. Sensor arrays is one. Beautiful data-intensive and statistical problem. Elegant, with careful effort.
I better get going. I figured out how to get a PCB made (mostly) and I have to learn how to make a Gerber file, Bill of Materials for them in their format. And force myself to solder, or pay someone, if I can afford it.