The Adafruit I2S Mic - SPH0645 is a high-quality MEMS microphone with an I2S (Inter-IC Sound) digital interface. This microphone is ideal for projects that require audio input, such as voice recognition, audio recording, and sound analysis. It is commonly used in conjunction with microcontrollers like the Arduino UNO, Raspberry Pi, and others that support I2S.
Pin Number | Name | Description |
---|---|---|
1 | L/R | Left/Right channel select |
2 | GND | Ground connection |
3 | 3Vo | Output voltage (1.8V regulator output) |
4 | SCK | Serial Clock for I2S |
5 | WS | Word Select for I2S |
6 | SD | Serial Data output for I2S |
7 | VIN | Supply Voltage Input (1.6V to 3.6V) |
Power Connections:
VIN
pin to the 3.3V output on the Arduino UNO.GND
pin to a ground pin on the Arduino UNO.I2S Connections:
SCK
pin to the I2S clock pin on the Arduino (e.g., pin 13 on the Arduino UNO).WS
pin to the I2S word select pin on the Arduino (e.g., pin 10 on the Arduino UNO).SD
pin to the I2S data input pin on the Arduino (e.g., pin 11 on the Arduino UNO).Channel Selection:
L/R
pin can be connected to either GND
or VIN
to select the left or right channel, respectively.#include <I2S.h>
// Define the I2S pins for the Arduino UNO
const int i2s_sck = 13;
const int i2s_ws = 10;
const int i2s_sd = 11;
void setup() {
// Initialize I2S with the desired settings
I2S.begin(I2S_PHILIPS_MODE, i2s_sck, i2s_ws, i2s_sd);
}
void loop() {
// Read data from the microphone
long sample = I2S.read();
// Process the sample as needed
// ...
}
Q: Can I use this microphone with a 5V microcontroller?
A: Yes, but ensure that the VIN
pin is connected to a 3.3V output, as the microphone is not 5V tolerant.
Q: How can I change the output data rate? A: The output data rate can be adjusted in the I2S.begin() function in the Arduino code.
Q: Is it possible to use two SPH0645 microphones for stereo recording?
A: Yes, you can use two microphones by connecting them to separate I2S word select (WS) lines and configuring the L/R
pin accordingly for each microphone.