Picture of Arduino Audio Input
Send sound into your Arduino.  This Instructable will show you how to prepare audio so that it can be sampled and processed by an Arduino to make sound responsive projects and audio effects.  (This article is a companion to another Instructable I've written about building an audio output circuit for an Arduino, find that here)

Some ideas that come to mind include:

beat detection- trigger lighting effects, build a set of turntables that beat match themselves, or make a robot that dances along with the music you play for it
amplitude detection- make a simple vu meter with LEDS
frequency analysis- you could make a project that reacts to different frequencies in different ways, recognizes certain melodies, turns audio into MIDI data, or translates incoming frequencies into square waves with the tone() library
digital effects boxes/digital signal processing- check out what I did with my vocal effects box (all processing done with Arduino), lots of possibilities here: pitch bending, distortion, sampling, delay, reverb, granular synthesis, mixing, and much more...  I've provided code in this Instructable that lets you sample at up to 38.5kHz.  Here is another instructable describing how to set up a simple audio out circuit with Arduino.
digital recorder- with the addition of an SD card of course (the Arduino has very limited memory by itself), this opens up the possibility of looping large samples and doing lots of other digital manipulations to pieces of stored audio  The circuits and code provided here are compatible with SD card shields that communicate via SPI.
graphical representations of sound- Arduino oscilloscope/visualizer

Feel free to use any of the info in this Instructable to put together an amazing project for the DIY Audio Contest!  We're giving away an HDTV, some DSLR cameras, and tons of other great stuff!  The contest closes Nov 26.

Parts list:
(x1) Microphone Radioshack 33-3038
(x1) TL072 Digikey 296-14997-5-ND or TL082 Digikey 296-1780-5-ND (TL081/TL071 are fine too)  I used a tl082 in my examples
(x2) 9V battery
(x2) 9V battery snap connector Radioshack 270-324
(x1) mono audio jack 1/4" Radioshack 274-340  or Radioshack 274-252 or 1/8" Radioshack 274-333 or Radioshack 274-251
(x1) LED Digikey C513A-WSN-CV0Y0151-ND
(x1) 10kOhm potentiometer linear Digikey 987-1301-ND
(x3) 100kOhm 1/4watt resistors Digikey CF14JT100KCT-ND
(x1) 10uF electrolytic capacitor Digikey P5134-ND
(x1) 47nF ceramic capacitor Digikey P4307-ND
(x1) Arduino Uno (Duemilanove is fine too) Sparkfun DEV-09950

Additional Materials:
22 gauge wire
1-40 of 228Next »
nateclaflin11 days ago

Hello, great tutorial, question regarding the audio output portion, i have built the R2R ladder in your other tutorial and upon hooking it up, i notice that the audio coming out is +/- about 100mv for some reason (the input i have verified with my oscilloscope at 0-5v) but the code for both the 10 and 40k processing output the audio to the ladder at a significantly lower voltage, anyone else have this problem? thanks in advance

asubaşı2 years ago
What does the 47nF capacitor do?

This 47nF capacitor is called a bypass capacitor, its role is to filter out to ground undesirable AC noise that is inherent to any circuit. In this case it is important to have it here so that this noise is no mixed with the input signal. This page gives a good description of what they are and how they fit in a circuit: http://www.seattlerobotics.org/encoder/jun97/basics.html

I enjoyed reading this instructable, as I just today experienced the effect of a missing DC offset with my mic input to my Arduino. Great work!
However, I also stumbled over the AC bypass cap: Isn't 47nF an order of magnitude too large for audio signals in this case? If I am not completely wrong, the bypass cap forms a low pass with the 50k impedance of the voltage divider (again parallel to the Arduino's input impedance which should be negligible here). The 3dB point of such an LPF is ~68Hz. Wouldn't it be better to take a value in like 220pF or even smaller? That would increase the 3dB point to be higher than 10kHz at least.
I am asking this not to be pedantic, but I am just still learning basic electronics and therefore try to analyse building blocks like RC filters when I come across them. It could be that I made a fundamental mistake here, something that renders my result completely wrong. So I would be really happy, if someone could explain to me, if and why I am wrong! :)

