Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

ESP32-S3 and INMP441 I2S Microphone Audio Data Logger

View and Edit Project In Cirkit DesignerImage of ESP32-S3 and INMP441 I2S Microphone Audio Data Logger

Circuit Documentation

Summary

This document provides a detailed overview of a circuit that includes an ESP32-S3-DevKitC-1-N8R2 microcontroller and an INMP441 microphone. The ESP32 reads audio data from the INMP441 microphone using the I2S protocol and prints the audio data to the serial monitor.

Component List

ESP32-S3-DevKitC-1-N8R2

INMP441 FRONT MIC

Wiring Details

ESP32-S3-DevKitC-1-N8R2

INMP441 FRONT MIC

Code Documentation

/*
 * This Arduino Sketch is for an ESP32-S3-DevKitC-1-N8R2 connected to an INMP441
 * microphone. The ESP32 reads audio data from the INMP441 microphone using I2S
 * protocol and prints the audio data to the serial monitor.
 */

#include <Wire.h>
#include <I2S.h>

// I2S pins
#define I2S_WS 13
#define I2S_SCK 14
#define I2S_SD 12

void setup() {
  // Initialize serial communication
  Serial.begin(115200);
  while (!Serial);
  Serial.println("I2S Microphone Test");

  // Initialize I2S
  if (!I2S.begin(I2S_PHILIPS_MODE, 16000, 32)) {
    Serial.println("Failed to initialize I2S!");
    while (1);
  }

  // Configure I2S pins
  I2S.setPins(I2S_SCK, I2S_WS, I2S_SD);
}

void loop() {
  int32_t sample = 0;
  size_t bytesRead = I2S.read((uint8_t *)&sample, sizeof(sample));

  if (bytesRead > 0) {
    Serial.println(sample);
  }
}

Code Explanation