***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.  Trying Blink rates 1kHz, 2kHx, to simulate 1kHz, 2kHz tones*

[![1k, 1k led blinking tones][1]][1]

[![1k, 2k tones 2][2]][2]

---

*4. / to continue, ...*

---

***References***

(1) [Adafruit PDM Microphone Breakout 1][3]

(2) [Adafruit PDM Microphone Breakout 2][4]

(3) [AliExpress Digital MP34DT01 Microphone Module Simple Pulse Density Modulation Output PDM Digital MEMS Microphone Module - HK$27][5]

[(4) TaoBao MP34DT01 MEMS PDM Microphone - ¥25][6]

[(5) 1000 Hz Test Tone - Sonic Electronix][7]

---

***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*

[PicoW blinking two LEDS][8]

---

*Appendix C - MEMS Mic, PicoW GPIO Eval Brd Setup*

[MEMS Mic, PicoW GPIO Eval Brd Setup][9]

---

  [1]: https://i.sstatic.net/mofeV.jpg
  [2]: https://i.sstatic.net/W1qsp.jpg
  [3]: https://www.adafruit.com/product/4346
  [4]: https://www.adafruit.com/product/2716?gclid=Cj0KCQiAtbqdBhDvARIsAGYnXBMlWo5Px8MPOsGz6mfOlcQTx8zKgi5kgOL-PCL5XbvoMZWBFNUa23UaAjYmEALw_wcB
  [5]: https://www.aliexpress.com/item/4001240664476.html?spm=a2g0o.productlist.main.11.391442abGc1Xty&algo_pvid=6a244fb2-b2ec-4056-9172-b6b7a664e1d8&algo_exp_id=6a244fb2-b2ec-4056-9172-b6b7a664e1d8-5&pdp_ext_f=%7B%22sku_id%22%3A%2210000015426511105%22%7D&pdp_npi=2%40dis%21HKD%2133.27%2126.32%21%21%21%21%21%40212248ba16725455499866162d0736%2110000015426511105%21sea&curPageLogUid=REzyejBWMWnE
  [6]: https://item.taobao.com/item.htm?_u=13thdsb1b52&id=626041686368
  [7]: https://www.youtube.com/watch?v=TbPh0pmNjo8
  [8]: https://youtu.be/SlbA8wIEvJY
  [9]: https://i.sstatic.net/ytR6Z.jpg