Hi,
I am building a project that detects telephone touch tones via the handset jack on my land-line telephone and then plays tones to the input of the telephone. I do not want to break the telephone nor my arduino. I am using this library (https://code.google.com/p/rogue-code/wiki/ToneLibraryDocumentation) to play the tones.
It says:
WARNING Do not connect the pin directly to some sort of audio input. The voltage is considerably higher than a standard line level voltages, and can damage sound card inputs, etc. You could use a voltage divider to bring the voltage down, but you have been warned. You MUST have a resistor in line with the speaker, or you WILL damage your controller.
So I just tested it today, and I found that the output it way too loud. I hooked up the multimeter and it showed **~**1.2 volts DC. I understand that is way above the peak level of a line level input.
I experimented with adding a 10k and a 1k resistor between the capacitor/resistor and the telephone's handset input.
NOTE: I am using the top right portion of this Minus the 33mH inductor schematic:
The Wikipedia article confused me, but when I looked into the citations, I found this video: Voltage divider tutorial | Afrotechmods - Fun with electronics!.
I ditched the original schematic and made my own voltage divider. The volume got low enough that is was softer than the I didn't even need the capacitor!
I experimented with different resistor values with the equation in the Windows Calculator.
I got it down to this: 5v * (220 / (220 + 10,000)) = 0.02152641878669275929549902152642
The 5 volts is from the output of the Arduino.
OK, I added it in. It works fine. I attached the new schematic.
It seems that the circuits I originally mentioned aren't really working without some tweaking.
The input circuit isn't working. This time, though, I'm not sure if it's the libraries I'm using or the circuit. Both the DTMF and Goertzel libraries that I found haven't produced results.
I found this: http://interface.khm.de/index.php/lab/experiments/arduino-frequency-counter-library/. It looks like a good library, but I have no clue how to use it. It has two schematics. Which one should I use? Do I need to look into using an FFT? If so, how would I use it? I don't own the 100N capacitor, transistor, or the inverter. I would have to make yet another trip to Radio Shack.
Or should I use the left part of this schematic (I don't own the 100k resistors or the 4.7nF capacitor):
No you put the capacitor in the wrong place. It needs to be in parallel with the resistor connected to ground to act as a low pass filter.
The input circuit isn't working.
How do you know this?
The input circuit is the left hand side. If you haven't got the two 100K resistors then what do you have? I can only comment on what you have.
All the input circuit does is to allow the signal to appear as a 2.5V biased signal. The size of the input signal will determine the range of readings you can get. If you have too much signal it will clip and distort, too little and the readings will not show enough variation to do anything with.
Have you measured the signal at the analogue input with an oscilloscope?
OK, I have two telephones hooked together with telephone cable. I am using a 9v battery to power them. I have effectively made an intercom. On the handset jack on one of the telephones (2.5mm or 3/32), there is input, output, and ground. I am connecting the output circuit to the input of the telephone. Ground is connected to ground on the arduino. The output of the telephone will connect to the input of the arduino. Basically, I want to plug a line-line, normal headphone output into the analog input of the arduino. The output of the arduino is what is 1.7 to 1.9 volts DC. I connected the multimeter to the output and ground of the telephone.
I just tested it again in AC. it stays at 0 and then goes up as I press buttons and talk into the other telephone. When I press a button (a tone) it goes to 0.3 volts AC. When I blow loudly into the mic, it goes up to about 0.86 which might be the peak. I am starting to understand this. It is an analog signal wave. So, it has to be AC.
I will bye the parts and build the oscilloscope later. However, I might be able to borrow one from a friend.
I just tested it again in AC. it stays at 0 and then goes up as I press buttons and talk into the other telephone.
That sounds like what you would expect to see, good.
When I press a button (a tone) it goes to 0.3 volts AC.
So assuming it is 0.3V RMS then that corresponds to a peak voltage of 1.414 * 0.3 = 0.432V
That is then sitting on top of your 2.5V bias giving you a positive peak of 2.932 and a lower one of 2.068V
That means you should get a reading from your analogue input of between 600 and 424 ( it is 5 / 1024 volts per reading step )
That looks like a reasonable sort of signal to sample, are you seeing these reading swings on a tone?
Ok, so I hooked it up to A0 and loaded the AnalogReadSerial example. when nothing was being pressed, it output 99. When a number was pressed it would jump between 85 and 109.
The next time I tried it, it was at 72. When I pressed a button it would jump between 56 and 82.
Finally, I tried it with a 1K resistor in between A0 and the telephone. Both times I reset it, it was jumping from 73 and 74. When a button was pressed, it would jump around between 67 and 83.
Once again, thank you so much for helping me with this!
That would suggest that you have not got the input circuit wired up like you showed in the diagram. You should get a reading of about 500 with no input signal. This is because the analogue input is being held at the half way point between the +5V and the ground at 2.5V. Take a DC voltage measurement at the analogue input and you should see it at 2.5V.
Ok, so I re-wired up the circuit and the Arduino gave a reading of 509 and 510. I tested the circuit with the multimeter and it now gives off 2.5v DC. Thank you!
I tried the DTMF library to no avail. The Goertzel algorithm library, when set to 697hz lit up the LED when almost any number was pressed. At least now I'm getting a reading. Should I start a new forum page for helping me with the library?
Glad it is working.
However the Goertzel algorithm is only good for one specific tone, here you want to detect up to eight. If it fires with any key then perhaps the threshold is set too low.
There are special chips you can get to decode DTFM I think you might be better off using one of them. or use a full FFT.