DTMF - jimaobian/DFRobotWiki GitHub Wiki

Introduction

This board is a Dual-tone multi-frequency signaling module decoder for Arduino and gadgeteer. With its audio connector you can decode the crazy funny noises common phones make. If you are not sure what I'm talking about, imagine a home phone while pressing several of its keys. These Touch-Tones have a specific frequency or sound that this module can decode.

Together with GMS / GPRS / GPS shield this module can communicate your Arduino with any phone land line or Cell phone in the world, within GSM signal range. Which goes as far as your cellphone.

Pin Definition

For Gadgeteer module just connect the IDC 10; For Arduino shield here is the pin definiton

DTMF Arduino
Q1 12
Q2 11
Q3 10
Q4 9
STD 8
SPK2 3
SPK1 2

Q1~Q4 and STD are part of the DTMF demodulation interface. These pins are required for this board SPK pins are for an optional DTMF modulation from arduino. Which requires an alternative library for tone generation, read below for more details

Connection Diagram

For the Shield version, just stack it on an Arduino compatible device. If you are using the module, just wire the pins like the table above to your Arduino.

Sample Code

You must download the library

/*
  DTMF.cpp - Example code for DTMF library
  Pin Diagram

DTMF     Arduino
Q1   12
Q2   11
Q3   10
Q4   9
STD  8
SPK1     2
SPK2     3

*/



#include "dtmf.h"

DTMF dtmf;

void setup()
{
 Serial.begin(9600);
}

void loop()
{
  // Play a default number with all possibilities
  //dtmf.playDTMF();

  // Read DTMF codes one by one and print it on Serial
  int myDtmf;
  myDtmf = dtmf.getDTMF();
  if(myDtmf != -1) Serial.println(myDtmf);
  delay(80); // to avoid getting repeated output.
}

Modulating DTMF from Arduino

Arduino current Tone library performs very well for single tone generation. Since it uses a single timer, dual tone generation at the same time is not possible. DTMF is a dual tone signal, and in order to enable this feature we need to use an external library. The DTMF library integrates an updated version of the Arduino Tone Library - V0006 from 2010. Note that using this feature, will occupy an extra timer and might affect some other libraries requiring timers to function.

However this function, is not entirely reliable due to the performance of Arduino. Requiring an amplifier

(updating)

FAQ

'''Q1. ''' Tips about delay in the example.

'''A. '''Timing means performance. If you are getting duplicated numbers, you need to change the delay in the example.

'''Q2. ''' How to use microphone in order to listen DTMF sound?

'''A. '''You can connect a buzzer with SPK1 or SPK2, and use a function called playDTMF(). Read more on forum.

center For any question/advice/cool idea to share, please visit DFRobot Forum.

Documents

link=http://www.dfrobot.com/ shopping from dfrobot store or dfrobot distributor.

category: Product Manual category: DFR Series category: Sensors category:source category:Diagram