Dual-tone multi-frequency (DTMF) is a common signaling system used in telephone networks and other communication devices. It uses a mixture of two sine waves to generate tones which represent ten digits, the letters A to D, and the symbols # and *.
While I’m examining other Arduino based DTMF generators I noticed most of the designs are based on Holtek HT9200 DTMF generator IC. After a couple of experiments, I figure out that Arduino itself is capable enough to generate DTMF tones without using any external IC or generator.
The design which I explained in this article is based on R-2R ladder DAC. I did this design using Arduino Uno board and still this library support only for this board. But it can easily extend to other AVR MCU based Arduino boards.
The R-2R ladder is attached to the PORTD of the MCU which is Digital out 0 to 7 in Arduino Uno board. In this design, I used 100Ω and 220Ω resistors to construct the R-2R ladder circuit.
In MCU, waveforms are generated using precalculated wavetable. For example, to generate a tone for digit 1, it synthesizes 700Hz (≈ 697Hz) and 1200Hz (≈ 1209Hz) waveform separately and combines at the later stages to produce the final output.
Due to the lower resolution of the DAC, the output waveform is not in a pure sine wave shape, but it works absolutely fine with all the system which we checked.
To verify the library and DAC functionality I feed the output of this DTMF generator to MT8870 DTMF decoder and it decodes all the tones without any issues. Also, I checked this library with a voice telephone network by dialing some numbers and it also works fine.
The Arduino library for this DTMF generator is quite easy to use. By using this library you can generate DTMF tones for any digit or for symbols # and *.
The library and source code of this project are available at https://github.com/dilshan/dtmfgen.
While I’m examining other Arduino based DTMF generators I noticed most of the designs are based on Holtek HT9200 DTMF generator IC. After a couple of experiments, I figure out that Arduino itself is capable enough to generate DTMF tones without using any external IC or generator.
Prototype assembly of the ladder circuit. |
The design which I explained in this article is based on R-2R ladder DAC. I did this design using Arduino Uno board and still this library support only for this board. But it can easily extend to other AVR MCU based Arduino boards.
Schematic of the DTMF generator. |
The R-2R ladder is attached to the PORTD of the MCU which is Digital out 0 to 7 in Arduino Uno board. In this design, I used 100Ω and 220Ω resistors to construct the R-2R ladder circuit.
In MCU, waveforms are generated using precalculated wavetable. For example, to generate a tone for digit 1, it synthesizes 700Hz (≈ 697Hz) and 1200Hz (≈ 1209Hz) waveform separately and combines at the later stages to produce the final output.
Output waveform (channel 1) compare with the analog generator. |
Due to the lower resolution of the DAC, the output waveform is not in a pure sine wave shape, but it works absolutely fine with all the system which we checked.
To verify the library and DAC functionality I feed the output of this DTMF generator to MT8870 DTMF decoder and it decodes all the tones without any issues. Also, I checked this library with a voice telephone network by dialing some numbers and it also works fine.
The Arduino library for this DTMF generator is quite easy to use. By using this library you can generate DTMF tones for any digit or for symbols # and *.
The library and source code of this project are available at https://github.com/dilshan/dtmfgen.
Comments