Author Topic: Problems with MT8870 DTMF Decoder  (Read 19199 times)

0 Members and 1 Guest are viewing this topic.

Offline VegaObscuraTopic starter

  • Robot Overlord
  • ****
  • Posts: 153
  • Helpful? 6
Problems with MT8870 DTMF Decoder
« on: April 30, 2014, 11:07:56 PM »
I am attempting to make a circuit with the MT8870 chip.  What I want to do is have a plug going from a cell phone, into the circuit board in a way so that the MT8870 will decode the button presses and light up LED's to indicate (in binary) which button was pressed.  Later on the circuit will be more complicated, but I need to make it work in this simple setup first.

This has been done many times by many people, but typically it is done with an old Nokia phone.  I need to do this with a modern smartphone.  The phone I am using is a Samsung Galaxy S4.

First I set up the circuit on a breadboard in its normal fashion, as can be seen in this diagram:



This circuit did not show any response to button presses.  After a lot of googling, an obscure forum post in an indian forum stated that the 100k resistor between tip and pin 2 works for old Nokias, but is too strong for modern phones.  He said that his circuit worked fine after replacing that 100k resistor with a 4.7k resistor.

So I tried using less resistance between tip and pin 2.  I didn't want to go quite as low as 4.7k if I didn't have to, so I first tried 10k.  With the 10k resistor in place, as soon as I fired up the circuit and started hitting buttons on my phone the LEDs started reacting exactly as they were supposed to.  I thought I had won.  But then another problem arose.

After a few seconds of playing with the buttons, the whole thing suddenly stopped responding.  The lights didn't all go off, they just stayed in the position they were in and would not react to the keypresses.

I tried unplugging the power and plugging it back in.  This reset all the lights (set them all to off) but they still wouldn't respond to keypresses.  After some playing around aimlessly, it started working again.  But, again, after a few seconds it stopped responding.  Unplugging the circuit and plugging it back in does nothing.  It seems as if unplugging the phone from the circuit works sometimes.

I tried reducing the resistance again.  I tried 4.7k and 1k.  Both of these behaved the same way as the 10k resistor.

As it stands, the circuit will work for a few seconds, and then lock up.  If, while it is working, I keep pressing buttons on the phone constantly, it will not lock up.  But if I stop pressing anything for even five seconds, it locks up every time.

I suspect that when I changed the resistor from 100k to 10k, I would have needed to change something else as well.  Possibly the resistor between pin 2 and pin 3?  Possibly the capacitor between tip and the (now) 10k resistor?  Possibly the capacitor between pin 17 and V+ or the resistor between pins 17 and 16?

Here is the circuit as it is now, the only difference from the diagram above is the resistor at the top left:


The 5V I am using comes from a 5V regulator connected to a 9V battery.  Using the multimeter, all voltages and continuities on the board are appearing correct.

I understand most of the circuit.  I understand the bottom half completely.  I understand that the 0.47uF capacitor is to filter out noise in the signal.  I understand that the resistors at the top left of the diagram are for controlling the op-amp, but I don't understand exactly how they do that.  I don't understand the 0.1uF capacitor at the top right or the 330k resistor directly below it at all.

Here is a link to the datasheet for the MT8870
http://www.natalnet.br/~aroca/afron/mt8870.pdf
I have read it many times, but I still don't entirely understand the op-amp or pins 16 and 17.

Any assistance in helping me to stop it from locking up is appreciated.

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,345
  • Helpful? 82
Re: Problems with MT8870 DTMF Decoder
« Reply #1 on: May 01, 2014, 11:00:29 AM »
Do you have an oscilloscope or logic analyzer that you can connect to diagnose what is going on when it's locking up?
If not, then I would suggest getting one of those is the first thing you should do.

Offline VegaObscuraTopic starter

  • Robot Overlord
  • ****
  • Posts: 153
  • Helpful? 6
Re: Problems with MT8870 DTMF Decoder
« Reply #2 on: May 01, 2014, 09:32:26 PM »
I do not.  I don't think I can afford one of those.  I've never been able to afford a soldering iron over $20 or a multimeter over $10.

