Introduction: Arduino Vocal Effects Box

This Arduino-powered vocal effects box pitch shifts and distorts incoming audio signals to produce a wide variety of vocal effects. This project is my first experiment with real-time digital signal processing using Arduino. It samples an incoming microphone signal at a rate of about 40kHz, manipulates the audio digitally, and then outputs 8 bit audio at 40kHz. To minimize the amount of computation required by the Arduino, I used a technique called granular synthesis to manipulate the incoming audio signal. Essentially, as audio comes into the Arduino it gets cut up and stored as small (millisecond or microsecond sized) samples called "grains." These grains are then individually manipulated and played back; they may be lengthened or shortened, stretched or compressed, played back in reverse, copied several times, or mixed with other grains. You can hear a (somewhat creepy) audio sample from the effects box below:

Granular synthesis creates a unique type of distortion caused by discontinuities between individual grains in the outgoing signal. Sometimes this distortion creates an effect I can only describe as a "ripping" sound, other times it introduces new frequencies into the audio that were not present before. Here is an example by Aphex Twin, the granular synthesis is especially prominent in the bridge at around 3min in. Another example of granular synthesis, this time applied to vocals for pitch shifting and textural effects, is from Paul Lansky. My favorite thing to do with this effects box is to use subtle pitch shifting to achieve an androgynous vocal sound, I got the idea for the project after listening to copious amounts of Fever Ray this past winter, you can hear how she pitch shifts her voice to sound somewhat masculine at times.


(1x) Arduino Uno REV 3 Radioshack 276-128
(7x) 10K Ohm 1/4-Watt Carbon Film Resistor (2 packages) Radioshack #271-1335
(9x) 20K Ohm 1/4-Watt Carbon Film Resistor (2 packages)
(1x) 1K Ohm 1/4-Watt Carbon Film Resistor Radioshack 271-1321
(1x) 50K-Ohm Linear-Taper Potentiometer Radioshack #271-1716
(1x) 10KOhm Audio Control Potentiometer with SPST Switch Radioshack #271-215 (this will be used to control volume and turn the device on/off)
(5x) 0.25" Knurled Knob Radioshack 274-424
(2x) 9V Alkaline Battery Radioshack #23-866
(2x) Heavy-Duty 9V Snap Connectors Radioshack #270-324
(1x) PC Board with Copper Radioshack #276-147
(1x) SPST PC-Mountable Submini Toggle Switch Radioshack #275-645
(2x) Male Header Pins Jameco 103393
(3x) 8 pin socket Radioshack 276-1995
(1x) TL082 Wide Dual JFET Input Op Amp Radioshack 276-1715
(3x) 100K Ohm 1/4-Watt Carbon Film Resistor (1 package) Radioshack 271-1347
(1x) 10uF electrolytic capacitor
(1x) 47nF capacitor
(3x) 0.1uf capacitor Radioshack 55047557
(2x) 1M-Ohm Linear Taper Potentiometer Radioshack 271-211
(1x) 1MOhm logarithmic potentiometer
(1x) 2kOhm 1/4-Watt Carbon Film Resistor
(1x) male header pins Jameco 103393
(1x) 10K-Ohm Linear-Taper Potentiometer Radioshack 271-1715
(1x) DPDT Flatted Metal Lever Toggle Switch Radioshack 275-636
(2x) 1/4" stereo jack Radioshack 274-141 or Radioshack 274-312
(2x) 5mm High-Brightness White LED (1 package) Radioshack 276-017
(2x) 100 ohm 1/4W 5% Carbon Film Resistor Radioshack 271-1311
(2x) TS922IN Dual Op Amp Digikey 497-3049-5-ND (one TS924 would also work, but they are not available on digikey at the moment)

Additional Materials:
22 Gauge Wire Radioshack #278-1224
Solder Radioshack #64-013
sand paper
wood glue
hot glue

Download Arduino IDE

Step 1: Schematic

I've broken the schematic into three parts so it is easier to understand.

The first schematic shows the audio out circuit. This project outputs audio through an 8 bit R2Rdigital to analog converter through Arduino digital pins 0-7.  This signal is sent through an amplifier, a low pass filter, and a volume control pot before being sent out to speakers.