there is still noise in my input. how do i fix it? as you said the capacitor function to filter the noise. but mine is still unstable

amandaghassaei (author)  asubaşı1 year ago
helps remove noise in the input signal
Mutahar Shami2 months ago

Hay amanda

Great instructable. I would like to seek your help for taking this one step further. I am working on a project that carries out some audio processing from a mic and another audio input at the same time and outputs them to two separate DACs, so i would need to use two analog pins (say A0 and A1 for mic input and the other audio input respectively), and use two of the arduino ports(say D and B) as the DAC. Your code for using the interrupts on pin A0 was difficult for me to understand how I could use the same thing for pin A1. which part of the code in the setup() that specifies which pin to sample from.

Ninjawolf03 months ago

Hey Amanda, I haven't yet had time to go through all of the comments so I apologize if you have already answered this.

I've done everything in your instructable and it works fantastically, thank you for such a detailed walk through, it definitely helped. What I'm not trying to do is manipulate a LED's with certain audio frequencies and I was wondering if you know how I could go about doing this. I am trying to make three output lines reacting with low, mid, and high frequencies. Should I use byte reading and select a range for each and depending on the byte data, it determines which pins are output?

Do you mean you want to have an LED to indicate high, medium and low frequency volumes? It wasn't too clear from your comment. If you want to do that, you need to run a FFT (Fast Fourier Transform) on the incoming signal, which lets you see the incoming frequencies, and then average the frequency bands you want to use as 'high', 'medium', and 'low'.

I think these could help you a lot:



junior70093 months ago

A simple way to use only one 9 volts bat:


nafeesa14 months ago


my question may sound dumb but can you please let me know where to connect the probes of oscilloscope to get the figure 1 in step 5(simple analog input) ?

and am i supposed to enter the following code to get the results of figure 1 step 5?

int incomingAudio;

