Shop OBEX P1 Docs P2 Docs Learn Events
Telephone Ring Detector — Parallax Forums

Telephone Ring Detector

agentileagentile Posts: 101
edited 2005-04-08 13:02 in BASIC Stamp
Hello,
· I am looking for a method of using the BS2 to function as an auto-dialing pager system.· The auto-dialing part is easy.· Where I am having troubles is trying to determine the line status.· I'd like to be able to determine:

Is the phone ringing?
Is the phone busy?
Has the phone been answered?

I would like to do this using the COUNT command and a BS2 input pin.··· I am using a circuit very similar to the one in the BS2 manual on page 109, under the DTMFOUT command.· Once I get the signal into the stamp, the code will be straightforward, but I haven't been able to get the BS2 to count.· It doesn't seem to recognize the ringer tone.· I have tied a BS2 pin to the transformer through a series 1k resistor and .1uF cap.· It seems that I should have plenty of voltage available on the transformer during a ring.· But apparently not enough to register in COUNT.· Any ideas?· I know that I can buy a ring indicator, but I would like to do this with software if possible.

thanks,
agentile

Comments

  • steve_bsteve_b Posts: 1,563
    edited 2005-04-05 00:04
    There are hundreds of old modems floating around. You certainly don't need anything too fast.
    IF you get one, you have access to all sorts of built-in commands to determine status...AND, you can easily 'talk' to it with a serout function on the bs2.

    Parallax also sells their modem-appmod (Cermetek modem) that does a similar thing.

    This also gets around the fact that anything connected to a phone line has to be certified!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve
    http://ca.geocities.com/steve.brady@rogers.com/index.html
    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."

    Post Edited (steve_b) : 4/5/2005 2:48:42 PM GMT
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-04-05 14:05
    Yes, the phone company gets kind of irritated if you put non-certified equipment on their phone lines. And they charge you if your non-certified equipment starts a fire, or causes your in-home equipment to fail.

    Since an old 2400 baud modem is less than $50, and has the status signals you are trying to generate, AND has a dialer, AND deals with ringing, AND can auto-answer, it seems like a really good way to go. If you want battery powered, the StampModem App-Mod is available too.
  • agentileagentile Posts: 101
    edited 2005-04-05 15:47
    Thanks for the advice.· But this is not about trying to·save money.· If I were, I could buy an entire answering machine for 1/2 the cost of the stamp.· I am trying to figure out how to determine a ring and a busy signal using a small amount of circuitry and the BS2.· Can anyone help me with this?



    thanks,

    Andrew
  • steve_bsteve_b Posts: 1,563
    edited 2005-04-05 16:00
    The ring is probably the easier part.· 100odd volt ringing voltage!?· Just use a comparator.· OR are you talking about the you 'ringing' someone else?

    The busy signal....I'm thinking you'd need to listen for the sound on that one.

    And we weren't talking about an answering machine.· And as far as saving money....you probably won't save much after you buy the parts you need...but it's the amount of time it might take you to interface properly.

    I hooked up an old 14.4k USR modem in about an hour!· Once you know the AT commands, you can do all sorts of stuff.· And if you are setting up a paging system, this is quick and easy AND certified to be connected to Ma'Bells lines!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve
    http://ca.geocities.com/steve.brady@rogers.com/index.html
    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-04-05 16:19
    Yes, we're not talking about money here. We're talking about liability. We're talking about time. We're talking about re-inventing the wheel with a possibly illegal interface.

    But you don't have to listen to us. It is actually good that you are willing to spend the time and expense to go your own way. We've recommended a solution which is simple, quick, and effective. The fact that it happens to be cheap is not really that important.

    As an engineer, or even as an experimenter, it's good to know where you want to invest your time. I'm sorry I don't have a better answer for you regarding direct connection to phone lines.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2005-04-05 16:47
    You may want whats called a phone recorder, radio shack sells them, it provides a line level interface to the phone line. The one they sell has a manual switch to control the direction of the signal (inboud, outbound) but replacing this with an analog switch IC would place it under the control of a micro.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
  • agentileagentile Posts: 101
    edited 2005-04-05 16:55
    Steve,

    ·I have heard that I should be getting about 100VAC on the circuit side of the phone transformer.· I have·a functioning circuit right in front of me, and I am not even getting 5V.· This is where the difficulty lies.··I don't want to damage the stamp by hitting it with 100V, assuming that I am getting 100V.· But, if I am not getting 100V, then a comparator would provide a nice TTL signal that I can count.· Do you know for sure that I will get 100VAC on the circuit side of the transformer?· Currently, I have two zeners (3.9V) back to back across the transformer to stop spikes.· But even without that, I never saw any voltages above 5 V, even during the ring.·



    agentile
  • steve_bsteve_b Posts: 1,563
    edited 2005-04-05 17:03
    Agentile,
    I don't know the exact 'ringing' voltage you shoudl expect. I've heard between 80 and 120Vac.
    If you are worried about killing your stamp...then optoisolate it! Use some high rated clamping zeners to keep the voltage low enough that you would kill your optoisolator...but if you do...who cares, you're stamp is still ok!

    That's probably one of the better ways to 'save' your stamp from possible deadly voltages....now, you are a different story! Be aware that someone can call your line at any time (doesn't matter if it's unlisted...wrong numbers do occur) and if you have your hand in the wrong spot you'll be lucky if you just get a small burn!
    If you live in the country, be aware that lightning doesn't have 'enough' places to go to dissipate....there were two rules at my boss's cabin: wait for the phone to ring twice before picking it up! and if you hear a knock at the door, ask who it is before opening it (bears tended to visit his porch at night!).

    As allan has said, and I've concured....you might invite liability if you err by accident. Take down the local lines and nobody in your area can call 911 if they need (worse case example).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve
    http://ca.geocities.com/steve.brady@rogers.com/index.html
    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • SPENCESPENCE Posts: 204
    edited 2005-04-05 17:16
    Andrew

    i assume you are wanting to check the status after you dial the number.

    There are ic's which do that exact function. Busy,out of order, malfunction line, ringing, service order. Sorry i can not remmember which manufacturers make them.

    Google is your friend. Use it.

    73
    spence
    k4kep
  • SPENCESPENCE Posts: 204
    edited 2005-04-05 17:18
    For a authorized and inexpensive interface do a search on messages parallax forums for "daa" from my id.

    It is legal and cheep

    spence
    k4kep
  • SPENCESPENCE Posts: 204
    edited 2005-04-05 17:24
    FORND THE OLD MESSAGE.

    COMMERCIAL DAA (DATA ACCESS ARRANGEMENT) WITH FCC APPROVAL.

    CHEEPEST I HAVE FOUND IS FOLLOWING. ABOUT $40 & S&H

    http://www.broadcastboxes.com/mpc-2.html

    BY CIRCUIT WERKES IN FLORIDA

    INSTRUCTIONS AND DRAWINGS AVAILABLE ON THEIR WEB SITE.

    73
    SPENCE
    K4KEP
  • DburnDburn Posts: 3
    edited 2005-04-06 02:23
    Years ago I built a simple ring detector using a neon bulb in series with a 50K ohm resister across the phone line. Then used a photo transistor to watch the neon bulb. The ring voltage is the only voltage on the phone line high enough to fire the neon bulb. And the current pulled by the Neon bulb is too small to be detected by the phone company.
  • jktexjktex Posts: 2
    edited 2005-04-06 03:33
    The phone company uses a voltage drop to detect when a phone is off hook. the normal voltage is about 70 volts dc then when you take the phone off the hook it goes down to about 54 volts dc. You might be able to use a opamp to compare the voltage to see if the phone is in use.

    remember to check the laws. The last time I looked it is illegal to direct connect a curcuit to the phone line when powered with house voltage.
  • agentileagentile Posts: 101
    edited 2005-04-06 12:53
    Dburn,

    So, let's define what a "ring" voltage is.· There is an incoming ring and an outgoing ring.· I want to figure out how to detect an outgoing ring.· I am talking about the signal your phone receives when you dial out a number, and the dialed·phone is ringing.· I have determined by experimentation that this signal is very·small, less than 1/2 volts, and has a frequency of about 450 Hz.· Does this·sound correct?·

    agentile·
  • SPENCESPENCE Posts: 204
    edited 2005-04-06 13:21
    Bell (bsp) spec is 48 volts on hook and off hook should be about 12 volts dc depending on the distance from the central office(co). This is caused by the loop resistance.

    If a phone company is using 70 volts on hook they will burn up connecting companys equipment if they use coppper interconnect.

    73
    spence
    k4kep
    ex central office chief
  • jktexjktex Posts: 2
    edited 2005-04-06 22:00
    your probably right Spence it has been a long time since I messed with phones. Maybe it was the ring voltage that is 70 volts ac. Is that right?
  • DburnDburn Posts: 3
    edited 2005-04-07 00:55
    Yes, I was talking about incoming ring voltage. It seems that what you are after is the "RING BACK TONE" I don't think you would be able to detect this as any specific voltage level as it is a "OFF HOOK" audio tone. Usually about 440+480Hz 2.0s ON 4.0s OFF I think you would need circuitry to detect this dual frequency tone.
  • SPENCESPENCE Posts: 204
    edited 2005-04-07 06:33
    Ring voltage is about~~ 100 volts ac @ 20 hz.

    If anyone dosn't believe it. Just hold it while i jangle your line. Ha ha.

    73
    spence
    k4kep
  • agentileagentile Posts: 101
    edited 2005-04-07 13:53
    Dburn,

    · Ring back tone is exactly what I was looking for.· Unfortunately, I didn't know the proper terminology.· This tone is, as you said, a combination of 440 and 480 Hz.· It has a very small amplitude, less than 0.2 volts.· The busy signal is also a two-frequency tone, something like 480 and 650 Hz.· But I don't think detecting frequency is the easiest method (of course, the easy method is to buy a chip, or buy the whole device for a few dollars) of determining the difference between ring and busy.· Here is what I have come up with so far.· If you run the incoming signal into a high gain audio amplifier (gain high enough to cause saturation), the resulting output wave begins to look like a square wave, with a small DC offset.· The DC offset is just high enough to cause false triggering in a TTL device.· So that signal is run through a diode to drop some voltage.· If the resulting signal is run into an AND gate, or some other TTL buffer, the resulting output is a consistent square wave.· The frequency of the wave won't matter.· It is the cadence of the wave that matters.· The busy signal is on for 1/4 second, and off for 1/4 second.· And the ring is on for 2s and off for 4s.· So, let the AND gate output drive the trigger of a monostable 555 with a period of 0.3 seconds.· Then upon the first high signal the 555 sees, the output of the 555 will go high and stay high for 0.35 seconds.· If the 555 is low after 0.35 seconds, then either the phone has been answered, or·the phone is receiving a busy signal.· If the 555 is·still in a high state after 0.35 seconds, then it must have been triggered again, which means that the triggering signal had·to have been longer than 0.35 seconds, or a ring signal.· This is still in an experimental state, but so far so good.· Now I just need a code to sort out the details.



    agentile
  • DburnDburn Posts: 3
    edited 2005-04-08 07:04
    Agentile,
    I'm impressed with your tenacity in figuring out your own phone line monitoring method!

    Is the answering voice "hello" going to retrigger the 555 and cause problems?
  • agentileagentile Posts: 101
    edited 2005-04-08 13:02
    Dburn,

    · Good question.· I just thought of that myself.· But for the moment, I will just have to pretend that the person answering the phone won't say hello.· I would think that the answering of the phone will put a considerable spike on the line, and maybe this is also worth analyzing.·

    This project·is intended to act as a remote plant manager (plant as in factory).· The short term goal is to get the BS2 to·monitor the temperature in a room.· If the temperature·passes a certain·limit, then the BS2 will call the number of a person in charge of the plant and send three beeps into the phone.· For now, I will have to ignore the fact that the person might say hello.· The long term goal is for the BS2 to send the actual temperature over the phone line to another BS2 tied to the receiving phone.· The receiving BS2 will display the temperature on an LCD.



    agentile
Sign In or Register to comment.