The second schematic shows the mic input circuit.  The line in the from the mic is sent through an amplifier and a DC offset circuit before being sent into the Arduino via analog input pin A0.

The third schematic shows how all the controls of the effects box are connected to the Arduino.  There are two LED indicators in this project: one clipping indicator and one output indicator.  Three pots on the device control grain size, pitch, and wet/dry mix and a switch controls the direction of sample playback (forward or reverse).

Step 2: Header Pins

Solder header pins to your protoboard so that you can snap the arduino directly to the board.  Unfortunately the spacing between digital pins 7 and 8 on the arduino is not the standard 2.54mm, so I've found that it's best to try to avoid using these pins if possible (anolog pins can also be used as digital I/O).  If you have to use them, try finding long header pins which you can bend into shape (fig 4- from another project).

Step 3: DAC: Part 1

Solder eight 20kOhm resistors to arduino pins D0-D7 as shown in the images above.

Step 4: DAC: Part 2

Solder seven 10kOhm resistors in between each of the 20kOhm's you just soldered.  Add an additional 20kOhm resistor to the 20kOhm connected to arduino D0 (the bottom of the ladder).

Step 5: DAC: Part 3

Connect the other end of the 20kOhm reisistor to arduino ground

Step 6: Test DAC

Connect the output from the DAC up to an oscilloscope, be sure to connect ground as well.  Load the firmware below onto the Arduino.  The DAC should output a sine wave oscillating between 0 and 5V with a frequency of ~63Hz (see image above).  If you need help understanding how to use/read the oscilloscope check out this tutorial.
Some info about the code- basically what I've done here is set up a timer interrupt that increments the variable t at a frequency of 40kHz.  Once t reaches 627 it resets back to zero (this happens with a frequency of 40,000/628 = 63Hz).  Meanwhile, in the main loop the Arduino sends a value between 0 (00000000 in binary) and 255 (11111111 in binary) to digital pins 0 through 7 (PORTD).  It calculates this value with the following equation:


So as t increments from 0 to 627 the sine function moves through one complete cycle.  The value sent to PORTD is a sine wave with frequency 63Hz and amplitude 127, oscillating around 127.  The DAC translates this to a voltage between 0 and 5V, where a 0 sent to PORTD equals 0V and a 255 sent to PORTD equals 5V.

Step 7: 8 Pin Socket and Buffer

Solder an 8 pin socket to the breadboard.  Connect ground to pin 4, 5V to pin 8 and the signal from the DAC to pin3.  Solder pins 1 and 2 together (fig 2).  This puts the signal through a voltage follower.  The voltage follower acts as a buffer, protecting the output from the DAC from any loads that are put on it later in the circuit.

Step 8: Wire Up Pot

Connect three leads to a 10k exponential pot (labelled with an "A") as shown in fig 3.  Solder the red lead to pin 1, the green lead to pin 5, and the black lead to ground/pin 4.  Solder pins 6 and 7 together (fig 2).  This pot will adjust the amplitude of the signal- it is a volume control knob.  It does this by acting as a variable voltage divider.

Step 9: Second 8 Pin Socket

Solder a second 8 pin socket and connect ground to pin 4 and 5V to pin 8.

Step 10: Voltage Divider

Solder a 10kOhm resistor to pin 7 of the first TS922IN.  Connect a 2kOhm resistor in series with the 10kOhm resistor and connect the other end of the 2kOhm to ground.  This is another voltage divider- the purpose of this portion of the circuit is to scale the signal to 2000/(10000+2000) =1/6th its amplitude, I did this so that the max volume would not completely destroy my hearing.  Unlike the voltage divider I set up in the last step with the pot, this voltage divider does not change; it scales the amplitude of the signal permanently.  The scaled signal comes out from the junction between the two resistors.

If you are planning to send the output out as line level into another effects module or amplifier, then do not add this voltage divider.

Step 11: RC Low Pass Filter