If I could get an oscilloscope for <$25, I would pick one up as I know they can be very useful.

Offline Billy

  • Robot Overlord
  • ****
  • Posts: 132
  • Helpful? 2
Re: Problems with MT8870 DTMF Decoder
« Reply #3 on: May 01, 2014, 10:44:21 PM »
have a plug going from a cell phone...... The phone I am using is a Samsung Galaxy S4.
To make sure I understand. is the plug at the cell phone is connected to the earbud jack so you're sampling an audio signal?

Quote
After a few seconds of playing with the buttons, the whole thing suddenly stopped responding. 

It seems as if unplugging the phone from the circuit works sometimes.

As it stands, the circuit will work for a few seconds, and then lock up.
If I had to guess, I would say the audio driver in the phone is shutting down, and not your circuit. I've seen modern electronics sense if a connector is unplugged or shorted and shut off. The phone probably senses something is not quite correct and shuts off the driver for protection.  Try using a 20-30K resistor and see if that clears it up.

Quote
I understand that the 0.47uF capacitor is to filter out noise in the signal.
It's a minor point, but the way the cap is in the circuit, it is not filtering noise, it is filtering DC signal, so if the audio from the phone has a DC offset, the DC is blocked and only the AC (audio) gets through.

Offline VegaObscuraTopic starter

  • Robot Overlord
  • ****
  • Posts: 153
  • Helpful? 6
Re: Problems with MT8870 DTMF Decoder
« Reply #4 on: May 01, 2014, 11:24:38 PM »
Yes, the cellphone is connected to the circuit by the audio jack. "Tip" and "ring" in the circuit diagram refer to the parts of the audio jack.

I have tried using two 100k resistors in parallel for a resistance of 50k. This seemed to cause a slight "lag" in the response time, but it still locked up the same. I will try using a potentiometer to see what is the highest resistance that will still let the chip recognize the signal and see if that stops it from locking up.

It never occured to me that the phone might stop putting out the signal. I will try plugging in my computer instead and see if that changes anything, but the sound card on the computer might do the same thing as the phone and stop putting out signal.

Offline Billy

  • Robot Overlord
  • ****
  • Posts: 132
  • Helpful? 2
Re: Problems with MT8870 DTMF Decoder
« Reply #5 on: May 01, 2014, 11:24:49 PM »

Quote
After a few seconds of playing with the buttons, the whole thing suddenly stopped responding. 

It seems as if unplugging the phone from the circuit works sometimes.

As it stands, the circuit will work for a few seconds, and then lock up.
If I had to guess, I would say the audio driver in the phone is shutting down, and not your circuit. I've seen modern electronics sense if a connector is unplugged or shorted and shut off. The phone probably senses something is not quite correct and shuts off the driver for protection.  Try using a 20-30K resistor and see if that clears it up.

Is it too late to modify my answer?

