MT8870 DTMF Decoder Interfacing with Arduino UNO
Introduction
MT8870 DTMF Decoder Module
DTMF (Dual Tone Multi-Frequency) is a telecommunication signaling technique that uses a mixture of two pure tones (pure sine waves). It is used in phones to generate dial tones.
MT8870 is a DTMF decoder; it helps decode the key pressed.
It gives a 4-bit digital output that can be processed to identify the key pressed. This gives 16 possible outputs for 16 different keys.
For more information about MT8870 DTMF decoder and how to use it, refer the topic MT8870 DTMF Decoder in the sensors and modules section.
Interfacing Diagram
Interfacing MT8870 DTMF Decoder Module with Arduino UNO
Example
Decoding dial tones received from mobile phone and displaying them on the serial monitor of Arduino.
Here, a mobile phone is connected to the MT8870 DTMF Decoder module through an auxiliary cable.
The four digital signals from the module are connected to Arduino board along with the StD (Delayed Steering Output) signal.
StD is used to detect the key press. It goes High when the key is pressed and then returns to Low again.
Sketch for Dial Tone Identification
void setup() {
Serial.begin(9600);
pinMode(3, INPUT);
pinMode(4, INPUT);
pinMode(5, INPUT);
pinMode(6, INPUT);
pinMode(7, INPUT);
}
void loop() {
uint8_t number;
bool signal ;
signal = digitalRead(3);
if(signal == HIGH) /* If new pin pressed */
{
delay(250);
number = ( 0x00 | (digitalRead(7)<<0) | (digitalRead(6)<<1) | (digitalRead(5)<<2) | (digitalRead(4)<<3) );
switch (number)
{
case 0x01:
Serial.println("Pin Pressed : 1");
break;
case 0x02:
Serial.println("Pin Pressed : 2");
break;
case 0x03:
Serial.println("Pin Pressed : 3");
break;
case 0x04:
Serial.println("Pin Pressed : 4");
break;
case 0x05:
Serial.println("Pin Pressed : 5");
break;
case 0x06:
Serial.println("Pin Pressed : 6");
break;
case 7:
Serial.println("Pin Pressed : 7");
break;
case 0x08:
Serial.println("Pin Pressed : 8");
break;
case 0x09:
Serial.println("Pin Pressed : 9");
break;
case 0x0A:
Serial.println("Pin Pressed : 0");
break;
case 0x0B:
Serial.println("Pin Pressed : *");
break;
case 0x0C:
Serial.println("Pin Pressed : #");
break;
}
}
}
No comments:
Post a Comment