The purpose of a low pass filter in this part of the circuit is to remove the digital artifacts from the output of the DAC without losing too much detail in the higher frequencies of the audio signal.
Nyquist's Theroum states that for a sampling rate of x Hz, the highest frequency that can be produced is x/2 Hz.  So if you have a sampling rate of 40kHz (standard for most audio), then the maximum frequency you can reproduce is 20kHz (the upper limit of the audible spectrum).
By using a low pass filter on the signal with a cutoff frequency of 20kHz, you can smooth out the "steps" in your waveform while keeping the overall shape of the waveform intact.  I used a simple RC flow pass filter to achieve this: a resistor and a capacitor in series to ground.  Connect the resistor to the incoming signal and the capacitor to ground, the signal from the junction between these two components will be low pass filtered.
You can calculate the values of the capacitor and resistor you need for a low pass filter according to the following equation:

cutoff frequency = 1/ (2*pi*R*C)

so for a cutoff frequency of 20,000Hz and 1kOhm resistor:

C =~ 8nF

Since 8nF capacitors are hard to come by I rounded up to 0.01uF.  This gives a cutoff frequency of about 16kHz.  You can mess around with different values and see what you like best, I tend to like heavier filtering bc it removes more unwanted noise.

Solder a 1kOhm resistor to the junction from the voltage divider from the last step (if you did not include the voltage divider, solder straight to pin 7).  Solder a 0.01uF capacitor in series with this resistor to ground.  Solder a wire from the junction between the capacitor and resistor to pin 5 of the second socket.

Step 12: More Buffering

In this step I wired the two op amps on the second chip as voltage followers and wired them in parallel so they could source twice the current.  As in step 7, this voltage follower acts as a buffer, protecting the incoming waveform from the load of the headphones which will eventually be attached to the output of the buffer.

Solder a wire between the two non-inveting inputs of the op amps (pins 5 and 3 of the second socket).  Solder another wire between the two outputs (pins 1 and 7 of the second socket).  On the underside of the board solder the inverting inputs to their outputs (fig 2).

Step 13: DC Offset

After all the voltage dividers, the signal coming out of the op amps oscillates between 0 to about 1V (or 0 to 5V if you did not include the voltage divider in step 10).  Before sending the signal out to speakers/headphones, it must be offset to oscillate around 0V.  This is called a DC offset, it is achieved by running the signal through a capacitor.

Solder the - end of a 100uF (or higher) capacitor to the output of the second op amp.  The signal coming from the + end of the capacitor will be DC offset to oscillated around 0V.

Step 14: Audio Jack

Unscrew the plastic case of the audio jack.  Solder a black wire (ground) to the longer lead, and wire a green wire (signal out) to the two shorter leads.  This jack is stereo, but the signal out of the Arduino is mono, so just wire the mono signal to both stereo outputs.

Use hot glue to add some structural support to these connections and prevent short circuits.  Solder the green wire to the + end of the 100uF capacitor and solder the black wire to ground.

Step 15: Microphone Circuit

Fig 2 shows the signal coming straight out of the microphone on an oscilloscope.  The signal is relatively weak, with an amplitude of only 200mV.  Notice how the signal oscillates around 0 volts- this is typical of audio signals.  Ideally, you want to have a signal with a max amplitude of 2.5V oscillating around 2.5V.  This way the signal is completely contained within 0-5V; the Arduino will be able to measure it with maximum resolution and no clipping.  In order to do this, the signal will need to be DC offset and amplified.  DC offset means changing the level that the wave oscillated around (the midpoint of the wave).  Amplification means increasing the amplitude (distance between the center point and max or min) of a signal.  Amplification also buffers the microphone element from any loads that you may put on it later in the circuit, which is a good thing because it prevents distortion.

Fig 3 shows the same microphone signal after amplification, you can see how the height of the peaks has increased so that the wave oscillates between -2.5 and 2.5 V (amplitude of 2.5V).  Fig 4 shows the signal after it has been DC offset; it still has an amplitude of 2.5V, but the center point is 2.5V instead of 0V, so the wave never drops down below 0V.  (Note- the slight change in shape between the signals in figure 3 and 4 is dues to changes in my voice between the two pics, it has nothing to do with the circuit).  The signal in fig 4 is ready to go to an Arduino analog input pin.

