Pantech.AI

How to interface MT8870 DTMF Decoder with Arduino UNO

Overview of DTMF

MT8870 DTMF Decoder Module

DTMF (Dual Tone Multi-Frequency) is a signaling technique in telecommunications that uses a combination of two specific tones (pure sine waves) to generate dial tones, commonly used in telephones.

The MT8870 is a DTMF decoder that decodes the tones generated by each key press.

It provides a 4-bit digital output that can be processed to identify the specific key pressed, supporting up to 16 unique outputs for 16 different keys.

For more details on the MT8870 DTMF decoder and how to use it, refer to the MT8870 DTMF Decoder section in the Sensors and Modules category.

Connection Diagram of DTMF MT8870 with Arduino

Interfacing MT8870 DTMF Decoder Module with Arduino UNO

Identify Dial Tone Using DTMF MT8870 and Arduino Uno

We will decode dial tones received from a mobile phone and display them on the Serial Monitor of the Arduino.

In this setup, a mobile phone is connected to the MT8870 DTMF Decoder module via an auxiliary cable.

The module’s four digital output signals are connected to the Arduino, along with the StD (Delayed Steering Output) signal.

The StD signal detects key presses, going High when a key is pressed and returning to Low afterward.

DTMF MT8870 Dial Tone Identification Code for Arduino Uno

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;    
      }
  }
}

Leave a Comment

Your email address will not be published. Required fields are marked *