Stufin
Home Quick Cart Profile

Raspberry Pi USB2.0 Mini Microphone

Buy Now on Stufin

Microphone Type

Digital, omnidirectional condenser microphone

Frequency Response

20 Hz to 20 kHz

Sensitivity

-40 dB 3 dB

Impedance

2.2 k

Signal-to-Noise Ratio80 dB

Power Requirements

5V, <100mA

Operating Temperature

0C to 50C

Storage Temperature

-20C to 70C

Dimensions

14mm (diameter) x 6mm (height)

Applications

The Raspberry Pi USB2.0 Mini Microphone is ideal for a variety of IoT projects and applications, including

Voice assistants and AI-powered devices

Audio-based home automation systems

IoT-enabled conferencing systems

Robotics and autonomous systems

Environmental monitoring and sensing applications

Education and prototyping projects

Conclusion

The Raspberry Pi USB2.0 Mini Microphone is a compact, versatile, and reliable audio input device that is specifically designed for use with Raspberry Pi boards. Its high-quality audio capabilities, low power consumption, and plug-and-play functionality make it an excellent choice for a wide range of IoT projects and applications.

Pin Configuration

  • Raspberry Pi USB2.0 Mini Microphone Pinout Guide
  • The Raspberry Pi USB2.0 Mini Microphone is a compact, plug-and-play audio input device designed for Raspberry Pi boards and other compatible systems. This guide provides a detailed explanation of each pin on the microphone, along with connection instructions.
  • Pinout Structure:
  • The Raspberry Pi USB2.0 Mini Microphone has a standard USB connector with 4 pins:
  • 1. VCC (Pin 1)
  • Function: Power supply
  • Description: Provides power to the microphone
  • Connection: Connect to a 5V power source (e.g., Raspberry Pi's USB port)
  • 2. D- (Pin 2)
  • Function: USB Data -
  • Description: Carries USB data transmission signal
  • Connection: Connect to the corresponding USB data - pin on the Raspberry Pi or other compatible device
  • 3. D+ (Pin 3)
  • Function: USB Data +
  • Description: Carries USB data reception signal
  • Connection: Connect to the corresponding USB data + pin on the Raspberry Pi or other compatible device
  • 4. GND (Pin 4)
  • Function: Ground
  • Description: Provides a ground reference for the microphone
  • Connection: Connect to a ground pin on the Raspberry Pi or other compatible device
  • Connection Instructions:
  • To connect the Raspberry Pi USB2.0 Mini Microphone to your Raspberry Pi board:
  • 1. Locate the USB ports on your Raspberry Pi board.
  • 2. Plug the USB connector of the microphone into one of the available USB ports.
  • 3. Ensure the microphone is securely connected to the Raspberry Pi board.
  • Important Notes:
  • Make sure to handle the microphone by the plastic casing to avoid damaging the sensitive electronic components.
  • Avoid touching the pins or the electrical components to prevent static electricity damage.
  • Connect the microphone to a powered USB port to ensure proper operation.
  • By following these pinout and connection instructions, you can successfully integrate the Raspberry Pi USB2.0 Mini Microphone with your Raspberry Pi project or other compatible applications.

Code Examples

Raspberry Pi USB2.0 Mini Microphone Documentation
Overview
The Raspberry Pi USB2.0 Mini Microphone is a compact, high-quality audio input device designed for use with Raspberry Pi single-board computers. This microphone module connects via USB and is compatible with Raspberry Pi OS, Windows, and macOS. It's ideal for a wide range of applications, including voice assistants, home automation, and audio recording projects.
Technical Specifications
USB 2.0 interface
 16-bit, 48 kHz audio recording
 Omnidirectional microphone capsule
 3.5mm microphone diameter
 Dimensions: 14mm x 10mm x 4mm
 Weight: 2g
 Operating voltage: 5V
 Current consumption: <100mA
Setting up the Microphone
To use the Raspberry Pi USB2.0 Mini Microphone, simply connect it to a free USB port on your Raspberry Pi. Make sure to install the necessary audio drivers and configure the microphone as the default audio input device.
Code Examples
### Example 1: Audio Recording with Python (Raspbian OS)
This example demonstrates how to use the microphone to record audio using Python on Raspbian OS:
```python
import pyaudio
import wave
# Open the microphone stream
FORMAT = pyaudio.paInt16
CHANNELS = 1
RATE = 48000
CHUNK = 1024
WAVE_OUTPUT_FILENAME = "output.wav"
audio = pyaudio.PyAudio()
stream = audio.open(format=FORMAT, channels=CHANNELS,
                    rate=RATE, input=True,
                    frames_per_buffer=CHUNK)
print("recording...")
frames = []
# Record audio for 5 seconds
for i in range(0, int(RATE / CHUNK  5)):
    data = stream.read(CHUNK)
    frames.append(data)
print("finished recording")
# Close the microphone stream
stream.stop_stream()
stream.close()
audio.terminate()
# Save the recorded audio to a WAV file
waveFile = wave.open(WAVE_OUTPUT_FILENAME, "wb")
waveFile.setnchannels(CHANNELS)
waveFile.setsampwidth(audio.get_sample_size(FORMAT))
waveFile.setframerate(RATE)
waveFile.writeframes(b"".join(frames))
waveFile.close()
```
### Example 2: Speech Recognition with Google Cloud Speech-to-Text (Python)
This example demonstrates how to use the microphone to capture audio and send it to the Google Cloud Speech-to-Text API for speech recognition:
```python
import pyaudio
import speech_recognition as sr
# Create a speech recognition object
r = sr.Recognizer()
# Open the microphone stream
with sr.Microphone() as source:
    print("Say something!")
    audio = r.record(source, duration=5)
# Send the audio to Google Cloud Speech-to-Text API
try:
    print("Google Cloud Speech-to-Text API result:")
    print(r.recognize_google_cloud(audio, language="en-US"))
except sr.UnknownValueError:
    print("Google Cloud Speech-to-Text API could not understand your audio")
except sr.RequestError as e:
    print("Error requesting Google Cloud Speech-to-Text API: {0}".format(e))
```
Note: Make sure to install the necessary Python libraries, including `pyaudio` and `speech_recognition`, using `pip` or your preferred package manager.
### Example 3: Real-time Audio Processing with ALSA (C++ - Raspbian OS)
This example demonstrates how to use the microphone to capture audio and process it in real-time using ALSA (Advanced Linux Sound Architecture) on Raspbian OS:
```c
#include <alsa/asoundlib.h>
#include <iostream>
int main() {
    // Open the microphone stream
    snd_pcm_t _capture_handle;
    snd_pcm_open(&capture_handle, "default", SND_PCM_STREAM_CAPTURE, 0);
    snd_pcm_set_format(capture_handle, SND_PCM_FORMAT_S16_LE);
    snd_pcm_set_channels(capture_handle, 1);
    snd_pcm_set_rate(capture_handle, 48000);
// Create a buffer to store the captured audio
    char buffer[1024];
// Start capturing audio
    snd_pcm_start(capture_handle);
while (true) {
        // Read audio from the microphone
        snd_pcm_readi(capture_handle, buffer, 1024);
// Process the captured audio (e.g., apply filters, detect voice activity)
        // ...
// Print the captured audio (for demonstration purposes)
        std::cout.write(buffer, 1024);
    }
// Close the microphone stream
    snd_pcm_close(capture_handle);
    return 0;
}
```
Note: Make sure to compile the code with the ALSA development package installed on your Raspberry Pi.
These examples demonstrate the basic usage of the Raspberry Pi USB2.0 Mini Microphone in various contexts. You can adapt and expand upon these examples to suit your specific project requirements.