Step 16: Batteries

Two nine volt batteries will be needed to power the TL082.  The double pole double throw (DPDT) switch will act as a power switch to both batteries.  DPDT switches actually have two separate switches in them, but they are controlled by the same toggle mechanism (fig 1).  Wire the red ends of two battery snaps to one side (the same side) of each switch (figs 3 and 4).  Solder red wires to the middle leads of each switch (figs 5 and 6).  Use hot glue to secure the solder joints if necessary (fig 7).

Step 17: Amplifier Socket and Power

Solder an 8 pin socket onto the protoboard (fig 1).  As shown in the pin diagram for the TL082, +V connects to pin 8 and -V connects to pin 4.  Connect on of the red wires from the middle lead of the DPDT switch to pin 8.  Let's call the battery snap that is attached to this red lead snap #1.  Solder the black lead from snap #2 to pin 4 of the socket (figs 2 and 3).  Solder the black lead from snap #1 and the remaining red lead from the center pin of switch #2 together on the protoboard (figs 3 and 4), this is the center tap (0v) between the +9/-9V supply.  Solder this connection to arduino ground (fig 8).

Step 18: Microphone Input

Unscrew the plastic case from the 1/4" jack.  If you have a mono microphone, unclip the right lead (fig 2).  I also trimmed some of the metal from the larger lead- the ground lead (figs 5 and 6).  Solder a black wire to the ground lead and a green wire to the other lead.  Cover the leads of the jack with hot glue to prevent short circuiting or breakage.

Step 19: Non-inverting Amplifier: Part 1

Solder the wires from the 1/4" jack to the protoboard.  Solder the black wire to arduino ground and the green wire to pin 5 of the 8 pin socket.

Step 20: Non-inverting Amplifier: Part 1

Solder a 100K resistor between pins 6 and 7 of the 8 pin socket.

Step 21: Non-inverting Amplifier: Part 2

