Shop OBEX P1 Docs P2 Docs Learn Events
Connecting a phoneline to the propeller - Help? — Parallax Forums

Connecting a phoneline to the propeller - Help?

Matthew BurmeisterMatthew Burmeister Posts: 49
edited 2009-06-11 15:41 in Propeller 1
How would i connect the propeller to a phone line? i saw the BS2 circuit in Nuts and Volts, But i don't have a transformer or zener diodes.

Post Edited (Matthew Burmeister) : 6/6/2009 6:58:10 PM GMT
«1

Comments

  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-06-06 19:08
    Tell us a little more about what you are trying to do?
    Dial the phone, detect touchtones, etc.

    BTW: Ring voltage can potentially fry your Propeller.
    (and smarts if you catch it in the teeth. {don't ask.})

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • localrogerlocalroger Posts: 3,452
    edited 2009-06-06 19:28
    Matt, you can pick up an old external modem dirt cheap, and connect to it via RS232 (many schemes have been offered). If you just want to sniff the line voltage you can use a series resistor to limit the current and either build a voltage divider to tell whether the volts are above or below a threshold, which can detect things like sound activity and ringing, or you could use the delta sigma ADC to do a more nuanced reading of the line voltage.

    If you want the prop to actually be able to pick up and put data on the line, you will need to use transistors, or even better opto-isolators. The phone line is a current loop; you pick the phone up ("off hook") by shorting tip and ring through about a 300 ohm resistor, and you modulate the outgoing signal by varying the resistance. The Prop could probably emulate one of the old 300 or 1200 baud modems pretty easily, but the faster protocols involve some pretty fancy modulation which really isn't worth the effort when you can get used external 56K Hayes compatible modems for ten bucks at the flea market.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-06-06 19:29
    If you are trying to dial the phone then you will need to do a dial-tone-multi-frequency. Thats about the extence of my knowledge. smile.gif
    @OBC: I defy your plead not to ask. smile.gif I am very curious. smile.gif

    P.S. On the Basic Stamp diagram it uses a 220V "Sidicator". What is that??????

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Toys are microcontroled.
    Robots are microcontroled.
    I am microcontroled.
  • localrogerlocalroger Posts: 3,452
    edited 2009-06-06 19:58
    microcontrolled -- that's DUAL tone multi-frequency. There are single-chip solutions that will convert DTMF to a digital "Mom I hear it" signal; they've been around forever, I used one to make a pen register out of a Sinclair ZX81 back around 1985. The Prop can probably also do DTMF detection using the technique the guy used to build the audio spectrum analyzer, since you only need to tell whether 8 frequencies are present or absent (think 4x4 grid for 16 keys).

    I know whereof OBC speaks on ring voltage, since I used to work on phone equipment. The standard voltage on a phone line that is on-hook (not in use) should be around 40 VDC. When you pick up the phone, it should drop to around 20VDC. In practice this varies wildly, but nominally neither of these voltages will shock you.

    But when the phone rings, the ring signal is over 100VAC superimposed on the line. (If you are using a line set that can convert audio on an on-hook line, it will also make an EXTREMELY LOUD NOISE.) Working on phone stuff it's easy to fall into the habit of touching conductors without worrying about shock, but when you happen to grab one that's ringing it WILL GET YOUR ATTENTION. This is why OBC warns of it frying your propeller; it can pack some decent current since that signal was meant to turn a mechanical motor in a mechanical ringer mechanism back in the day, but if you use large enough series resistors you can safely hook your prop up straight to the phone line. You'll need to do that anyway to drop the nominal line voltage to something between 0 and 3.3V for threshold detection or ADC.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-06-06 20:05
    Oops.... That was a typo with the dial instead of duel.

    I never thought about why the ring voltage would be so high... but that makes since now.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Toys are microcontroled.
    Robots are microcontroled.
    I am microcontroled.
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2009-06-06 20:10
    localroger is right...

    I used to have the bad habit of stripping wire with my teeth...

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Visit the: The Propeller Pages @ Warranty Void.
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-06-06 20:43
    Oh.... THAT is how you got it in the mouth. smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Toys are microcontroled.
    Robots are microcontroled.
    I am microcontroled.
  • Matthew BurmeisterMatthew Burmeister Posts: 49
    edited 2009-06-06 20:51
    i was thinking of using resistor voltage divider. But how to deal with the AC? Anyways, i hoping to create is something like a home automation system.


    i already made a DTMF and pulse dialing object, but can i get a link to the spectrum analyzer?

    Post Edited (Matthew Burmeister) : 6/6/2009 9:05:48 PM GMT
  • Matthew BurmeisterMatthew Burmeister Posts: 49
    edited 2009-06-06 21:25
    microcontrolled said...
    Oh.... THAT is how you got it in the mouth. smile.gif

    i have a digital phone modem, so i'll just disconnect it. [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Misses 8 bit computing
  • localrogerlocalroger Posts: 3,452
    edited 2009-06-06 22:28
    Spectrum analyzer: http://forums.parallax.com/forums/attach.aspx?a=15639

    There are two basic ways to deal with the AC. One is to rectify it and put it on another pin through an even bigger dropping resistor or voltage divider; this is what most commercial solutions do to get "hey the phone is ringing" as a digital signal. The other is to leave a little headroom in the voltage divider feeding your ADC and just treat it like a very big analog signal that comes along sometimes. It IS AC at about 20 Hz (though that varies too, it's never as high as 60 Hz or as low as 10 Hz) so if your dividers give ADC at most half its max output value with any normal line event, and you suddenly see it max out periodically with that kind of period, hey the phone is ringing.
  • Matthew BurmeisterMatthew Burmeister Posts: 49
    edited 2009-06-06 23:21
    localroger said...
    Spectrum analyzer: http://forums.parallax.com/forums/attach.aspx?a=15639

    There are two basic ways to deal with the AC. One is to rectify it and put it on another pin through an even bigger dropping resistor or voltage divider; this is what most commercial solutions do to get "hey the phone is ringing" as a digital signal. The other is to leave a little headroom in the voltage divider feeding your ADC and just treat it like a very big analog signal that comes along sometimes. It IS AC at about 20 Hz (though that varies too, it's never as high as 60 Hz or as low as 10 Hz) so if your dividers give ADC at most half its max output value with any normal line event, and you suddenly see it max out periodically with that kind of period, hey the phone is ringing.

    Can't find the it in the object exchange, nor could i find it by searching. help?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Disclaimer: I cannot guarantee any information i post is accurate, but most of the time, it is correct.
    Misses 8 bit computing
  • Matthew BurmeisterMatthew Burmeister Posts: 49
    edited 2009-06-06 23:42
    Oldbitcollector said...
    Tell us a little more about what you are trying to do?
    Dial the phone, detect touchtones, etc.

    BTW: Ring voltage can potentially fry your Propeller.
    (and smarts if you catch it in the teeth. {don't ask.})

    OBC

    dial phones, plus detect touchtones

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Disclaimer: I cannot guarantee any information i post is accurate, but most of the time, it is correct.
    Misses 8 bit computing
  • localrogerlocalroger Posts: 3,452
    edited 2009-06-06 23:51
    Matthew: It's not in the obex. Paste the http://forums.etc. link into your browser's url bar. Unfortunately it's a Word 2007 file, so if you don't have a compatible version of Word or OpenOffice you won't be able to read it. (In fact, I can't read it on my personal computer I'm using to type this, but I saw it on a work computer that had the app.)
  • Matthew BurmeisterMatthew Burmeister Posts: 49
    edited 2009-06-06 23:55
    i can open the the file, I'm just looking for the object/demo. (Although i did read the file)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Disclaimer: I cannot guarantee any information i post is accurate, but most of the time, it is correct.
    Misses 8 bit computing

    Post Edited (Matthew Burmeister) : 6/7/2009 12:49:39 AM GMT
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-06-07 07:55
    Easiest to get an old modem and use the DAA (data access arangement) from it. That is, the isolation transformer, the isolated off-hook switch (usually an optoisolator), the current hold (usually a transistor/fet circuit with resistors and capacitors to create the complex impedance required), and a ring detection (usually another optoisolator). The audio is passed through the transformer, so detecting tones incoming and sending tones out are done via the transformer. It is an FCC requirement the DAA be approved before connection to the PSTN (public switched telephone network). There must be about 1500v isolation between the telephone line and your equipment which is why a transformer and 2 optoisolators are typically used. There are other ways, but this is the easiest.

    FYI: I designed many modems in the 80's and 90's including the Apple 2400.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2009-06-07 09:55
    Over here in the UK ring is 17Hz 80 Volts, often it was mechanically generated and so was more of a square wave and so had nasty spikes on the edges.

    I always found that a nice peppermint hurt less.
  • Matthew BurmeisterMatthew Burmeister Posts: 49
    edited 2009-06-07 21:05
    Cluso99 said...

    FYI: I designed many modems in the 80's and 90's including the Apple 2400.

    Wow Nice!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Disclaimer: I cannot guarantee any information i post is accurate, but most of the time, it is correct.
    Misses 8 bit computing
  • Matthew BurmeisterMatthew Burmeister Posts: 49
    edited 2009-06-08 02:19
    I've decided to use a bridge rectifier, then a voltage/current limiting resistor, and then a transistor on the TIP so i can connect/disconnect. any thoughts on what resistor i should use? 1 Mega Ohm?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Disclaimer: I cannot guarantee any information i post is accurate, but most of the time, it is correct.
    Misses 8 bit computing
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-06-08 02:49
    You really should use the isolation transformer and an opto. Etal 1165, 1200 or equivalent. Optoisolate (or relay) for the current hold. You will need to sink between 25mA and 90mA and will be dependant on the length of line from the exchange. It needs to be a complex inpedance otherwise you will get distortion. I used a FET as a constant current source for 1200 through to 36000, but unfortunately I cannot remember exact details. Thinking about it, I must have used a bridge and yet I cannot remember it.

    Perhaps there is a circuit in one of the magazines. The impedance matching is extremely important as the modem speeds were increased, especially 9600 to 56000 baud.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • dMajodMajo Posts: 855
    edited 2009-06-08 13:19
    Hi,

    Have a look at these: The firsts two are DAA the third is a complete single-chip modem

    enjoy
  • Cluso99Cluso99 Posts: 18,069
    edited 2009-06-08 14:48
    @dMajo: Nice find. I mainly used Rockwell chipsets. In the 90's Rockwell had an integrated AT command set, but in the 80's I programmed 68705 for this.

    For a simple 300 or 1200 modem it is probably doable with the Prop. However, without a good understanding of mathematics and dsp programming, much higher than this will not likely be doable.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBladeProp, SixBladeProp, website (Multiple propeller pcbs)
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: Micros eg Altair, and Terminals eg VT100 (Index)
    · Search the Propeller forums (via Google)
    My cruising website is: ·www.bluemagic.biz·· MultiBladeProp is: www.bluemagic.biz/cluso.htm
  • Matthew BurmeisterMatthew Burmeister Posts: 49
    edited 2009-06-08 20:48
    i'm not trying to transmit data, just trying to receive DTMF tones and transmit voice playback.

    I'm thinking of using a relay (radio shack doesn't carry optos). is this the correct isolation transformer i should use? www.radioshack.com/product/index.jsp?productId=2103994

    anyways, i have a small budget. (being 15 doesn't help at all)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Disclaimer: I cannot guarantee any information i post is accurate, but most of the time, it is correct.
    Misses 8 bit computing

    Post Edited (Matthew Burmeister) : 6/8/2009 8:55:21 PM GMT
  • kwinnkwinn Posts: 8,697
    edited 2009-06-08 20:57
    Matthew, you really should use the DAA to connect to the phone line. In a lot of places it is required by law, and any phone company will be very unhappy with you if they catch you connecting without using it.
  • Matthew BurmeisterMatthew Burmeister Posts: 49
    edited 2009-06-08 21:23
    Yeah, it doesn't look like comcast likes having Unauthorized devices on their lines, might as well look for a old modem and take the DAA out. i'll go look to see if i have any old modems.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Disclaimer: I cannot guarantee any information i post is accurate, but most of the time, it is correct.
    Misses 8 bit computing
  • Matthew BurmeisterMatthew Burmeister Posts: 49
    edited 2009-06-08 21:49
    Seems like i don't have any old modems, so i'll just use the DAA circuit from here [url=http:// http://www.eetindia.co.in/ARTICLES/2002MAR/2002MAR01_ICD_PL_ID_AN01.PDF?SOURCES=DOWNLOAD ] http://www.eetindia.co.in/ARTICLES/2002MAR/2002MAR01_ICD_PL_ID_AN01.PDF?SOURCES=DOWNLOAD [/url]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Disclaimer: I cannot guarantee any information i post is accurate, but most of the time, it is correct.
    Misses 8 bit computing
  • MicrocontrolledMicrocontrolled Posts: 2,461
    edited 2009-06-08 21:56
    I have a bunch of old computers and I have many unused dial-up modems from them. If this is what you are talking about then I would be glad to give you one, they are useless to me. I have not been able to afford a microcontroler-designed modem ether. (and being fourteen dosn't help ether [noparse][[/noparse]quote]) smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Toys are microcontroled.
    Robots are microcontroled.
    I am microcontroled.
  • Matthew BurmeisterMatthew Burmeister Posts: 49
    edited 2009-06-08 22:08
    microcontrolled said...
    I have a bunch of old computers and I have many unused dial-up modems from them. If this is what you are talking about then I would be glad to give you one, they are useless to me. I have not been able to afford a microcontroler-designed modem ether. (and being fourteen dosn't help ether [noparse][[/noparse]quote]) smile.gif

    Thanks microcontrolled!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Disclaimer: I cannot guarantee any information i post is accurate, but most of the time, it is correct.
    Misses 8 bit computing
  • dMajodMajo Posts: 855
    edited 2009-06-09 09:18
    Matthew,

    the advantage in using single-chip DAAs is the approvals(certifications) they have. In case of large scale production it is cheaper to build the I/F circuit by yourself and then get the approvals the telecom companies requires to let you connect to their lines.

    When the production quantity is low or single it is simpler to use an already approved DAA. (These modules are not IC. They are hybrid modules with build-in isolation transformers and any needed components). And because your final stage is approved also your product is approved. When you consider risks of damage to your product (propeller) you should also consider the risks of damages to telecom network (which reparation will be billed to you)
  • Clock LoopClock Loop Posts: 2,069
    edited 2009-06-09 13:50
    Something like this would go a long way. For many people I think.

    CH1786 - Cermetek modem. (this is a 5v model)
    http://www.digchip.com/datasheets/download_datasheet.php?id=231400&part-number=CH1786

    INTRODUCTION
    The CH1786 family of modems are a full function,
    FCC Part 68 approved 2400bps modem. These
    modems provide a fast, easy and flexible way to
    integrate a modem into any OEM product while
    utilizing the minimum amount of PCB space (1.01 ”x
    1.27 ”x 0.52 &#8221[noparse];)[/noparse]. The CH1786 family only requires two
    external interfaces: a CCITT V.24 serial interface that
    can be routed directly to a UART, and a Tip and Ring
    interface which goes directly to an RJ-11 jack for the
    PSTN line connection. The CH1786 can be
    controlled with industry standard AT commands and,
    hence, is compatible with available industry
    communication software.
Sign In or Register to comment.