Skip to content

Capture audio from a microphone on your Raspberry Pi Pico or any RP2040 based board. 🎤

License

Notifications You must be signed in to change notification settings

dattran-itrvn/microphone-library-for-pico

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Microphone Library for Pico

Capture audio from a microphone on your Raspberry Pi Pico or any RP2040 based board. 🎤

Hardware

Default Pinout

I2S Microphone

Raspberry Pi Pico / RP2040 Analog Microphone
3.3V VCC
GND GND
GPIO 2 SCK
GPIO 3 WS
GPIO 6 SD
GND L/R

Analog Microphone

Raspberry Pi Pico / RP2040 Analog Microphone
3.3V VCC
GND GND
GPIO 26 OUT

PDM Microphone

Raspberry Pi Pico / RP2040 PDM Microphone
3.3V VCC
GND GND
GND SEL
GPIO 2 DAT
GPIO 3 CLK

GPIO pins are configurable in examples or API.

Examples

Git Examples about microphone

Set up Pico SDK

Set up the Pico C/C++ SDK

  1. Set PICO_SDK_PATH

    export PICO_SDK_PATH=/path/to/pico-sdk
  2. Create build dir, run cmake and make:

    mkdir build
    cd build
    cmake .. -DPICO_BOARD=pico
    make
    
  3. Copy example .uf2 to Pico when in BOOT mode.

License

Apache-2.0 License

Acknowledgements

- Mic Analog or Mic PDM

The OpenPDM2PCM library is used to filter raw PDM data into PCM. The TinyUSB library is used in the usb_microphone example.


- Mic I2S

Get data raw using I2S protocol and using algorithm fill buffer to decode audio.

Buffer App = Buffer Ring / 4 = Buffer DMA / 8.

To record data, using [TinyUSB](GitHub - hathach/tinyusb: An open source cross-platform USB stack for embedded system) library is used in the usb_microphone example. Buffer output <= 32 bytes <=> 256 bytes in DMA buffer

Using [Audacity software](Download | Audacity ® get audio output


About

Capture audio from a microphone on your Raspberry Pi Pico or any RP2040 based board. 🎤

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 92.3%
  • CMake 7.7%