Skip to content

Phone to Microcontroller interfacing with DTMF

Mayank shows us how to interface a microcontroller to the phone line. The tones you hear as you enter numbers on your phone can remotely control devices. Learn how to use these DTMF tones in your microcontroller projects.

This article was submitted by Mayank Magoo as part of the “Hobby parts for articles” program. Mayank received a Arduino compatible Modern Device Company Bare Bones Kit for this great article.

This project describes the development of a system to interface the telephone line with a microcontroller. Using this interface any device can be controlled using a telephone or cell phone. The system involves the use of DTMF tones commonly used in telephone networks.

DTMF Tones
Dual-Tone Multi-Frequency (DTMF) signaling is used for telephone signaling over the line in the voice-Frequency band to the call switching center. These are the tones you hear when you dial a touch tone phone.

The standard DTMF keypad is laid out in a 4×4 matrix, with each row representing a low frequency, and each column representing a high frequency. Pressing a single key will send a sinusoidal tone of the two frequencies at the same time, the lower frequency for the row of the pressed key and the higher tone for the column. These tones are then decoded at the receiving end to determine which key was pressed. The use of two tones for a single key ensures that no two keys will generate the same signal. There are 16 possible tone sets but only 12 are used on common telephones.

DTMF Keypad Frequencies

1209Hz 1336Hz 1477Hz 1633Hz
697Hz 1 2 3 A
770Hz 4 5 6 B
852Hz 7 8 9 C
941Hz * 0 # D

ATMEGA-8 Microcontroller:
The ATMEGA-8 microcontroller was selected due to it’s low cost and it’s 8Kb of programmable flash memory and 512 bytes of EEPROM and ease of programming and implementation.

mt8870MT8870 DTMF Decoder:
The MT8870 is a low cost DTMF Decoder which gives a 4-bit binary output characteristic of each tone and a status signal which has logic high whenever a valid DTMF tone is received. The Q1 to Q4 outputs produce a 4 bit binary output corresponding to each tone. The StD output signals that a valid tone is present.

Functional Decode Table of CMD8870

Digit (DTMF Tone) Q1 Q2 Q3 Q4
Any Z Z Z Z
1 0 0 0 1
2 0 0 1 0
3 0 0 1 1
4 0 1 0 0
5 0 1 0 1
6 0 1 1 0
7 0 1 1 1
8 1 0 0 0
9 1 0 0 1
0 1 0 1 0
* 1 0 1 1
# 1 1 0 0
A 1 1 0 1
B 1 1 1 0
C 1 1 1 1
D 0 0 0 0

IC 7805:
The IC 7805 is a linear voltage regulator. It provides a constant +5 voltage in spite of the variations in the incoming voltage. Each IC 7805 is connected to a heat sink to dissipate heat.

ULN 2003:
The ULN 2003 is an array of seven Darlington transistors which are used to interface the CMD8870 to the microcontroller.

BC108 NPN transistor is used as a switch to amplify the current from the CMD8870 and operate the latching relay.

Magnetic Latching Relay
The Magnetic Latching Relay has 10-pin contacts and two separate pins for latching and unlatching the relay. The relay once latched will remain latched even if the power is removed thereby reducing the power requirements and provide and easy and effective way to cut-off the ignition.

Telephone line is connected to the MT88770 DTMF Decoder, the 4-bit decoded binary output is connected to ULN 2003 Bridge whose output is fed into the micro-controller. The status signal from MT8870 is used to trigger an interrupt whenever a new DTMF tone is detected. The microcontroller then reads the decoded output. Once the correct code is received, the microcontroller activates the latching relay via the BC108 transistor. Power for almost any appliance could be controlled this way.



Posted in Microcontroller, Projects.

14 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Proteek Basu says

    Hi Mayank,

    This is a great project, can you publish the source code too.



  2. vijetha says

    hi ,mayank……it was a very nice design…..can you please me the code for this project………..also i wanted to know whether we can control any device with this………

  3. ElektronikaBa says

    Hi Amar, what you need is on my webpage. It is called Phone line controller.

  4. Amar says


    Can you suggest a way to interface a telephone line to microcontroller, tat detects the incoming calls.
    The voltage when ringing is 90 volts AC and in on hook state is -45 volts DC,
    how can i use this to connect a mc.

  5. dfowler says


    We dont sell parts here. You will have to hunt it down with DigiKey or another supplier.

  6. shashank says

    i want to purchase mt 8870.please reply soon with it’s cost.

  7. dfowler says


    I will ask Mayank Magoo to give up the source code. If he does, I will update this article to include it.


  8. alan gehl says


    What a neat little design. I can use this to run our test equipment remotely. Sort of my way of going green. Any chance of you sending me the program for the ATMEGA-8?


  9. mure says

    Please give me a GOOD reason why you used ULN2003 transistor array!? Why didn’t you connect 8870 to the microcontroller directly? You did that with STD pin! They both work on the same voltage… Hello TTL?

  10. pK says

    Another excelent article and also very original for the DTMF decoding. Well done.

  11. dfowler says


    Sorry about that. I put up a better image just now. Click on the graphic in the article to get the larger version.

  12. Felixe says

    A higher resolution image for the circuit diagram would be great.

    I was thinking that a circuit like this would be great for having a home computer turn on and off just calling on the phone and entering a predefined sequence. That would be nice if you don’t want to run your computer on all the time.

  13. dfowler says

    I agree xSmurf. I was a bit confused about that as well. I;m sure Mayank will let us know.

  14. xSmurf says

    Nice write up. Although I never tried I know it’s also possible to use the µC to decode the dtmf. However, I still like the idea of the external ic. Specially since it provides a nice interrupt for the telephone line! As far as I couldn’t see from the datasheet the MT88770 outputs at 5v which should be fine. So why do you need the Darlington array?