DTMF Decoder

DTMF Decoder with Arduino

Components Required:
1. CM8870C
2. One 300 Kilo Ohm and Two 100 Kilo Ohm Resistors
3. Two 0.1 micro farad
4. One 3.58 Mhz crystal
5. Mobile phone with 3.5 mm Jack
6. Arduino Board
7. Connecting Wires and USB Cable

Give Connection As per circuit diagram:

Code:

const int StD=0;        
const int Q[4]={8,9,10,11};          
int key;
int led = 13;
void setup()
{
  Serial.begin(9600);
  attachInterrupt(StD,dtmf,RISING);
  for(int i=0;i<4;i++)
  pinMode(Q[i],INPUT);            
}
void dtmf()
{
  key=0;
  for(int i=0;i<4;i++)
  key+=digitalRead(Q[i])<<i;      
  Serial.println(key);
}
void loop()
{
  if(key==5)//assign the value on pressing which you want the led to blink
  {
    digitalWrite(led, HIGH);
  }
  else
  {
    digitalWrite(led, LOW);
  }
}

Note: Some times the key value may not be the same as the value of the key that you press on the phone, but it gives distinct values for every key on the serial monitor, modify your loop as per that.

Video Demonstration of this project:


4 comments:

harago said...

Hi thanks for this project please I am doing project for DTMF tone using Arduino if I need to press two button in one time what code can i use

Jayakarthigeyan said...

Technically, you can't press two buttons at a time, there will be some delay, one button will be pressed first, followed by the next.

harago said...

Hi thank you for help me I 'm still using the arduino for my project this time I'm using 7 segment when I price the key I need to display the No in 7-segment instead of flashing light

thank you

Unknown said...

hello,
i working on same type of project, i have some question regarding this project, i build dtmf decoder circuit using mt8870, but not getting output, please help me
1. can i connect my cell phone(htc desire c) to dtmf decoder circuit using mt8870
2. how i can detect wheather my cell phone generate dtmf tone

can u post schematic of working dtmf decoder circuit