Go Down

Topic: How to correctly interface Audio In and Out (line out or headphone) with Arduino (Read 3 times) previous topic - next topic

DaAwesomeP

Hi,
I am building a project that detects telephone touch tones via the handset jack on my land-line telephone and then plays tones to the input of the telephone. I do not want to break the telephone nor my arduino. I am using this library (https://code.google.com/p/rogue-code/wiki/ToneLibraryDocumentation) to play the tones.
It says:
Quote
WARNING

Do not connect the pin directly to some sort of audio input. The voltage is considerably higher than a standard line level voltages, and can damage sound card inputs, etc. You could use a voltage divider to bring the voltage down, but you have been warned.

You MUST have a resistor in line with the speaker, or you WILL damage your controller.


I am currently testing it with a piezo buzzer and a 10k resistor. It is just what I need and works perfectly! Except it is a little old so I had to follow the instructions here (http://forum.arduino.cc/index.php?topic=87398.msg656041#msg656041) to get it to compile correctly.

I have seen multiple posts on the forum and across the internet on how to safely connect the arduino to a line-level input.
One of them is in this image (from http://interface.khm.de/index.php/lab/experiments/arduino-realtime-audio-processing/):

At the top right is a schematic on how to do this, however is requires a 33mH inductor, which I have no clue where to find.

On the audio input side, I'm pretty sure I have it down. I am using this schematic (from https://coolarduino.wordpress.com/2011/02/10/color-organ-spectrum-analyzer-on-arduino/):

I will be using the Goertzel Algorithm (https://github.com/jacobrosenthal/Goertzel). I also found a modified version that I will try as well (http://forum.arduino.cc/index.php?topic=121540.msg1071479#msg1071479). However, the only part that confuses me is that in that same forum, someone else posted a different schematic for hooking up the audio (http://forum.arduino.cc/index.php?topic=121540.msg1092810#msg1092810):

Which circuit is better to use?

Please help! I don't want to have to resort to getting the Wave Shield by Adafruit or playing sound files with the SD Card on the Ethernet Shield.

Arduino Mega 2560 R3
Windows 8 32-bit
An Arduino is not a toy; it's a professional utilitarian tool.

Grumpy_Mike

Quote
Which circuit is better to use?

They are very much the same but the first one is the one to use.

Quote
however is requires a 33mH inductor,

It will work without this, it is just that the filter will not be as good. The value is not very critical.

Quote
which I have no clue where to find.


http://uk.farnell.com/jsp/search/browse.jsp?N=2031+203351&Ntk=gensearch&Ntt=33mH&Ntx=mode+matchallpartial

DaAwesomeP

Thank you very much Grumpy_Mike! :)
An Arduino is not a toy; it's a professional utilitarian tool.

DaAwesomeP

So I just tested it today, and I found that the output it way too loud. I hooked up the multimeter and it showed ~1.2 volts DC. I understand that is way above the peak level of a line level input.

I experimented with adding a 10k and a 1k resistor between the capacitor/resistor and the telephone's handset input.

NOTE: I am using the top right portion of this Minus the 33mH inductor schematic:

Taken from: http://interface.khm.de/index.php/lab/experiments/arduino-realtime-audio-processing/
An Arduino is not a toy; it's a professional utilitarian tool.

Grumpy_Mike


Go Up