5 ms·
Mico: A PDM to USB Microphone Based on the Raspberry Pi RP2040
- severino 5y agoI found the article, and the linked one, about audio recognition on a Raspberry using ML, very interesting. Now, if only you could buy these microphones assembled... :-)
- nmstoker 5y agoYes, I'd love something simple like this that is cheap, you plug in and it "just works" without any faffing. Microphones on computers can be such a source of pain - maybe not quite such a nightmare as printers, but it seems like you can never get them to work reliably for any period of time. I'd be willing to pay in an instant if I knew it would save me the hassle!
- marcodiego 5y agoPossible interesting fun project: voice recognition on a USB device that emulates a keyboard that types what it hears.
- linsomniac 5y agoEarlier this year I got a ReSpeaker mic for video conferencing, and it's been working great! I did have to upload the latest firmware once I got it. I then combined it with NoiseTorch for a basically perfect video chatting experience. NoiseTorch detects speech and mutes the mic when you aren't speaking. I had tried Hushboard, which mutes the mic when you are typing, but sometimes I talk when I type. ReSpeaker is a microphone array, and it has a speaker output and can do noise cancelling on the mic from what is sent to the speaker. It was about $60. https://www.seeedstudio.com/ReSpeaker-USB-Mic-Array-p-4247.html https://www.seeedstudio.com/ReSpeaker-USB-Mic-Array-p-4247.h... https://github.com/lawl/NoiseTorch https://github.com/lawl/NoiseTorch https://www.kryogenix.org/code/hushboard/ https://www.kryogenix.org/code/hushboard/
- deleted 5y ago[deleted]
- stavros 5y agoHmm, why use the RP2040 over something like an ESP8266? The author mentions a few advantages, but can someone elaborate?
- deleted 5y ago[deleted]
- jepler 5y agoThe goal here is to have a USB peripheral, so that this little device can plug in on USB and identify to the host system as an audio source (likely without even needing to install a driver, since audio sources & sinks are part of the USB spec). The RP2040 has built-in support for being a USB peripheral in its hardware, plus good support in the SDK for it. By contrast, the ESP8266 is not designed to be a USB peripheral. Usually it's used with a USB-to-serial converter when you need to connect it to a host computer. This allows, well, serial transfers. It can't appear to a host computer as an audio source. There might be ways to do it, such as bit banged USB or custom drivers on the host computer that treat a serial port as an audio source, but by using a microcontroller with built in USB support, a lot of headaches can be avoided. If you are particularly "into" the Espressif ecosystem, the ESP32-S2 and ESP32-S3 microcontrollers both have native USB support which would make them potential candidates for a similar project.
- trasz 5y agoIt is possible to do USB on microcontrollers that lack hardware USB support: https://github.com/obdev/v-usb https://github.com/obdev/v-usb
- deleted 5y ago[deleted]
- HALtheWise 5y agoThis project makes heavy use of the RP2040 "Programmable IO" PIO subsystem to do precise timing of input signals without needing to keep the cpu in a busy loop. No other microcontroller has that same subsystem, although other microcontrollers have differently-designed systems that allow similar results. The audio library would need to be rewritten though.
- marcodiego 5y agoPDM: pulse-density modulation: https://en.wikipedia.org/wiki/Pulse-density_modulation https://en.wikipedia.org/wiki/Pulse-density_modulation
- tverbeure 5y agoI wrote a series of blog posts about how to convert a PDM signal to traditional PCM values: https://tomverbeure.github.io/2020/10/04/PDM-Microphones-and-Sigma-Delta-Conversion.html https://tomverbeure.github.io/2020/10/04/PDM-Microphones-and....
- diimdeep 5y agoInstead of Pi it could have been a dozen different IC, but interesting part in this kind of project is audio theory, and MEMS microphone performance. MEMS microphone used here is mp23db01hp https://www.st.com/en/mems-and-sensors/mp23db01hp.html https://www.st.com/en/mems-and-sensors/mp23db01hp.html and it looks like better than ICS 43434 that I stumbled on before https://invensense.tdk.com/wp-content/uploads/2016/02/DS-000069-ICS-43434-v1.2.pdf https://invensense.tdk.com/wp-content/uploads/2016/02/DS-000... For theory about how microphone works and performs interesting read is https://www.analog.com/en/analog-dialogue/articles/understanding-microphone-sensitivity.html https://www.analog.com/en/analog-dialogue/articles/understan...
- nyanpasu64 5y agoToday I learned that there are now MEMS microphones which rely on fabricated silicon, not conventional electrical coils or electrostatic/electrets/magnet pickups, to pickup sound waves.
- NavinF 5y agoI believe this is the most common type of microphone today. There’s just not enough space in devices like phones and smart watches for anything else. My SM7B is probably the only non-MEMS mic I own.
- m0lecules 5y ago64dB SNR is pretty standard these days for MEMS – you will pay a lot more to get up in the 70s. Good studio mics will be in the 80dB+ range. Here's the highest performing one today: https://www.digikey.com/en/products/detail/tdk-invensense/ICS-40730/8544631 https://www.digikey.com/en/products/detail/tdk-invensense/IC...
- danbr 5y agoNeat! I’m curious if one could design a usb type A plug/port that is reversible such that the PDM is always facing up. I know there are some flexible/thin pcb that allow for this, although not sure how robust that design is (otherwise I’d assume we’d never have to worry about rotating the USB cable three times before getting it right side up. Maybe I just described usb type C :))
- zbrozek 5y agoI think you've hit the nail on the head: just use the type-C connector. Bonus, it means the connector could be on the same side of the PCB as all the surface mount components and not impact insertion direction. If you need a type-A, good news, there's adapters for that.
- fortysixdegrees 5y agoInteresting. You would have to invert the voltage on D+ and D- when it's in backwards. Or flip the lines somehow. Nice little puzzle that one
- RF_Savage 5y agoOne could just have the contacts wired differently on the otherside of the board. The larger problem would be the contacts in the "backside" of the plug getting shorted by the USB connector shield. Outside of that it does sound doable. Maybe with a thin pcb and a USB-A shell it'd be doable...
- jrockway 5y agoWhy not just put two plugs on the board, one in each orientation (and put the mic and rp2040 in the middle)?
- robotbikes 5y agoSo how would someone go about purchasing this ? Would it require custom ordering the PCB ? Seems like a very cool way to make affordable cheap USB microphones.
- tverbeure 5y agoYes, you’d need to do exactly that. The PCBs can be ordered dirt cheap at Chinese shops like JCPCB. They are associated with LCSC, a cheap component supplier of Digikey, that also provides the RP2040 microcontroller (though currently out of stock, as expected with today’s supply chain.) They even provide cheap PCB assembly services.
- baybal2 5y agoJCPCB is not a PCB shop. They get the order, and then run to an actual PCB shop of their choosing.
- krasin 5y ago1) It's JLCPCB, not JCPCB: http://jlcpcb.com/ http://jlcpcb.com/ 2) What is the source of this information? (honest question)
- baybal2 5y ago2. Worked in electronics. Been in, and out of Shenzhen since 2009
- krasin 5y agoGot it, thanks. Btw, have you followed their SMT Assembly service offering? I've assembled 40+ designs with them this year, and it does seem like they do it on their own instead of delegating. Nobody comes close to their prices and assembly time.
- 5y ago
- baybal2 5y agoFYI, there are already microphones with PCM, I2S, or even complete SoundWire protocol support.
- mastax 5y agoIs there a difference between pulse-density modulation and sigma-delta modulation? I've seen the sigma-delta hardware in STM32s and wanted a project to use them.
- mbell 5y agoI would say that pulse-density modulation is more of an abstract concept and sigma-delta is a particular implementation. Or in other words, sigma-delta is a one technique used to produce a pulse-density modulation.
- karmicthreat 5y agoMy only complaint about the RP2040 is that it doesn't have an external SPI ram interface.
- R0b0t1 5y agoThat's usually a niche feature. Core IP and fabrication have become so cheap that it is preferred to get a Cortex-A part and real DRAM. What usecase do you have for larger memories on an embedded controller?
- kevin_thibedeau 5y agoQSPI memory is real DRAM without the profusion of pins, routing density, and signal integrity issues of traditional devices. Lots of memory poor micros can benefit from expandability. Running a network stack in conjunction with other app code on 100K is challenging. Throw in a few megabytes of expansion and it becomes a more manageable task.
- R0b0t1 5y agoSure, I meant ~DDR2/3 RAM. Implementation may be easier with QSPI but I have tried to use embedded core parts and had very bad times with the software when doing things you need the memory for, like graphics or network. Seems like a better use of time to reuse an existing design and put Linux on it so I'm not half-responsible for drivers. A cortex-a part with QSPI/octSPI interface would be nice. I vaguely remember something, but I can not find it again.
- karmicthreat 5y agoIt is, but running a 3.5" display would be nice. You could probably make something work within the ~200K on this part. Really I just want a better/competitor for the ESP32.
- th3h4mm3r 5y agoI've used the same microphone you used in your first experiment and yes... it sucks! Really happy to see now your project, I'm only wondering how to had one of that.