DTMF & Arduino: answer, listen for code, reply.

Hey everyone,

I have been playing with an idea for a long time and every little while I try and find some info on it to try and figure out how to make it happen but cant quite find enough.

I'm really new at arduino, I can sketch the basics but this project needs more than basics.

I want to plug my arduino directly into my phone jack (no pass-thru, just the arduino) I want it to listen for the phone to ring, answer the phone, and listen for a 4-6 digit code to be entered. If the digits entered match the saved code I want it to then send out a single digit signal (9) then pause before hanging up. If the code it received doesnt match just have it hang up.

Maybe later add a prompt message to play upon answering the phone but its not crucial.

From what I've encountered I understand that everyone suggests using the MT8870 to decode however I need more of an all in one transceiver solution.

Hooeyb8ed: I'm really new at arduino, I can sketch the basics but this project needs more than basics.

You got that right!

I do have to mention that for public safety reasons, it is illegal in almost all first-world jurisdictions to connect equipment to the telephone system without proper approval and certification - which would be costly.

Hint: A good old "voice modem" with serial (RS-232) interface will probably do most of the job for you! And there are generally plenty lying around.

Paul__B: ... I do have to mention that for public safety reasons, it is illegal in almost all first-world jurisdictions to connect equipment to the telephone system without proper approval and certification - which would be costly. ...

1+

Work around:

Arduino Yun/Yun shield load Asterisk.

Asterisk is a software implementation of a telephone private branch exchange (PBX); it allows attached telephones to make calls to one another, and to connect to other telephone services, such as the public switched telephone network (PSTN) and Voice over Internet Protocol (VoIP) services.

DTMF is a piece of cake then.

Thanks for the replies guys.

I should mention that this will be running on a closed loop system. Its to patch into my buildings intercom and door entry system. I don’t have to worry about the telephone system.

The plan for this project is I can walk up to the front door of the building, buzz up to my unit, have this device answer, I will enter a 4 digits on the keypad and it will decipher and if the correct 4-6 digits are entered it will then send a “9” back to tell the system to open the door. This way between that and the home automation I have done I will no longer need to carry keys haha

I've built telephone line interfaces for years. I used to carry the Carterphone Decision WikiPedia HERE: around in my briefcase to show to unbelieving OutSide Plant Supervisors at various phone companies I worked with as a Broadcast Engineer.

It is not "Illegal" to build and connect your own devices to the switched telephone network (POTS). As long as (as the decision said), "as long as they did not cause harm to the system.". These days you see the community center holding "wire up your own telephone" classes with a bunch of everyone from kids to little old ladies. It's Over.

So what you basically need:

RING DETECT: A low-current Optoisolator with it's input LED in series with a small capacitor. I think I used .1 Uf in series with 1000 ohms). Try this first with a plain LED, capacitor and resistor. You should see the LED light on ring. OH: You need another LED back-to-back with the first one so the reverse voltage is controlled, or ZAP goes the LED.

The OPtoisolator output goes to an Arduino Digital input which you will be polling for RING.

AUDIO INTERFACE: - A small isolation transformer (ideally about 600 to 600 ohms impedance) whose primary is connected across the phone line in series with a 10 Uf or so Non-Polarized Capacitor (Can use two electrolytic capacitors back-to-back-opposite polarity for this). The isolated secondary winding gives you audio off the line. As mentionaed, old MODEMs have all these parts.

DTMF Decoder/Receiver: You send the audio signal to it. Maybe use a prebuilt module? http://www.futurlec.com/Mini_MT8870.shtml

These decoders give you 4 bits of "what button was pushed" and a "Valid Button" bit. Grab them as decide..

UPDATE: The schematic HERE: shows a capacitively-coupled approach with no transformer. See the article HERE:

You can start breadboarding this. One thing at a time. Stepwise refinement..

The POTS (Plain Old Telephone System) is it's own best defense. Open circuit is 48 VDC. Short Circuit is about 60 mA. Ring voltage is about 100 VAC at 20Hz which can jolt you but not kill you.

If anyone wants to send high-quality audio over the phone line, email and I'll dig out my 40 year old schematics. I designed and published Telephone Talk systems for Broadcasting before the Carterphone decision was a month old. Most small radio stations use the regular telephone system to send audio for remote broadcasts like football games back to the studio. Lately a lot is done on the web if that's available. When I first helped my Dad set up Broadcast Equipment at Yale Bowl in 1951, he had the phone company set up physical long line wired connections direct to the WELI studio.

A lot has changed in 60+ years :-)

I agree with Terry King. There are very simple and safe ways to connect to any telephone line, and the radio amateurs have been doing it for at least 50 years (not so much these days!).

The best and simplest way to go is to find a 600 ohm isolation transformer, which is in just about every telephone answering machine or Caller ID unit. Pick one up for $2 at a thrift store. A few other parts and you are done.

Google “pots phone patch interface schematic” or similar for lots of schematics. Here is one example.

I’ve attached a simpler circuit, used for a Caller ID that I made a long time ago.

phone600r.gif