I have an issue with the detection of the DTMF tones. When I try with audio archives through my computer, I have no problem, but when I connect my phone, nothing is detected. I don´t know why.
What I have in mind is to connect one phone to my arduino board, with voicemail active, then if there is an incoming call, the voice mail pick up the call and because of this is allowed to dial the tones. For example 001 wich turns on the heating.
But without detection through my mobile I am blocked, what can I do?
bowline77:
I have an issue with the detection of the DTMF tones. When I try with audio archives through my computer, I have no problem, but when I connect my phone, nothing is detected. I don´t know why.
What I have in mind is to connect one phone to my arduino board, with voicemail active, then if there is an incoming call, the voice mail pick up the call and because of this is allowed to dial the tones. For example 001 wich turns on the heating.
But without detection through my mobile I am blocked, what can I do?
Thanks for your help in advanced
You would probably have to show us how you are attempting to connect to your telephone line. Actually most countries/telephone companies have laws and rules about how equipment can be wired to the local subscribers loop, as it's a balance line and you are not free to ground either the tip or ring wire. Normally equipment manufactures use approved chips/modules/components to do such electrical interfacing to the line called DAA modules. These usually involve a 600 ohm 1:1 transformer as well as ring detection/protection components. Keep in mind that the ring voltage when your phone rings is a 90 VAC 20Hz signal that can easily blow up components wired directly to the phone pair.
So I would suggest you do a little goggling for telephone interfacing circuits to see what you should be using.
I have used El_supremo offered drawing and I connected a mobile phone with the audio jack so I don´t have the issue of a landline connetion (this is another point that I want to check out)
corolla9:
hi i have an update its working.
is there a way that can i decode 6 inputs in parallel?
el_supremo:
The code could be modified to handle six inputs but it would slow down the sampling rate quite substantially which would change the characteristics of the detection.
A better way to handle the audio sampling is to use a timer interrupt and do the detection on-the-fly but in either case you would probably need a faster processor to handle six channels.
Pete
Parallax Propeller could decode to 7 parallel channels with little external circuitry & leaving one of the COG's for serial back to an arduino.. A propeller chip (P8X32A) has 32 I/O, fully digital, analog input can be accomplished via sigma-delta conversion. There are actually 8 separate MCU's called cog's inside of one chip, this is how the propeller can do real-time parallel processing
There is an IC part# MT8870. It is a DTMF decoder that will provide a Data Valid signal and 4 bit binary output. all it requires is about 100 MV of clean audio, 5 V and a 3.58 MHz color burst crystal.
Here is a link from "Futurlec"that " appears to do a great deal.. and cheaper too @$12.98..
Hi,
I'm trying to use el_supremo's DTMF library. No matter what I do, I can't get a reading/signal from it.
I am wiring up the handset output of my telephone with this schematic:
DTMF.cpp gets compile errors for me. I use the current version of the 'arduino' package from the Fedora 'updates' repository on Fedora 20. Perhaps something has changed in the avr-gcc compiler. I get error message:
unable to find a register to spill in class 'POINTER_REGS'
The line causing the error is:
dtmf_mag = sqrt(Q1Q1 + Q2Q2 - coeffQ1_Q2); I fixed the problem by splitting up this expression into 3 lines: float tmp; tmp = Q1*Q1 + Q2Q2; tmp = tmp - coeff*Q1Q2; dtmf_mag = sqrt(tmp); Griff_
Pete, it is possible that your library can decode CTCSS tone? this guy make something that : Private Site
but this radio can't read DTMF tone or i made a mistake ?
The library is specifically designed to decode the 8 DTMF tones. Decoding CTCSS tones is much more difficult because in some cases they are less than 3Hz apart whereas the DTMF tones are at least 70Hz apart.
If you were aiming to decode only a few of the tones and could choose a few that were much further apart, it can be done, but trying to decode all of them is probably impossible on an Arduino without external hardware.
The code compiles with Arduino version 1.0.6 but it appears that there is a bug of some sort in the compiler in versions 1.6.0 and 1.6.1 - probably related to the -Os flag.
I have a workaround. Replace the entire DTMF:detect function in the DTMF.cpp library file with this:
// return the magnitudes of the 8 DTMF frequencies
void DTMF::detect(float dtmf_mag[],int adc_centre)
{
int index;
float d_tmp;
/* Process the samples. */
for (index = 0; index < N; index++)
{
ProcessSample(testData[index],adc_centre);
}
// Calculate the magnitude of each tone.
for(int i=0;i < 8;i++) {
// El_Supremo 150318 the compilers in Arduino verisons 1.6.0 and 1.6.1
// generated "unable to find a register to spill" error in the original statement
// here. Breaking it into pieces worked around the problem.
// dtmf_mag[i] = sqrt(Q1[i]*Q1[i] + Q2[i]*Q2[i] - coeff[i]*Q1[i]*Q2[i]);
// This is the equivalent of sqrt(real*real + imag*imag)
d_tmp = Q1[i]*Q1[i];
d_tmp += Q2[i]*Q2[i];
d_tmp -= coeff[i]*Q1[i]*Q2[i];
dtmf_mag[i] = sqrt(d_tmp);
}
ResetDTMF();
}
I didn't notice/remember the report of the same problem in message #24 by griff2a until after I'd found a fix. My first attempt at splitting up the statement was similar to his but it didn't help so I had to split it even further.
Let me know if this works for you. I will update the link to the library.