Solder two leads onto a potentiomer (shown in fig 1) so that it acts as a variable resistor.  Solder one side (doesn't matter which) to ground and the other side to pin 6 of the socket.  This pot will control the amplitude of the incoming microphone signal.

Step 22: DC Offset: Part 1

The DC offset circuit is comprised of two capacitors and a voltage divider.  Solder a 10uF electrolytic capacitor so that the + lead connects to pin 7 of the socket.

Step 23: DC Offset: Part 2

Solder a 47nF capacitor to the - end of the 10uF capacitor.  Connect the other side of the 47nF cap to ground.

Step 24: DC Offset: Part 3

Create a voltage divider between Arduino +5V and ground by wiring two 100kOhm resistors in series between 5V and ground.  Connect the middle junction of the voltage divider to the junction between the two capacitors of the DC offset circuit.  This will add 2.5V to the amplified microphone signal.

Step 25: Connect to Analog Input

Connect analog input 0 to the junction between the two capacitors in the DC offset circuit.

Step 26: Simple Audio Out

Load the following code onto the Arduino.  This code reads the signal coming into A0, converts it to a number between 0 and 255, and outputs it to the DAC.  On the oscilloscope in the image above you can see the incoming mic signal in blue and the signal straight out of the DAC in yellow.  Notice how each step of the DAC output is about 125us long.  In this simple setup, the sampling rate is 1/125us or 8kHz.  In the next steps I'll be manually setting the ADC counter and lowering the resolution of the Arduino's analog to digital conversion from 10 bit (0-1023) to 8 bit (0-255) to increase speed and get the sampling rate up.

Step 27:

In the code below I bypassed the function analogRead() in order to increase my sampling rate.  I manually set the ADC counter to 500kHz and read an 8 bit value from analog input 0 from the ADCH directly.  I set the ADC counter to 500kHz because the ADC takes 13 clock cycles to read a new analog value.  500/13 = 38.5kHz which gets me pretty close to 40kHz (standard audio sampling rate) without introducing extra noise.

In the code below I triggered the output to the DAC via the ADC interrupt. This interrupt is similar to other Arduino timer interrupts, but it only executed when a new ADC value has been reached (in this case at a rate of ~38.5kHz, or every 26us). The output of the code below is exactly the same as the code above, but it will be more convenient to use the interrupt code moving forward.

Step 28: Half Frequency Playback

The code below records short section of incoming audio into one of two arrays: buffer1 and buffer2.  It also introduces a variable called "scale."  This variable is used to scale the playback of the stored buffer audio in order to change the frequency.  The code below sets scale to 2, this doubles the length of time it takes for the dac to output the stored audio.  As you can see in the image above, the output from the dac (yellow) is half the frequency of the input from the microphone (blue).

Step 29: RC Potentiometers

Since the ADC is busy converting the incoming audio from A0 to digital, the three control pots on the effects box (wet/dry, pitch, and grain size) will have to be monitored using one of the digital pins.  This can be down using an RC circuit.  This circuit uses a digital pin on the Arduino to measure the amount of time it takes to discharge a capacitor.  This time is related to the resistance in the circuit which is set by a potentiometer.  This way, we can indirectly measure the resistance of the potentiometer.

Solder a row to header pins to digital pins 9-13.  Solder a 10kOhm resistor and 0.1uF capacitor in series to pins 10-12.  Solder the free end of the 0.1uF capacitors together and connect to Arduino +5V.  Connect the outside pin of two 1mOhm linear taper pots to the junction between the resistor and capacitor attached to digital pins 11 and 12.  Connect the outside pin of a 1mOhm logarithmic taper pot to the junction between the resistor and capacitor attached to digital pin 10.  Solder the middle pins of each pot to ground.

I you'd like you can increase the resolution of any of these controls by increasing the capacitance of the 0.1uF cap to 1uF or 10uF.  This change will have to be accounted for in the final firmware as well.

Step 30: Switch

This switch allows reverse playback of recorded samples.  Solder a 10kOhm resistor to one of the leads from the switch.  Solder a red wire to the other end of the resistor and connect to ground.  Solder a wire to the junction between the resistor and the switch and connect to Arduino digital pin 9.  solder a black wire to the remaining pin from the switch and connect to ground.

Step 31: Indicator LEDs

Solder 100ohm resistors to the anodes of two white indicator LEDs.  Connect the cathodes of both indicator LEDs to ground.  Connect the anode of one of the LEDs to digital pin 13- this is the clipping indicator.  The other indicator LED will be connected to a switch in the next step.

Step 32: Output Switch

this switch will turn on an indicator LED to show that the output is on.  Solder two wires to the back of the 10kOhm pot.  Connect one wire to Arduino 5V and the other to the anode of the indicator LED.  The other end of the indicator LED connects to ground.

Step 33: Enclosure

I designed a triangular enclosure in corel draw and cut it from 1/4" plywood on a laser cutter.  Two sides have holes for the input and outputs controls (jack, indicator LED, and gain potentiometer).  The front panel has holes for the rest of the controls (on/off switch, reverse switch, wet/dry mixer, pitch pot, grain size pot).  The bottom has a hole for easy access to the arduino's usb port.

I coated the plywood in three coats of polycrylic and glued the sides together with wood glue.  I glued three small triangular pieces into the corners of the enclosure so that I could screw the back panel on with wood screws (fig 3). 

Attach the Arduino to the header pins on the protoboard and begin installing the components in the enclosure.  I started by attaching the pots and switches to the front panel and then added the jacks, LED indicators, and pots to the sides.  Finally I pushed the arduino's usb port through the square hole on the bottom of the enclosure. My arduino sat firmly in place, you could screw it to the back panel for an extra secure fit.

I've attaches the corel file for the enclosure that I built.

Step 34: Batteries

Secure batteries in the corners of the enclosure with a battery clip or a piece of velcro.  Screw on back panel of enclosure.

Step 35: Knobs

Attach knobs to potentiometers and secure with a set screw.

Step 36: Final Firmware

Here is the final code for the project.  I've already explained the basic ideas behind most of the audio processing in previous steps.  The only changes I've made here is to add some code which allows the pots and switches on the device to change the value of a few variables: "scale," "grain," "forward," and "wet" and "dry."


netrunner made it! (author)2016-07-01

Hey, have to say it is very impressive.

Is it possible to modify the code to get the function of a audio compressor?

[Have you ever needed to talk into a mic for long periods? or headset? in an environment with background sounds? where you appear "less professionally", when the sound sometimes is too high or too low, or brings that background sounds up so everyone can hear it? where the "buy a professional PA system" is not technically compatible or not economically feasible (charity/hobby)]

The feature I'm looking for is:

- suppress to silence when sound level is below a set level.

- when above, amplifying or suppress sound to att set level.

- with the aggressiveness as set.

[exactly the same hardware, audio in/out and 3 potentiometer] :D

Best regards, Hans

(if anyone can help me with code, I will of course also be very happy)

EhabI made it! (author)2016-06-13

hi amandaghassaei

am really so impressed by this project , awesome one I did found from long time , just have to ask if you can provide the .fz schema for the wiring and pcb if it's available

thank u

EhabI made it! (author)2016-06-13

hi amandaghassaei

am really so impressed by this project , awesome one I did found from long time , just have to ask if you can provide the .fz schema for the wiring and pcb if it's available

thank u

Zoasterboy made it! (author)2016-04-21

I picked up some "compatible" op-amps from Fry's. They had the NTE941M which is supposed to be a replacement for the TS922IN. The problem I'm running into is, the NTE op-amp only has one input, but this circuit is using two inputs. The inverting and non inverting inputs are replaced by "offset null" pins. Is there any way to make it work with the NTE op-amp?

KevinS119 made it! (author)2015-11-17

can this be made smaller to install it in a helmet...a Mandalorian Helmet...

kwavhal made it! (author)2015-09-25

Great work. :)

