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.
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
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.
MT8870 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|
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.