Question
How can PicoW read MEMS digital microphone output?
Answer
Introduction
1. Overview.
We can connect the MEMS microphone output pin to a PicoW GPIO pin and read signal, into a list for later processing.
2. Simulation
For prototyping, we can simulate the microphone output signal as a GPIO output pin connected blinking LED, and use another GPIO input pin to read the blinking LED pin.
3. / to continue, ...
References
(1) Adafruit PDM Microphone Breakout 1
(2) Adafruit PDM Microphone Breakout 2
(4) TaoBao MP34DT01 MEMS PDM Microphone - ¥25
(5) 1000 Hz Test Tone - Sonic Electronix
Appendices
Appendix A - MicroPython program blinking two LEDs simulating two MEMS digital microphone output signals
# Pico W Blink Two LEDs - tlfong01 2023jan01hkt1941
# *** Modules ***
import machine
from machine import Pin, Timer
# *** Configuration***
redLed = Pin(0, Pin.OUT)
greenLed = Pin(1, Pin.OUT)
redFreq = 2
greenFreq = 4
redTimer = Timer()
greenTimer = Timer()
# *** Callbacks ***
def blinkRedLed(dummy):
redLed.toggle()
return
def blinkGreenLed(dummy):
greenLed.toggle()
return
# *** Main ***
redTimer.init(freq = redFreq, mode = Timer.PERIODIC, callback = blinkRedLed)
greenTimer.init(freq = greenFreq, mode = Timer.PERIODIC, callback = blinkGreenLed)
# *** End of program ***
Appendix B - Blinking LEDs Video