Telephone interface questions


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    Mar 2010
    Location
    Los Angeles, CA
    Posts
    13

    Default Telephone interface questions

    Greetings!

    I'm working on a personal project that involves interfacing a PIC micro to the telephone and dialing out a specific phone number using DTMF tones generated by the PIC. I am using a 16F876A and am following a schematic I found in the old Basic Stamp Nuts & Volts articles (NV 19 Fig 19-1, see attachment). I have recreated the circuit verbatim with the following exception:

    -I am using .1uF capacitors and 100 ohm resistors on the tip and ring lines in place of relays/switches

    I have constructed the circuit and written a really simple PBP program just to see if I can connect, shown below.

    Given all of this, the circuit doesn't work. The code sends the tones to the speaker and to the LCD, so I know that's working, so it's something in the circuit. I have read on this forum that for phone circuits the oscillator should be 20 MHz, but I will admit I haven't tried that yet. I'll do that later today/tomorrow. Just wanted to get this out there in case anyone saw something glaringly wrong with the circuit.

    I'd appreciate any advice anyone can provide, troubleshooting the circuit, etc.

    Code:
    ' PIC16F876 to predefined connections:
    '
    ' PIC 		    LCD		Other Connections
    ' ------		-------		-----------------------------          
    ' OSC1			Resonator - 4 mhz
    ' OSC2			Resonator - 4 Mhz
    ' MCLR			Vdd via 1k resistor
    ' Vdd			5v
    ' Vss			Gnd
    ' RB2           Output to serial LCD
    ' RB4           Output to speaker
    ' RB5           Output to phone line
    
    ' -----[ Revision History ]------------------------------------------------
    '
    ' ----[ Includes / Defines ]-------------------------------------------
    '
    INCLUDE "MODEDEFS.BAS"  'This statement is needed for serout defines.
    
    Define LOADER_USED 1     'Only required if bootloader used to program PIC
    'define osc 20               'Oscillator speed is 20 MHz
    
    ' -----[ Constants ]-------------------------------------------------------
     
    ' -----[ Variables ]-------------------------------------------------------
    '
    ' -----[ Initialization ]--------------------------------------------------
    '
    ' -----[ Main Code ]-------------------------------------------------------
    '
    
    Start:
        serout 2,N2400,[254,1]
        serout 2,N2400,["DIALING...",254,192]
        pause 1000
        DTMFout 4,[1,8,1,8]
        DTMFout 5,[1,8,1,8]
        serout 2,N2400,[#1,32,#8,32,#1,32,#8]
        pause 1000
        Goto Start              ' Loop back and do it all again
    Attached Images Attached Images  

  2. #2
    Join Date
    Oct 2004
    Posts
    440


    Did you find this post helpful? Yes | No

    Default

    You can send the PIC tones to the phone handset microphone circuit and read tones from
    the handset speaker circuit if it is easier.

    Norm

  3. #3
    Join Date
    Mar 2010
    Location
    Los Angeles, CA
    Posts
    13


    Did you find this post helpful? Yes | No

    Default Telephone Interface - Got it working...

    Woo hoo!

    I got it working. I had incorrectly wired one leg of the transformer. I dialed out to a couple of phone numbers successfully. I used the default 4 MHz oscillator.

    I'm a bit of a novice at this, so you'll excuse my excessive enthusiasm over seemingly trivial successes...

    I noticed that after dialing out and ending the call, I must disconnect the phone cord from my circuit and reconnect it to a real telephone. Once I confirm a dial tone, I then connect the phone cord to my circuit again and confirm that there is a dial tone in the phone. Then I reset the PIC and it dials out. I'm guessing this has something to do with on-hook/off-hook states. Would a dialing IC in the circuit permit changing the on/off hook states using the PIC? Any recommendations?

  4. #4
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hi Skarr,

    Just pic'ed up on your post. Have to go to work now but will get back to you tonight on this.

    I'm doing the same type of project.

    BobK

  5. #5
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Smile

    Hi Skarr,

    If you put a relay in the circuit as indicated then you wouldn't need to plug and unplug your circuit to the phone line. Your program would include a line to turn the relay on such as:

    PortB.1 = 1 'turn line seizure relay on

    Then when you are ready to disconnect from the phone line you would program:

    PortB.1 = 0 'turn line seizure relay off

    Line seizure refers to a relay that disconnects the house phones and connects the phone line to the dialer. This prevents someone from picking up the phone in an attempt to block the call. Then there is another relay with contacts in series with one side of the phone line that would be closed then the dialing would take place. When the phone call is completed, then both relays would be turned off. The phone line is returned to the house phones until the next call out.

    You will need to drive the relay circuit with either a transistor or with a driver package like the ULN2003 or ULN2004.

    I have been in the alarm business for a long time and I am quite familiar with dialers and their circuitry and inner workings. I finally decided I wanted to design and build one of my own just for the heck of it. I am in the beginnings of the design phase and will be happy to share ideas with you on this. I've been getting other work related projects out of the way so I can focus more on the dialer project.

    HTH,
    BobK

  6. #6
    Join Date
    Mar 2010
    Location
    Los Angeles, CA
    Posts
    13


    Did you find this post helpful? Yes | No

    Default

    Thanks for the response, BobK. I appreciate your assistance.

    I do have a few solid state relays but I'm not sure if they'll work in this application. I think I have some schematics for hooking this up; I'll stumble through and if I encounter a problem I may ask for some help...

    As far as my project goes, I'm helping an aunt with a resuce/service dog. In order to get certified the dog has to perform higher-order functions like dialing a phone in an emergency situation. So essentially it's a dialer circuit with pre-programmed numbers, a large button or two to initiate the call, a small speaker, maybe a small LCD and a microphone, all packaged in an enclosure.

    There are special phones that can be purchased, but at $300, I found that rather offensive and agreed to build something homebrew, convinced that this type of device could be made for well under $50 in parts. So I'm progressing slowly through this, learning as I go.

    Next up is connecting the relays, and adding the switches and microphone. That should keep me busy for a little while.

    What are you building?

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts