5

I would like to connect my Arduino Uno to a telephone line in order to answer a call, record a sequence of DTMF tones, generate a DTMF tone in response, and hang up.

The telephone line uses a standard RJ11 connector. When a touch-tone phone is connected to the line, it receives one of two rings:

  • a standard ring, which signals an incoming call
  • a shorter "two-ring" sequence which signals a call from a local intercom

I would like my Arduino to listen for the "two-ring" sequence and only answer those calls.

How would I go about connecting my Arduino to the telephone line? Is there a shield designed for this purpose? I know I can use the tone() function to generate the DTMF tones, but I'm assuming I would need to perform some form of Discrete Fourier transformation in order to "read" the DMTF tones from the other end of the line.

Any suggestions would be appreciated.

  • Be careful when connecting directly to the phone line. There can be huge spike on the line (e.g. lightning strikes). If you've ever opened e.g. an ADSL modem, you'll see there are quite a few protection components on it (sparkgaps, movs, magnetics). – Gerben Jun 18 '15 at 15:38
  • In the UK it is illegal to connect anything to the phone line that hasn't been certified. You might want to check your local regulations too. – Majenko Oct 12 at 13:31
6

You can interface arduino to telephone line using MT8870D chip. This IC can decode DTMF tones. Below is a reference schematic from the datasheet.

Ref Design

Another popular design floating on the internet is below:

popular design

There are pre-build modules available from futurelec :

module

You can use Holtek HT9200 IC to encode DTMF that can be interfaced with Arduino. Below is the reference schematic from its datasheet.

encoder

1

You'll need some hardware assistance for the DTMF detection and generation; I doubt many Arduinos (you didn't say which, but maybe ARM?) have the horsepower to run an FFT (and deliver the results while anyone still cares....)* tone()may not be precise enough in frequency for DTMF detection by the calling device; you'll have to check that out. A quick search finds a number of articles on building or buying tone detectors and generators.

Ringing pattern detection is a little easier but you'll still probably want to sense the ringing and convert it to a level in hardware, rather than tracking the instantaneous line voltage and trying to distinguish in software between noise, ringing, noisy ringing, and various degrees of quiet.

* But maybe this Hackaday project can give you some alternate and computationally feasible ideas.

  • Hmm... I guess I hadn't given enough thought to the amount of processing required for DFT/FFT. Although (as your link suggests) I'm only sampling for a very small set of frequencies. – Nathan Osman Jun 18 '15 at 4:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.