It'd be very nice if you could also include your input voice for the generated output sound. It'd help us get a much clearer picture.

cafejones made it! (author)2015-09-16

dear amanda,

thanks for the grat tutorial, it all works fine and amazing.

My simple question is:

I want to be able to select between 4 different input channels. As you use default pin A0 i dont have any idea how to write a funktion for a kind of "switch",

Should be like "if blabla0 -> read from pinA0, else if blabla1 -> read from pinA1..."

Would be a so nice if you can help me out with this, I need a solution until next friday :)

amin2005 made it! (author)2015-09-03

Hello have you ever used DAC0800 or DAC08xx family for converter?

Slymatzkia made it! (author)2015-06-12

Hi there, I have a quick question. I have built the first part of this circuit, the DAC output, and when I load the code into the arduino looking for the 63 Hz sine wave the output is a square wave instead. Can you think of a reason why this would be?


jliang5 made it! (author)2015-05-10


The project looks awesome! I've ordered the parts and I am making one on my own. However, how is the Arduino powered? With both batteries going into the microphone circuit, I don't see where Arduino would get its power source.


Georgeh3 made it! (author)2015-04-07

Is there a video showing it in action?

cristianoab made it! (author)2015-04-05


This sounds like a great project, however i was wondering if it would work the same if i plugged in a guitar..

Thx in advance.

JimP3 made it! (author)2015-01-23

Im confused over step 13 where the schematic shows the capacitor with the + end to the op-amp. And then in the pictures/text you say that it should be the - end that connects to the op-amp.
Happy for any help!

shamanthkulkarni30494 made it! (author)2014-11-09

Hey Amanda...I tried building this but the output isnt coming. I dont know for what reason but the input is being recognised. Can you help me with this?

ryuchan11 made it! (author)2014-03-29

Hi Amanda, the audio potentiometer with control switch isn't available in radioshack and I can't find anywhere to buy it. May I know the replacement for it, or can I use regular potentiometer as the replacement?

amandaghassaei made it! (author)amandaghassaei2014-04-02

that's a bummer:

or you can just use a regular pot and a switch.

ryuchan11 made it! (author)ryuchan112014-04-08

thanks for the reply. right now, I have 1M logarithmic potentiometer with switch. will this potentiometer works with this project since the one you used is the regular without switch?

amandaghassaei made it! (author)amandaghassaei2014-04-17

You can use that in place of a 1m log pot without a switch

fightdu made it! (author)2014-02-14

If I brought a dac device how would it change coding its 2wire serial divice ?

machineslave made it! (author)2013-12-12

Hi Amanda,
do you know would it be ok to plug an external instrument ie. a drum machine or synthesizer into the input of the box? or would that cause some issues with power?

amandaghassaei made it! (author)amandaghassaei2014-01-13

that would work

Bosleymusic made it! (author)2013-11-05

The capacitor isn't really a DC offset - it's a blocking cap which allows AC to pass and there is a major difference. DC offset is constant while blocking caps must take charge and discharge times into account, and also act as a high pass filter by default. The larger the cap the slower the response of blocking DC will be, while the lower the value the higher the cutoff or corner frequency of the Filter. Trade-offs...

animedubbedonline made it! (author)2013-09-09


Simon Belmont made it! (author)2013-06-24

Hey amanda !

What can I do if TS922IN and TS924 have not available in my country?

What is the possible trouble if i try to use another kind of Op Amp?

Cheers !

amandaghassaei made it! (author)amandaghassaei2013-07-02

you can use any op amp - 072/82 are fine. the great thing about the TS922 was that it runs off 0-5V, meaning the arduino could send it power.

ReeveC made it! (author)2013-06-17

How about arduino Due ? I'm looking at that. It seem capable enough, am i right?

amandaghassaei made it! (author)amandaghassaei2013-06-23

it's capable enough, but a bunch of the code will need to be modified. The analog input setup code especially.

ReeveC made it! (author)2013-06-12

Sorry, i am having some problem with the CAPTCHA. Hence, i am posting a new comment..

Thanks for the reply amanda!
This is an interesting project. Would love to try it out as a toy for my niece! Do you have any idea is there another model of arduino's with higher processing power and with the similar schematic?

amandaghassaei made it! (author)amandaghassaei2013-06-12

there isn't unfortunately, the speed of the mega is the same.

ReeveC made it! (author)2013-06-06

Hey amanda !

May i check where do you store the recorded file being processed ? In the temporary storage in the arduino board itself?

Is there any way that i could store the recorded files in a SD/MMC?

Cheers !

amandaghassaei made it! (author)amandaghassaei2013-06-09

right now it just get's stored in the arduino's memory, you can theoretically record to an SD card, but I have a feeling you will run into speed problems. The audio in/out is hogging most of the arduino's processing power, so it's difficult to do too many more things in parallel.

knutolai made it! (author)2013-05-08

For some reason the anti-spam captcha box won't appear when I wish to post a reply. Ill just add my reply as a new post:

I see. Yeah I was actually quite surprised at the relatively high samplerate you managed to achieve! I though the atmega328 was way to slow/simple to handle that. Have you considered using a audio codec (external ADC and DAC) ( for both input and output? I don't think there is very much point in increasing the fidelity after the processing when the audio is compressed to 8-bit fidelity when 'entering' the Arduino.
This could also be something to look into: (the schematic, first image below the youtube video)

knutolai made it! (author)2013-05-08

Hi Amandaghassaei! First of; Great project! Im gonna have to build one this summer :) Something came to mind though. I saw you mentioned you were looking to increase the fidelity by adding a DAC chip. Have you considered the option of using the output PWM-stream option of the atmega328 chip? That would be a option to building a resistor-ladder as you have done. You would only need one digital output channel and a low-pass filter (preferably a two pole, or steeper, filter).

amandaghassaei made it! (author)amandaghassaei2013-05-08

theoretically this idea is possible, but I think in practice the arduino is just not fast enough to handle audio input and PWM output at 38kHz. The resistor ladder is the most minimally processing intensive way to get the audio out. This project pushed the limits of what the arduino is capable of, I think you would find some very odd behavior if you tried to push it more. great idea though, would totally work in another context! I'm curious about how the fidelity would compare.

AJMansfield made it! (author)2013-05-07

An easier alternative to that would be just buying a resistor pack.

AJMansfield made it! (author)2013-05-07

