Arduino & DTMF – Part 1 Key info to get you started

2 Flares 2 Flares ×
Learn how to quickly get up-and-running with a DTMF Shield for Arduino in this tutorial.

So you want to build an Arduino project which uses DTMF / Touch Tones? Great! Let’s get started.

I want to mention that DTMF is great choice for DIY projects. It’s a widely used protocol what pretty much EVERY phone can generate such tones. So 1/2 of your project is completed from the start! Nice!  …ok… it may happen that you live in some crazy part of the world that still use pulsating tone for dialing, but I doubt. If you do still use it, leave a comment below, and let me know if you drive a hacked DeLorean. :)

One of the few production telephone DTMF keypads with all 16 keys, from an Autovon Telephone. The column of red keys produces the A, B, C, and D DTMF events.

First step in your project is to decide if you want to build a DTMF transmitter or a receiver… or both.  Before diving into that, let’s get the lingo straight:

Through out this document and in the internet you’ll come across terms such as transmitter or encoder and even transceiver. Here’s what it all means

Transmitter or Encoder – device that makes the sound. Also called TX, XMITTER, XMIT. If you want your project to generate tones, then you’re creating a dtmf encoder or touch tone encoder.

Now, for a device that can receive the tones and make sense of them, that device is called a receiver or decoder. You may also see as RX, RCV, RCVR. Also, the words DTMF and Touch tone is interchangeable terms.

Now, for a device that can both encode and decode DTMF, that device is called a transceiver, which is a term TRANSmitter + erSCEIVER. Cool huh! Ok, now you know it all about the background of DTMF.

Below is a block diagram for a DTMF decoder. It’s a useful graph to illustrate the purpose of a decoder. It takes in analog signal does its magic and then outputs digital signals that Arduino can read.  Of course the decoder only outputs the converted digital signals when the proper input comes in. Otherwise, it outputs zeros.

function_overview
Block diagram of a DTMF decoder. Analog signals come in and digital signals go out.

Hardware vs Software?

A common question I get about is whether to build a DTMF encoder/decoder using a hardware (i.e. a dedicated application specific IC chip) or software to get the job done. I’ll cut to chase and give a quick final answer, BUT if you do have any question about why I have this answer please please please, let me know in the comment field below and I’ll elaborate more.

For encoding: I found that generating DTMFs is a task easy & light enough that Arduino can handle with no problem. So for encoding recommend Arduino doing the heavy lifting to generate the tones. I recommend the software solution. The drawback of the software approach for encoding is that the easy method does take two digital output ports, so if your application is short on pins, this could be a problem and make you move.

By the way, if you want go to hardware encoding the one I have (limited) experience is the TP5089. The word of caution about that chip is it’s keypad interface. That chip was designed to interface to a type of keypad that is not widely used. If your goal is to have a microcontroller sending the digital signals then you should be fine. But if you want an actual keypad interfacing to that chip, stay away from it…  the grounded keypad is not too common. The matrix type is what you’ll find everywhere.

For decoding: Assuming your project title  is NOT:  “Arduino Decoding DTMFs”, then I don’t think it’s worth your while to go that route. I did the research on how to get it done and saw some promising sample applications that used Goertzel algorithm but in the end I could not get it working reliably. Furthermore that takes power away from your application.  Let’s say your code is performing certain processing and a DTMF signal arrives. You may miss that signal that just came in because the processor way busy doing something else. Using a dedicated Integrated Circuit chip such as the MT8870, frees up the your code to do whatever, and you can have setup an Interrupt to alert you that DTMF came in in the middle of the processing you were doing.

In summary, my recommendation is:

  • Encode with software
  • Decode with hardware

Liked what you read so far? Subscribe to Gadget Makers’ Blog below and receive email notification when I post the other parts of this article. Also, join our list to get access to my Arduino Sketches for generating and receiving DTMF!

 


 

Your info will *never* be shared or sold to a 3rd party. Even if they offer a brand new oscilloscope  :)