I'm working on (another) project: I need to hack an old rotary phone and when the proper number is dialed, a dry contact is activated. The phone IS NOT connected to any phone line.
when people are picking up the phone, I want to generate/simulate the "Call Progress" tone, to make the illusion even better.
has anyone ever done this with an Arduino ? Is it possible ?
the "Call Progress" tone seemed to be made of 350HZ and 440 HZ, but I couldn't figure out the duration of each frequencies and the pattern.....
I found a chip made by Clare, M-991, that is supposed to do that, but it is fairly expensive and rare ....
Do you need a dial tone when the handset is picked up?
Do you need to actually be able to talk and listen?
Is there another phone to talk to?
Or is this just some kind of limited simulation?
There are many circuits you can find with Google image search for telephone line simulator or similar terms.
It would seem easy enough to simply connect the phone to a digital input pulled up to VCC.
Then the phone will pull the pin low when you pick up the handset.
And the pin will go high as a series of pulses as each number is dialed.
You can write a sketch that will sense off-hook, and then dialed numbers.
You could create the two-frequency tone with a dual 555 timer chip (or similar) and some rather simple R/C filter/mixing circuit. And it would be easy enough to use a digital output from your Arduino to turn the tone(s) on or off.
The phone is not going to be used on a phone line or connected to another phone to talk to.
It's going to be a props for an escape game: player pick up the phone, hear the tone then dial a specific number. If the number is right, a relay will activate.
I have already hacked the phone. Since it's a rotary phone, I can simply count the pulse. Off-hook is also easy.
The call-progress is made of 2 frequencies that seems to be blended together. Would I be able to take 2 outputs and connect them to the same speaker ?
I was planning on using the tone() instruction. It is my understanding that tone() will generate square wave. Is there a way to distort/modify so it look a bit more like a sine ?
A low-pass filter will round off the corners of the square wave. That's what you are doing when you wire a speaker to a tone() pin. The speaker can't transmit the high frequencies into the air so you hear a sort-of pure tone.
2 outputs should not be connected together. And the tone library can only play one at a time.
I would brute-force it. I would get an MP3 shield and play a recording of the correct sound.
If you aren’t too concerned about the audio quality, you can generate the dial tone using a single digital output by, in effect, simulating a 1-bit waveform. To do this only requires figuring out the times between zero-crossings of a real dial-tone signal and then using those to toggle the digital output. The resulting sound is very noisy, as must be expected with such a low quality signal, but it might be enough for what you want to do.
I had already written a PC program to generate WAV files with multiple tones so it was easy to generate a file with the 350+440Hz of a dialtone. I modified the code to print out where the zero crossings occur and some of that output was then pasted into the tone_zeroes array.
This code was tested on a Teensy 3.2 but should run unmodified on a Nano or Uno.
It has been a long time since I've worked with phones, but you may also need battery to get the receiver work. Can you take a line level signal, drive it into the phone, and hear it in the receiver? If not, you may need an amp or -48v (that is what the phone system uses) in order to hear the tone.
You may program many, but only one is "working" at a time.
here's an extract from the Arduino's web site, when looking at the "Tone()" instruction.
"Only one tone can be generated at a time. If a tone is already playing on a different pin, the call to tone() will have no effect. If the tone is playing on the same pin, the call will set its frequency."
That may be true for that library, but there are ways to generate multiple simultaneous frequencies (not very high frequency, but in the low end of the audio range, it can be done). Look into using counters or interrupts as possible ways to do multiple things at the same time.