README.md 2.7 KB

esp32-transmit-i2s

This repository contains a small program for the ESP32 series of microcontrollers which takes one channel of PCM audio Data via I2S and transmits it to a computer running the tcp-pcm-receiver software. It was initially developed to be used with a PCM1808 ADC and a PLL1708 clock generator. If you want to use another clock source or ADC, you might need to slightly adjust the code.

Getting started

Before compiling the program, you should set both the wifi configuration and the general configuration. For the general configuration, an example is provided in the header file main/configuration.h. You may adjust the sample rate, host IP address and port to your needs. The supported sampling rates are 8000, 16000, 32000, 44100 or 48000 Hz.

The wifi configuration is read from the header file main/wifi_credentials.h which you need to create first. The relevant preprocessor constants to define here are WIFI_AP and WIFI_WPA_KEY and are used as connection parameters to establish a connection to your wifi access point.

After everything is set up, the program can be compiled with the make command and be flashed to the microcontroller by calling the flash target.

Hardware setup

Connect the following pins of the ESP32 to the other components:

  • PCM1808:
    • MD1 to GPIO-Pin 16
    • MD0 to GPIO-Pin 17
    • FMT to GPIO-Pin 23
    • DATA to GPIO-Pin 27
    • BCK to GPIO-Pin 26
    • WS/LRCK to GPIO-Pin 25
  • PLL1708:
    • MD to GPIO-Pin 18
    • MC to GPIO-Pin 19
    • MS to GPIO-Pin 21
    • CSEL to GPIO-Pin 22

If your MCU-board contains a voltage regulator, you may use this one for the other components or alternatively use an external power supply. The microphone must be connected to the first analog input of the ADC.

Prerequisites

To compile and flash this program, ESP-IDF is required as well as the toolchain for the ESP32. Please make sure that the environment variable IDF_PATH points to the correct directory of your installation and refer to their web site for full instructions on how to set it up properly. The software has been developed and verified with ESP-IDF version 3.3.1. Later versions may or may not work.

Authors

  • Helmut Pozimski - Initial work - Hoshpak

License

This project is licensed under the GNU General Public License, Version 2.