That 0.47uF cap looks like low impedance when the phone is putting out an audio signal (you're pressing buttons) and the low impedance is interpreted as there being ear phones connected.  When you are not pressing buttons, the output will be DC and the capacitor will look like an open circuit, the phone will think there are no ear phones connected, so it is shutting off the output a few seconds after you stop pushing buttons. Again because when you're not pushing buttons it decides there are no longer ear phones connected.

You need to make the phone think there are ear phones connected all the time. To do that you need to provide a low impedance path to DC signals. To do that, install a 50K - 100K resistor between the tip and ring lines.

This high side driver has a good explanation of how it senses a disconnected load.
http://www.ti.com/lit/ds/symlink/lmd18400.pdf - see page 15
It always has a small DC output (even when off) and it uses that small DC output to sense a connection of a load. You could also confuse this high side driver with a capacitor in series with the output, just as you're doing to the phone.

Offline VegaObscuraTopic starter

  • Robot Overlord
  • ****
  • Posts: 153
  • Helpful? 6
Re: Problems with MT8870 DTMF Decoder
« Reply #6 on: May 02, 2014, 10:26:23 AM »
It's not late until its two, then it's too late.

I tried adding a 100k resistor between tip and ring.  This helped nothing.  I then tried adding a second 100k resistor in parallel with the first, for a combined resistance of 50k.  This still did nothing.  The circuit still locks up the same.

I don't think the phone is sensing that there are no headphones connected, because it has a headphone icon in the corner the entire time that it is plugged in.

I will try getting a headphone jack splitter and plugging in a set of headphones with the phone and circuit board, so I can listen and make sure the phone is putting out the audio signal.
« Last Edit: May 02, 2014, 10:28:37 AM by VegaObscura »

Offline Billy

  • Robot Overlord
  • ****
  • Posts: 132
  • Helpful? 2
Re: Problems with MT8870 DTMF Decoder
« Reply #7 on: May 02, 2014, 11:40:10 AM »
I don't think the phone is sensing that there are no headphones connected, because it has a headphone icon in the corner the entire time that it is plugged in.

Well, it was worth a shot. Without a scope or other way to get data, you have to form theories and test them open loop. We'll be wrong a lot of the time. At least we learn as we fail.
I got nothing else for you. Good luck.

Offline VegaObscuraTopic starter

  • Robot Overlord
  • ****
  • Posts: 153
  • Helpful? 6
Re: Problems with MT8870 DTMF Decoder
« Reply #8 on: May 02, 2014, 12:01:56 PM »
At least we learn as we fail.

We haven't failed, we have succeeded in finding out what the problem isn't!

Offline VegaObscuraTopic starter

  • Robot Overlord
  • ****
  • Posts: 153
  • Helpful? 6
Re: Problems with MT8870 DTMF Decoder
« Reply #9 on: May 09, 2014, 11:04:37 AM »
I picked up a sound jack splitter so I could plug both the circuit board and a headset into the phone at the same time.  I can now confirm that the phone is not the problem.  The phone is putting out sound the entire time.  The problem is something with the circuit.

My next test will be to put a potentiometer in place of the resistor between tip and pin 2 so I can see if setting the resistance close to the "cutoff point" where the circuit reads the signal helps anything.

Offline asif5955

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
Re: Problems with MT8870 DTMF Decoder
« Reply #10 on: July 25, 2015, 02:43:27 PM »
Hi i am new here   ;D
Although it was an year old post  but  i am replying to it
I have  made DTMF circuit using Mt-8870 and got solution to the problem you were stating
You Audio jack is not properly grounded
i was having same Problem but when i connected Audio jack's body and negative pin with -5v (power supply)
this problem was gone

Offline mklrobo

  • Supreme Robot
  • *****
  • Posts: 558
  • Helpful? 15
  • From Dream to Design at the speed of Imagination!
Re: Problems with MT8870 DTMF Decoder
« Reply #11 on: July 27, 2015, 08:56:05 AM »
 ;D Hello!
I would offer an opinion, where permissible;  :)
I usually divide a project into modules, where I can troubleshoot/repair quickly, where needed.
I would get a audio amp kit from Velleman or sparkfun, to deal with the audio. this way, you
can get enough audio with no possible dropout. The DTMF frequencies are from 697 to 1633
Hz, so you should not have any frequency roll off on the audio amp. It does take a certain amount of
time for the chip to identify the tone; no less than 120 milliseconds, I think.  :-\
In regards to an Oscilloscope, I would recommend the Velleman PC oscope, PCSGU250 -
it has a oscope to 12 MHz, a function generator, a spectrum Analyzer, a transient recorder, and
a bode plotter. Who could ask for more, at a meager $150?  :o
You can take pictures of your waveform, to analyze later, or pass to other techs for their advice.(?)
Good luck!!!   ;) :) :D ;D
« Last Edit: July 27, 2015, 09:58:17 AM by mklrobo »

Offline boby

  • Beginner
  • *
  • Posts: 1
  • Helpful? 0
Re: Problems with MT8870 DTMF Decoder
« Reply #12 on: November 18, 2017, 02:21:04 AM »
 Dear Mr. VegaObscura,
Increase GS resistor (between pin 2 & 3) to 300 k or 470 k to increase feedback resistor of inner OP-AMP to
increase the index amplification of signal input ,that is; -Rf / Ri

                       Be success

 


Get Your Ad Here

data_list