Using Arduino as a relay

I'm looking for some guidance here. I have a project that senses DTMF tones and depending on what number is pressed there are 7 wires and that need to be connected in 12 different combinations that correlate to the 0-9 * # on the phone. The voltage on the wire is 3.3V at .27μA.

I'm a newb at this and assumed that this part would be easy. Sort of a (please forgive the ugly pseudo code): If DTMFtone = 3 connect pin7 to pin5 else do some other thing; But now I'm stumped.

Is this even doable on the Arduino? If not, any suggestions as to what I should google to get me going in the right direction?

If the plan is to make the Arduino act like a human pressing a keypad button, then that is not easy. It takes a fair bit of external circuitry.

There is probably a better way to do what you want, if you will tell us more about the project.

Hi,
google dtfm decoder

I think you assume that the DTFM tones are monotones, that is each button has one unique frequency, that is not the case, each button has two tones mixed so a simple frequency counter sketch would not be able to give you what you need.

Tom.... :slight_smile:

If it's an actual phone, you can just pass the DTMF audio to the phone, and the exchange will do the decoding for you. :slight_smile:

TomGeorge:
Hi,
google dtfm decoder

I think you assume that the DTFM tones are monotones, that is each button has one unique frequency, that is not the case, each button has two tones mixed so a simple frequency counter sketch would not be able to give you what you need.

Tom.... :slight_smile:

I am using a MT8870 DTMF tone decoder chip in this project. I tried doing the decoding in the Arduino, but it was unreliable. With the MT8870 it gets the number right every time.

jremington:
If the plan is to make the Arduino act like a human pressing a keypad button, then that is not easy. It takes a fair bit of external circuitry.

There is probably a better way to do what you want, if you will tell us more about the project.

jremington - you are correct I essentially do want to make the Arduino press a keypad button. The project is to interface an old analog paging system with a modern SIP phone system. The SIP side is "easy" and it will generate DTMF tones all day long, but it is also fussy. The paging system uses a non-standard dial tone frequency. To a human the dial tone sounds funny, but the SIP system's FXO port ignores it because the frequency is out of range.

The analog paging system is basically its own PBX and uses old school telephone technology. So that means it has 48VDC on hook voltage and requires and a 7VDC button press voltage. It doesn't "hear" the DTMF tone without that voltage being applied to the line. My plan was to use an inexpensive analog phone to isolate the Arduino and handle the DTMF tone generation and voltage. The 7 wires refer to the columns and rows for the buttons on the handset. I can simulate button presses by shorting the correct wires.

So, that's it in a simplified nutshell. Ideas or suggestions how to get an Arduino to "press" a button greatly appreciated.

Here’s a thought I had - create a matrix switch using 7 NPN transistors as shown in the attachment. When one transistor is chosen from the row and column respectively would it allow current to flow and create the button push needed?

Is there a name for this arrangement? Googling “matrix switch” gets me a bunch of video switchers. An integrated circuit would make things easier if I could find one.

You need to understand the details of how the pushbutton matrix on the original equipment actually works before you can design a button pressing interface.

Very likely the original device scans one set of the wires (by applying a voltage to successive wires) and looks for current flow to one wire of the other set.

What are the polarities and values of the voltages and the currents between the individual wires when open and when a button is pressed? What are the scan timings? You will need an oscilloscope to analyze the timing.

Note: it is generally not safe to connect an Arduino to externally powered equipment, because of possible ground loops, and especially unsafe if voltages > 5 V are present. You will probably need to use optocouplers to make connections.

Why not 12 nand gates (3 * 74AHC00) and 12 inverters (2 * 74AHC04) ?
You can run them from up to 7V according to the data sheet.

nand gates etc. won't work if, as is typical, the original device scans one set of the wires (by applying a voltage to successive wires) and looks for current flow to one wire of the other set.

A 4x3 matrix of reed relays would work.

jremington:
You need to understand the details of how the pushbutton matrix on the original equipment actually works before you can design a button pressing interface.

Very likely the original device scans one set of the wires (by applying a voltage to successive wires) and looks for current flow to one wire of the other set.

What are the polarities and values of the voltages and the currents between the individual wires when open and when a button is pressed? What are the scan timings? You will need an oscilloscope to analyze the timing.

Note: it is generally not safe to connect an Arduino to externally powered equipment, because of possible ground loops, and especially unsafe if voltages > 5 V are present. You will probably need to use optocouplers to make connections.

Well the frequency counter on my multimeter is the closest thing I have to an oscilloscope. (and it shows no activity but that doesn't mean anything.) But, in the end does it really matter if the cheap analog phone is scanning the wires? I can tell the polarity of the flow, so as long as the switches are closed for a long enough the current can flow, right? I'm only trying to replicated the press of a human finger so precision isn't really needed.

And your point about using optocouplers is well taken, and they could easily replace the NPN transistors in my drawings.