D-I-Y 2-Line PBX

Worried that your old 102's, 202's, and 302's will be "outlawed" at some point by greedy Telco's, forcing you to "upgrade" all your equipment to the latest Eastern Electric apparatus lining the shelves at your local Wal-Mart?

Nervous about the coming tidal wave of digital and VOIP integration and what effect it will have on your old phone collection?

This project is a complete two-line digital PBX that you can build yourself for less than $20 (if you already have a PC with sound card). When finished, you'll have VOIP in three protocols, voice mail, IVR, MOH; see here for a more complete list of features.

If you don't want to go the construction route, there are ready-made commercial solutions (known as FXS cards) also available...


Features

. Interfaces to standard (500 type) phones
. Supports up to two lines (via PC stereo sound card using L and R channels)
. Allows rotary (pulse) or DTMF dialing (autodetected)
. Uses Asterisk, a full VOIP PBX available as free software
. DIY equivalent to 2-port FXS (Foreign Exchange Station) card
. Cost should not exceed $20 (excluding PC and sound card)
. This document as well as all related software is made available at no charge
. This version does not handle ringing or caller ID

Hardware

Fig. 1 (Battery Feed Circuit)

Fig. 2 (Hook State Detect)

Fig. 3 (Audio Interface / Hybrid)

Fig. 4 (+9V Reg.)

Fig. 5 (+4.5 Reg.)

Parts List
R14.7K
R215-22 See Note
R3, R5, R6, R8, R910K
R42.2K
R722K
R10560
R1120K Var.
R12270
R131.5K
R14,R151K
R16100
C1,C2,C4,C51 uF
C32 uF
D1-D41N914 / 1N4148
Q1-Q22N3906 / PNP
Q32N3904 / 2N2222A / NPN
U1-U21/2 TL082
U3LM317

Notes
1Trim R11 for null
2Adjust R2 to set loop current
3C1-C3 must be non-polarized
4Connect +V of U1/U2 to +9V, -V to 0V
5If building a two-line version, you will need two of everything shown

Circuit Description

Loop current to the phone is supplied by a constant-current source (Fig. 1). D1-D2 and R1 form a voltage divider that sets the Q1 emitter voltage at 1 diode drop below the supply. Loop current is thus roughly 0.7V / R2.

Note that the Bell System recommended loop current range is 23-80 mA.

Fig. 2 shows a circuit for detecting the off-hook / on-hook state and feeding the result to the PC's RS-232 (input) port. Connect channel 0 to the DSR lead, and channel 1 to the DCD input lead.

Fig. 3 shows the audio interface circuit. Audio from the PC is fed thru C1 via amplifier U1 and to the line via R10 and C3. Audio from the phone goes via U2 to the PC. The circuit also acts as a "hybrid", suppressing energy applied at the input from appearing at the output of U2. If the null is imperfect (you can adjust via R11), the remote caller will experience an "echo".


Circuit Improvements Etc.

One possibility would be to feed U1/U2 from +9V and -9V instead of a +9V/0V supply. (In that case, feed 0V to R5 and R11 instead of 4.5V).

Similarly, you might change the battery feed circuit by adding another current source (make a mirror image of Fig.1 using an NPN transistor and connect the bias source to -9V, and connect the Ring side of the line to the collector of this new stage instead of to ground). If this is done, you may also have to make changes to the hook state detect circuit (Fig. 2). Also, note the battery feed circuit is missing a foreign voltage protection circuit.

An early prototype of this circuit omitted the regulated 9V supply and instead connected to the +12V bus of the PC directly. This provided an extremely interesting "machine" background noise, audible to both parties (especially during disk activity) but ultimately it seemed better to eliminate it.

Of course, it would be nice to also provide ringing current...

In the prototype version built by the author, I can't seem to null the hybrid perfectly, and the result is an echo. Can someone help? Perhaps a capacitor between the U2 "+" input and ground? But I couldn't seem to fix...


Software

You must first install asterisk.

A modified channel driver is also required. Download here in       .ZIP format       .tgz format   (Start with the README file)


Disclaimer

This information and associated software are believed to be correct but are supplied WITHOUT WARRANTY. Use at your own risk.


Comments? Email ikj1234i at yahoo dot com
  Accesses since 01/04/05