Normally, the pitch of a perf board is actually not 2.54 mm but 0.1 inch (although they are almost exactly the same length) - the standard that established that spacing used inches, not mm, so the size should be quoted in inches, not mm.

tmdrake made it! (author)2013-04-01

I might have to try this project...I really want to get my hands dirty with DSP...this looks like the easiest way to learn so far.

manuel123 made it! (author)2012-10-29

I'm working on a similar project, how did you power the arduino, I see no connection to the Vin pin in any of your diagrams.

amandaghassaei made it! (author)amandaghassaei2012-10-29

sorry, I must have forgotten to draw that in the schematic, I'll change it asap.  Vin is connected the the +9V supply that is powering the TL082 mic amplifier op amp. It is just a 9V battery supply. be sure to connect the negative terminal of the battery to Arduino's ground. I actually wrote an instructable about it here.

manuel123 made it! (author)manuel1232012-10-31

Also, is it possible to use a ac-dc power supply instead of two batteries? A voltage divider should provide positive and negative current to the op amp but I'm not sure how you'd ground the arduino.

amandaghassaei made it! (author)amandaghassaei2012-10-31

yes it is possible. you should look up dual rail supply circuitls. Here is a good start:
you can see in this project how there's a +V, -V, an 0V supply. Connect the 0V supply to Arduino ground.

manuel123 made it! (author)manuel1232012-11-12

Got it, thanks a lot. Built a buffered voltage divider using an op-amp to save space. One last question, I want to use a DAC instead of the resistor ladder to save space and improve the sound quality, I have a bunch of DAC0800 ICs and I know the basics of how to work them but my current setup doesn't seem to be getting any sound out of the arduino (I'm using your sine wave generator code) how would you set up the DAC?

amandaghassaei made it! (author)amandaghassaei2012-11-12

funny you ask me that today, I just posted a relevant project here:
your dac setup should be similar, let me know if you still can't get it up and running, I can take a look at the data sheet.

manuel123 made it! (author)manuel1232012-11-12

I got it to run but it turns out the buffer is not doing it's job properly. It works when I invert the voltage inputs but it gives me negative voltage. I tested the divider and I'm getting 4v on one end and 10 on the other I need some kind of buffer that has a small outline (I'm short on space)

manuel123 made it! (author)manuel1232012-11-13

I'm thinking either a rail splitter or a BUF634 buffer.

AMC92 made it! (author)2012-11-08

Hey so I am currently putting this project together for a class. I am around step 10 and you say to use a 2kOhm resistor, except in the supplies list there is not one listed, or at least not that I can find. I wanted to make sure this is the resistor I need to get. If you could let me know that'd be great! :)

amandaghassaei made it! (author)amandaghassaei2012-11-08

yes, it's in there. sorry I'll update the parts list!

Vee20 made it! (author)2012-11-03

Hi, there was just a glitch in my connections. Got my sound working all right :)
I had this hooked up and was messing around with sound on my PC speakers and was wondering if this voice stream could get sent to my PC via ethernet. Say using the ethernet shield connected to the arduino being used?

amandaghassaei made it! (author)amandaghassaei2012-11-03

I think it could work. The ethernet shield uses pins 10-13 to communicate:
so you will need keep those pins free. If you keep the clipping indicator, you will need to move it to another digital pin (like pin 9)
Check out this piece of code:
you should try to send your serial data via ethernet inside the interrupt routine. Hopefully the Ethernet Shield is fast enough to send data at 38.5kHz, I'm not sure.
code with clipping indicator is at the bottom of this page:
change all the 13's to 9's

amandaghassaei made it! (author)2012-11-01

do you have an amplifier connected to the DAC? your headphones may be putting too much of a load on the DAC and causing the signal to sag. do you have an oscilloscope? is there any way for you to measure the amplitude of the incoming/outgoing signals? maybe even a multimeter in ac mode?

About This Instructable




Bio: I'm a grad student at the Center for Bits and Atoms at MIT Media Lab. Before that I worked at Instructables, writing code for ... More »
More by amandaghassaei:OTCA Metapixel - Conway's Game of Life"9 Degrees of Freedom" IMUTwitter Controlled Pet Feeder
Add instructable to: