user70317: I'm trying to read an incoming DTMF signal through the A0 input pin. I want to do this programmatically and not with the MT8870 module. This library (https://github.com/Adrianotiger/phoneDTMF) is supposed to do just that but I can't figure out how to connect my incoming DTMF signal to Arduino's A0 pin to receive the signal. Basically, my laptop produces the DTMF signal and I want to attach the line out, which is two wires, the positive and ground, to Arduino.  None of the configurations I've tried work.  I've tried to attach the positive to A0 and the ground to ground, but A0 doesn't seem to be detecting anything.  I also don't want to use a microphone on the A0 pin to detect the DTMF. A simple Fritzing type diagram showing how to connect the incoming DTMF signal to A0 would be helpful. Thanks.

user4143: Your problem is that you think there's a "positive" signal. In audio there isn't a "positive" signal, there is just a signal that swings around 0V.
You have to convert said signal to a "positive" signal by adding a DC offset to it.
The simplest way is with one capacitor and two resistors:

simulate this circuit – Schematic created using CircuitLab
That schematic will remove any DC offset that your laptop may add ("AC couple") and then add a 2.5V DC offset of your own to the signal.  The audio signal will then be alternating around 2.5V.
You may need to boost the audio signal's volume with an op-amp (note: do not use a "power" amplifier like the LM386, it is not suitable; use an op-amp) to increase the sensitivity of the input.  You could do this with a simple inverting amplifier arrangement with the DC offset being injected into the non-inverting input:

simulate this circuit
Here the gain of the amplifier is the ratio between R3 and R4 - in this case a 10:22 ratio (or a 2.2x gain).
From a software point of view you now remove 512 from each analog read value to give you a range of +/-511 for your sampled values. You then probably (maybe with the library you link to) take a block of samples at a defined frequency and perform an FFT analysis to find what dominant frequency components are present.

70317: <p>I'm trying to read an incoming DTMF signal through the A0 input pin. I want to do this programmatically and not with the MT8870 module. This library (<a href="https://github.com/Adrianotiger/phoneDTMF" rel="nofollow noreferrer">https://github.com/Adrianotiger/phoneDTMF</a>) is supposed to do just that but I can't figure out how to connect my incoming DTMF signal to Arduino's A0 pin to receive the signal. Basically, my laptop produces the DTMF signal and I want to attach the line out, which is two wires, the positive and ground, to Arduino.  None of the configurations I've tried work.  I've tried to attach the positive to A0 and the ground to ground, but A0 doesn't seem to be detecting anything.  I also don't want to use a microphone on the A0 pin to detect the DTMF. A simple Fritzing type diagram showing how to connect the incoming DTMF signal to A0 would be helpful. Thanks.</p>
 4143: <p>Your problem is that you think there's a &quot;positive&quot; signal. In audio there isn't a &quot;positive&quot; signal, there is just a signal that swings around 0V.</p>
<p>You have to convert said signal to a &quot;positive&quot; signal by adding a DC offset to it.</p>
<p>The simplest way is with one capacitor and two resistors:</p>

<p><img src="https://i.stack.imgur.com/t7jZC.png" alt="schematic" /></p>

<p><sup><a href="/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2ft7jZC.png">simulate this circuit</a> &ndash; Schematic created using <a href="https://www.circuitlab.com/" rel="nofollow">CircuitLab</a></sup></p>
<p>That schematic will remove any DC offset that your laptop may add (&quot;AC couple&quot;) and then add a 2.5V DC offset of your own to the signal.  The audio signal will then be alternating around 2.5V.</p>
<p>You may need to boost the audio signal's volume with an op-amp (note: do <em>not</em> use a &quot;power&quot; amplifier like the LM386, it is not suitable; use an op-amp) to increase the sensitivity of the input.  You could do this with a simple inverting amplifier arrangement with the DC offset being injected into the non-inverting input:</p>

<p><img src="https://i.stack.imgur.com/gf7mp.png" alt="schematic" /></p>

<p><sup><a href="/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fgf7mp.png">simulate this circuit</a></sup></p>
<p>Here the gain of the amplifier is the ratio between R3 and R4 - in this case a 10:22 ratio (or a 2.2x gain).</p>
<p>From a software point of view you now remove 512 from each analog read value to give you a range of +/-511 for your sampled values. You then probably (maybe with the library you link to) take a block of samples at a defined frequency and perform an FFT analysis to find what dominant frequency components are present.</p>
