By now many hobbysts probably know how to convert a laptop webcam into a portable usb webcam. While this alone is pretty good, you may notice some of these modules have additional pins for microphone. Older modules seem to route these directly to the microphone input, but newer ones are connected to a MEMS mic with a digital output signal.
No one online seemed to have dissected the function of these microphones and there didn't seem to be information on how to use them. While I doubt I would be able to find a solution without using a mcu or DSP, I was still curious about their operation.
Research
The output on these microphones would have a 3.3v power, Data, Clock and Ground. Based on these pinouts it seemed the possible protocols they could be using would be either I²S (Inter-IC sound), PCM (Pulse Code Modulation) or PDM (Pulse Density Modulation).
I²S
PCM
PDM
PDM info PDM seems to be very similar to PWM in that it uses a 1-bit stream to represent an anolog signal
Testing
The pictures below show a few webcams I have on hand.
The leftmost one could likely be using PDM or I²S since it has a M_DET pin (for distinguishing LR?). I'll be doing my test on the rightmost one. Powering the microphone, I fed it a clock and played a 30kHz noise. At first there was just noise from the data line until the clock reached ~25kHz, then square waves appeared! At this point I was just glad it was working! On initialization, I always get a long high signal followed by some form of data.
Zooming out, the oscilloscope shows what seems like data followed by breaks inbetween.
These results alone indicate its definately not using PDM, since there was no clear modulation output.
While I'm still curious about converting the signal to actual data (I²S), it's likely that I'll need a DSP or SoC that can analyze the data at the 2MHz range, of which I don't have, I'll have to shelf this project until I obtain something like the STM32 or other faster processors.
References
-All you need to know about I2S
-Interfacing PDM digital microphones using STM32 MCUs and MPUs
- Reading PDM data @ 2MHz with Raspberry Pi + pigpio (Python)
