2

I am using the IO pins of the Pi to drive a speaker and a microphone. The speaker is easy to find, just a cheap one from Cool Components however I am finding it harder to find a suitable microphone.

It just needs to be able to receive sin waves made by the speakers. Any suggestions? It's for a project for school group.

Update

A telephone pickup seems like a cheap, sound receiving option.

BanksySan
  • 121
  • 1
  • 5
  • Awesome project. How do you play sound to the speaker using GPIO? – Piotr Kula Nov 10 '13 at 14:35
  • @ppumkin, nothing clever, just sending them high and low and using a transistor to source the current. – BanksySan Nov 10 '13 at 14:39
  • Cool! Here is something about microphone- maybe you saw it already http://raspberrypi.stackexchange.com/questions/4341/can-i-get-audio-input-through-the-gpio – Piotr Kula Nov 10 '13 at 14:43
  • Hi, there is a new Digital I2S MEMS Microphone Breakout: https://learn.adafruit.com/adafruit-i2s-mems-microphone-breakout that outputs digital audio data. No analog conversion required! – Vladislav Mar 03 '17 at 13:29
  • @Vladislav Great find. Cheers. – BanksySan Mar 03 '17 at 13:42
  • btw, I'm not sure, but probably it's possible to connect Bluetooth handsfree and use its microphone. It needs to be tested. – Vladislav Mar 03 '17 at 20:07
  • And there is a nice new Mini USB Microphone, that works via USB on Raspberry Pi: https://www.adafruit.com/products/3367 – Vladislav Mar 06 '17 at 13:00

1 Answers1

2

There is a slight problem with using an sine wave microphone because it is Analog signal. All the GPIO pins on the Pi are digital. So you will have to use a A2D (Analag to Digital) helper.

If there were some Analogue pins then you could use this Arduino project to help you out with the schematic.

enter image description here

In order to use a normal everyday microphone (from an old phone even) you will need to use a A2D processor like the MCP3008 . It gets more complicated though as you need to use SPI to read the values into something sensible. There is an answer this Exchange already talking about how to try and use a microphone with that chip.

The last resort is to buy a USB microphone or sound card instead. You buy one as cheap as £2.50 called the CM802 *REF or a more professional one from for about £20 called the Sound Blaster Play! *REF Once you plug that in you will get new audio input and output in the alsa-mixer utility.

How to use the MCP3008 without bitbanging and using hardware SPI of the Pi

Piotr Kula
  • 17,307
  • 6
  • 65
  • 104
  • It'll be a square wave really. Thanks for the advise on the CM802. I hadn't considered the digital\analogue problem. Do you really think there'll be a problem with a wave at a 50% duty cycle? – BanksySan Nov 10 '13 at 17:33
  • I am not enitrly sure to be honest but it could work if it is a sqaure wave. You might be able to read it as digital data on the GPIO pins but I am not sure what how you going to process that data. You will need the voltage to be 1.7v+ so the PIN reads high with a max of 3.3v - Then you also get the rising and falling edge criteria that are set within the GPIO but that is more important for data and specific BAUD. – Piotr Kula Nov 10 '13 at 18:07