void setup(){

for (byte i=0;i<8;i++){

pinMode(i,OUTPUT);//set digital pins 0-7 as outputs (DAC)



void loop(){

incomingAudio = analogRead(A0);//read voltage at A0

incomingAudio = (incomingAudio+1)/4 - 1;//scale from 10 bit (0-1023) to 8 bit (0-255)

if (incomingAudio<0){//deal with negative numbers

incomingAudio = 0;


PORTD = incomingAudio;


neckos4 months ago

the frequency appeared on my serial monitor is kind of unstable. how to solve this? arduino still get the measurement even if i don't connect with the mic. can someone help me?

crogshockey5 months ago

Hi! Is it possible to replace the microphone with piezo pulse? right now, i'm doing sthetoscope and want to collect sound from the lung. Is it possible to do so? ty

ohmgane3sha.5 months ago

Thanks for this instructable. I've managed to get the sampling rate up to 153.8ksps with a prescaler of 8 (16Mhz / (13 * 8)). Any lower and the reading become unreliable.

joed.sara6 months ago

Hi, can i use this on my guitar tuner project

for acoustic guitar. TY

rjtsh joed.sara6 months ago

i am also having problem using wire in accoustic guitar. Do you know the solution ?

TheTwim7 months ago

Hi all I have written a post on my blog to discuss the same topic just focusing on achieving higher ADC sampling rates.

Hope you find it useful.

vazerick made it!7 months ago

Amanda, thanks a lot for
sharing your knowledge, i learned A LOT from this project, how to design using a
standalone microcontroller (without using an arduino board), how to how to process
the signal, how to design a PCB in altium designer, and finally how to send a
PCB to a fab house, it took me around 2-3 weeks to understand all the perfectly
clear explained details in both your entry’s plus the time to make it happen, i could have done it in a breadboard but, wheres the fun in that?! I finally did it thanks to you, along with my 1stmanufactured PCB

and it works perfectly fine, thanks a a lot Amanda

smitadriaan made it!9 months ago

Very useful instructable thanks! Got it working pretty quickly. I decided to try and implement an auto gain adjust by replacing the 10k pot with a digital SPI pot (MCP41010-I/P-ND) and it kind of works but I am seeing a strange artificial clipping at some DC bias value. The SPI pot is powered by the Vcc and Gnd from the Adruino. Replacing the SPI pot with manual one set at the same value as the SPI pot gives a perfect full audio wave. I was testing with a 1KHz audio tone.

Photo Nov 17, 11 44 02 PM.jpg

what are you using fro an oscilloscope?

You may be exceeding the max current of the MCP41xxx at wiper extremes, though it's hard to speculate. At any rate you could try substituting a variable-gain (VGA) op-amp like an LMH6505. This wouldn't be directly SPI controllable like the MCP, but you can tie the gain input pin on the 6505 to an Arduino analog out pin to control gain programatically.

Thanks, ended up using Programmable Gain Amp from microchip with SPI interface. MCP6S22.

Hi, I am trying to implement Automatic Gain Controller using Ardunio.

Have you implemented your "Auto Gain Adjust" ? Can you please send me the documents or necessary instructions to make this successful asap.

My mail ID: kuet0909011@hotmail.com

Theedgeofrich8 months ago

I apologize for being a newbie! First, this is a great tutorial.

I have a newbie question about voltage. If I'm running off a straight 9volt wall wart (with line condition) will that be enough and do I need to change the circuit at all?

Still don't understand the. +- 9 volt but I'm researching that!

gkzsolt8 months ago

Hi Amanda,

Many thanks for this instructable.

What commands should I use to get the full 10 bits from ADC? I understand that it takes twice as much to read, I would be happy with a sample rate of 16 KHz. The analogRead() would be too slow, as I understand, 8 KHz is not enough.

yieldlymph9 months ago

Sorry, forgot to say before, my query is regarding the 40 (38) kHz configuration.

ybaggi10 months ago

How far don CAN i scale the clock and still use the interrupt?

Can I sample at 10k?

ybaggi10 months ago

How far don CAN i scale the clock and still use the interrupt?

Can I sample at 10k?

ChristopherH111 months ago

Hi Amanda,

First of all, thank you for writing such a detailed instructable.

If you have time and still monitor this thread, I would quite like to understand what is actually going on in the setup code and was wondering how you came up with this solution, how did you approach the problem and did you acquire all of the information you needed for configuring the uno chip from the datasheet alone or did you use multiple sources?

Thanks once again.

Sorry, forgot to say before, my query is regarding the 40 (38) kHz configuration.


mkssnwbrd11 months ago

I am working on a similar project but can't seem to figure out how to write to an SD card fast enough, could you share your SD card code as well? I have been using the SD.h library, but it is just too slow for audio.

pierattilio12 months ago

Hi Amanda, good job for this instructable :D I would know if i can use a OPA2134PA instead of the tl072, and if yes do I have to change something of important? (i'm afraid about the amplificatiopn gain, I don't wanto to burn some arduino pin :) ). Thanks a lot

roc_931 year ago

hi Amanda

Thats a great tutorial :)

Is there a possibility to use only one battery/ power supply instead of the two 9v batterys ?

pmenghani1 year ago

You have a Arduino Audio Output instructable as well....i just wanted to ask if the bits that i sent using that circuit ,instead of connecting it to a speaker i connected to this circuit,can be identified using this circuit...can i use LM358 as an OPAMP

pmenghani1 year ago

You have a Arduino Audio Output instructable as well....i just wanted to ask if the bits that i sent using that circuit ,instead of connecting it to a speaker i connected to this circuit,can be identified using this circuit...can i use LM358 as an OPAMP

when i print the incomingAudio value, i get fluctuations around 512, but when i adjust the potentiometer nothing happens. i have checked the diagram many times, and even have the same ground connections and Vin connection. have i missed something in the wiring? newbie here : )

Hey, I have the same problem, did you find a solution at all?

amandaghassaei (author)  luis_cordova2 years ago
the print function might not be fast enough to give you a lot of information about what is going on. do you have an oscilloscope?
xavierm11 year ago

hola amigo, para monitorear la salida de audio de arduino que pines usas, leo que dice el puerto D,podrias explicarme ,

LMario1 year ago

Instead of the microphone input can I use as input the signal generated by the pickup of a guitar?

1-40 of 228Next »