Masiar
Posts: 23
Joined: Wed Feb 06, 2013 9:32 am

Microphone Amplifier usage

Mon Mar 11, 2013 4:36 pm

Hi,
I'm a newbie in electrical stuff, so here I'm asking. I bought a Raspberry Pi as well as some sensors. I have also one of these: http://www.adafruit.com/products/1063. I noticed on adafruit there is a tutorial on how to use that microphone, but it seems they are using Arduino. My question is: can I use it on Raspberry Pi too? If yes, is there a tutorial on how to set it up? I don't want to burn my Pi! :-)

Masiar
Posts: 23
Joined: Wed Feb 06, 2013 9:32 am

Re: Microphone Amplifier usage

Tue Mar 12, 2013 10:26 am

Hi,
in the end I tried to build something. I connected VCC to 3v3, GND to ground and OUT to the pin GPIO17.
I tried, with a while True, to print the value of gpio.input(17) but apparently it is always one. Any ideas what's going on? Here is the full code:

Code: Select all

import RPi.GPIO as gpio
gpio.setmode(gpio.BCM)
gpio.setup(17, gpio.IN)

while True:
    input = gpio.input(17)
    print(input)

User avatar
Burngate
Posts: 6313
Joined: Thu Sep 29, 2011 4:34 pm
Location: Berkshire UK Tralfamadore
Contact: Website

Re: Microphone Amplifier usage

Tue Mar 12, 2013 11:08 am

The problem you have is that the output of the microphone is an analogue signal sitting on 1v6 or there-abouts.
The Pi's GPIO takes that 1v6 and reads it as a 1. Only if the sound is loud enough will the output go low enough for the Pi to see a 0, and even then you'll have to be lucky enough to catch the audio at the right time, during the negative part of the waveform rather than the positive part.

Masiar
Posts: 23
Joined: Wed Feb 06, 2013 9:32 am

Re: Microphone Amplifier usage

Tue Mar 12, 2013 12:38 pm

Hi, thanks for the answer! Is there a tutorial online how to wire the ADC? I'm really not familiar with that either, sorry. :roll:

Masiar
Posts: 23
Joined: Wed Feb 06, 2013 9:32 am

Re: Microphone Amplifier usage

Fri Mar 15, 2013 11:08 am

Sorry for the bump!
I would like to ask where can I buy an ADC and which one should I buy for my RPi!

Return to “Beginners”