Trying to Use A BS2 With a Phone
RubrChicken
Posts: 39
I'm trying to get a BS2 to dial a phone, without destroying a phone. I got a little plug, the same type of the handset. I press one on the phone, and run this code:
out PIN 0
GOSUB dial
dial:
DTMFOUT out,1000,500,[noparse][[/noparse]*,*,*,*,*,*,*,*,*,*]
I can hear the BS2 dialing through the speakerphone, but its really noisy. I hear a loud buzzing sound on top of the dialing. Eventually, I get a "you call could not be completed" or a "if you'd like to make a call, please hand up and try again". I've tried to ground all the other pins, but that actually makes it worse!
Whats wrong?
Thanks
out PIN 0
GOSUB dial
dial:
DTMFOUT out,1000,500,[noparse][[/noparse]*,*,*,*,*,*,*,*,*,*]
I can hear the BS2 dialing through the speakerphone, but its really noisy. I hear a loud buzzing sound on top of the dialing. Eventually, I get a "you call could not be completed" or a "if you'd like to make a call, please hand up and try again". I've tried to ground all the other pins, but that actually makes it worse!
Whats wrong?
Thanks
Comments
If you attempt to connect a Stamp directly to some kind of phone, you can destroy the Stamp. You might damage the phone as well. It's very unlikely that you will get it to work. There are devices called a DAA (data access arrangement) which are specifically designed to let a microcontroller connect (through the DAA) to a phone line. These have voltage level conversion circuitry and protective circuitry inside since you can get high voltages on the phone line, particularly during ringing (let alone electrical storms).
There's a brief article on the Wikipedia about DAAs here: en.wikipedia.org/wiki/Data_access_arrangement
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
If you use the acoustic coupler or the hands-free jack, be sure to include the low-pass filter network as described in the Basic Stamp Manual under the DTMFOUT or FREQOUT commands. If you use the hands-free jack, you will need to attenuate your audio level and use a DC blocking capacitor so it can be properly fed into the mic input.
It is generally not a good idea to connect your circuit, however it is built, directly to the telephone line, or through a corded handset jack. The buzz you heard is most likely the ground potential difference between your house and the telephone switch - this is why all telephone equipment is internally electrically isolated when it requires electrical power (cordless phones, modems, fax machines, etc.) Not to mention there are dangerous voltages present on the line most of the time, and the potential for surges during electrical storms. There are also regulations regarding the connection of electronic equipment to the phone line to prevent interference to other customers.
You still can't directly connect the headset jack to the Stamp unless you know what kind of headset is required. I suspect that you could use a small transformer to couple the Stamp to the microphone input of the phone. That would isolate the grounds, yet couple the audio signal. You probably will need a volume control since the signal from the Stamp is probably way higher than a microphone would provide. You don't want to overload the phone.
Use an external·modem (available on surplus market, baud rate is unimportant for just dialing·)··and connect the Stamp via serial port. Send the proper dialing codes ( ATDT....) to the modem. Look up Hayes modem codes on the web. Than you can monitor the modem progress responses.
There in no need "fooling around" with Stamps DTMF codes·(and proper digit timing) in this case, unless it is your objective of course.
You did not elaborate what you want to do after dialing and connection is established.
Vaclav