DMTF MT8870, arduino, computer, shorting(resolved)

I was playing around with an MT8870 chip recently with success. I attached the STD, Q1-Q4 pins to leds, generated the dtmf tones using my computer through the headphone jack, and powered it with a bench power supply at 5v.

After verifying it worked, I attached it to my arduino as show in this diagram: (see second post, can't link in first post on this forum)

This setup does not work. If the usb and audio jack are both plugged in at the same time it's creating a short.

I think I can fix this just by decoupling the audio signal from everything else. I'm planning on doing this by sticking a 1:1 transformer in there (or optocoupler if radioshack has them). Am I on the right track? Will I need more than just the 1:1 transformer component wise? Could you elaborate on why this is happening in the first place? :)

I have a programmers background so apologies for the noobish hardware questions.

Here is a schematic of what I have setup now: Note: Diagram updated for fix. Short circuit not present now.

The USB and Audio out box are my computer's ports. The 9V is a 9V battery plugged into the arduino's power port.

Here is the chip's documentation:

I'm hoping your drawing of the stereo plug is a mistake; it is drawn backwards. The shield should be attached to ground, and the tip and ring should be connected to the audio input of the 8870.

It may work with the signal "inverted", but the nature of the connector is such that if you use a mono plug instead of a stereo, you are shorting the signal to ground.

A DC blocking capacitor should be sufficient - I've never needed an audio transformer (but I've never tried interfacing to telephone, either).

This schematic is some hardware I've built two copies of, and have flown several times. (I had a mistake with the servo pinout, not sure if it is corrected on this schematic, but the 8870 part of the circuit is correct.)


That diagram is correct.. That's pretty embarrassing since I've worked with audio before.

Thank you for pointing that out. Thank goodness my power supply is smart enough to detect shorts too... I'll have to cheat off of it next time I have to take a test. ;D

While the new circuit works fine, I noticed that with everything connect but the audio jack, I'm using 40mA. As soon as I plug the audio jack in I use 130mA. I'm just trying to learn so if you could suggest why this is occurring I would be appreciative.

I’d look for solder bridges or other accidental shorts. It does sound like something is wrong, though - the 8870 doesn’t use much power.


I found the second short problem. I connected the audio out ground to the 5v rail. Moving this wire over to the ground rail fixed everything. Thank you again for your help. Those were dumb errors. :-[

I have fixed the schematic in the second post in case folks happen to google this topic in the future so it should be useable now.

This thread just reads wrong to me. You connected the shield to 5v rail?

I am in Canada, the shaft of the plug should be the ground. The 2 outside connections (TIP & Ring) are the signals. Can you verify with a meter that your audio output device has ground/signals on the proper pins of the connector?

Measure the resistance between the audio device chassis and the shaft/shield of the connector.

The schematic that I updated is now correct.

Through carelessness, I initially had: -Ground and R of the audio out line going to IN- and GS -L of the audio out line connected to the 5V rail.

The rest of the circuit was setup correctly. With that configuration if I had the USB and Audio out jack connected to the circuit, I overloaded everything. Thank goodness my power supply can detect short circuits here!

After making the change kg4wsv pointed out, my schematic was correct, but what I had actually wired up was wrong. I had: -L and R of audio out going to IN- and GS -Ground of audio going to the 5v rail.

With this configuration I noticed I was drawing 100mA more than I should (only when usb and audio out was connected to my computer) and after looking at my diagram I realized I accidentally plugged ground into the 5V rail. After switching it to the ground of the circuit everything was fine.

Now it is what it should be: -L and R of audio out going to IN- and GS -Ground of audio going to the ground.


Programa : MT8870 Autor... : Jorge Luis Castellar - Fecha... : 2010-03-02 Funcion. : Decodifica Tonos DTMF Del MT8870

Link.... :


define IRQ_PIN 2 // Puerto Del MCU, Conectado SID (Presencia De datos )

define D0_PIN 3 // Puerto Recibe dato Binario 0

define D1_PIN 4 // Puerto Recibe dato Binario 1

define D2_PIN 5 // Puerto Recibe dato Binario 2

define D3_PIN 6 // Puerto Recibe dato Binario 3

byte irq_state;

void setup() { // Configura El Puerto Serial 9600,8,N,1 Serial.begin(9600);

// Pone Los Puerto En Modo De Lectura pinMode(IRQ_PIN, INPUT); pinMode(D0_PIN, INPUT); pinMode(D1_PIN, INPUT); pinMode(D2_PIN, INPUT); pinMode(D3_PIN, INPUT);


void loop() { // Espera a Que Haya Una Senal o Tono irq_state = digitalRead(IRQ_PIN);

if ( irq_state == 1 ) {

Serial.print("Key : "); char key = read_codigo(); // Lee El Codigo DTMF Serial.println(key); // Imprime La Tecla recibida delay(80); // Pausa Para Sincronizar La Senal o IRQ

} } /-------------------------------------------------------------/ byte read_codigo() { byte dato; // Variable Que Tiene El Valor byte De La tecla char key; // Variable Que Tiene El Valor Char tecla

byte D0,D1,D2,D3; // Variable Donde Se Lee el Estado

// Lee Los Estado Logico o Binario Del MT8870 (1 o 0 , ON o OFF ) D0 = digitalRead(D0_PIN); D1 = digitalRead(D1_PIN); D2 = digitalRead(D2_PIN); D3 = digitalRead(D3_PIN);

// Covierte De Binario A BYTE o ENTERO // Escribe Los BITS En Una Variable dato bitWrite(dato,0,D0); bitWrite(dato,1,D1); bitWrite(dato,2,D2); bitWrite(dato,3,D3);

// Convierte La Tecla a CHAR if ( dato == 1 ) key = '1'; if ( dato == 2 ) key = '2'; if ( dato == 3 ) key = '3'; if ( dato == 4 ) key = '4'; if ( dato == 5 ) key = '5'; if ( dato == 6 ) key = '6'; if ( dato == 7 ) key = '7'; if ( dato == 8 ) key = '8'; if ( dato == 9 ) key = '9';

if ( dato == 10 ) key = '0'; if ( dato == 11 ) key = '*'; if ( dato == 12 ) key = '#'; if ( dato == 13 ) key = 'A'; if ( dato == 14 ) key = 'B'; if ( dato == 15 ) key = 'C'; if ( dato == 0 ) key = 'D';

return key;


/-------------------------------------------------------------/ /-------------------------------------------------------------/