Posts

10 Output Shift Registers

Image
By this stage I'm nearing the point where pretty much everything needed to connect a call over two phones is in place; on the source phone I can detect OH (and potentially send a dial tone) as well as detect a dial pulse train. On the destination phone I can send it ringing current to operate the bells and detect OH if the call is answered. What I'm going to need next are some outputs to activate the relays to bridge and route calls, send ringing current and operate the dialing tones. So it pretty obvious I'm going to need many more outputs than the ones available on the Arduino. To get round this I'm going to use a couple of daisy chained  SN74HC595's   shift registers to give me 16 outputs for the price of three on the Arduino, as shown below. I end up with an output map something like this... #define C595SourceRly1 1  // 1 to 8 will operate the relay matrix #define C595SourceRly2 2 #define C595SourceRly3 4 #define C595SourceRly4 8 #define C595DestRly1 16 #define ...

9 Ringing and Answering Phones

Image
Andrews circuit design to detect when a ringing phone has been answered actually gave me a fair amount of trouble to understand. If I'm honest I would confess I still don't really understand on a technical level exactly how it works, more that it does "work". But what really didn't help was not realizing that there are two types of transistors, PNP and NPN, and for a long time was using the wrong one - no wonder it wouldn't work! I guess we learn by our mistakes and once I had it figured out I was up and running. Andrew was very helpful during this time patiently answering all my questions. As Andrew explained, and I hopefully I have this right, the way I see it is that the 47 ohm resistor generates a small current before the destination phone is answered, enough to stop the base on the transistor passing current. When the phone is answered the base current flows to earth activating the transistor which in turn activates the photo cell in the optocoupler which...

8 Tone generation

Image
Every decent telephone system needs to give feedback to it's user as to it's current operational status. This ha s been done since  time immemorial  by using progress tones. I only need three types of progress tones; a  steady tone for showing the exchange is ready for a call, a ringing cadence progress tone, usually two short bursts of tone separated by a second, and a "fast busy" cycling tone to show a false number has been dialed. So what we will need is some way to generate these tones and have them fed to the user operating the phone.  I'm sure there are very many ways to generate a simple sine wave but I have a job lot of NE555 timer IC's so that's where I'm going to start. Using a NE555 timing calculator (this one  is my favorite as you can enter the desired frequency and it will generate the options for the resister/capacitor combination to achieve it). I'm not too concerned about the cycle lengths since I'm going to feed both outputs ...

8 Input Shift Registers and Pulse Dialing

Image
On the Arduino I have only a limited amount of IO pins, 20 in all. This would probably be enough pins if I just wanted 4 inputs for call sensing, 2 for pulse and off hook detection and the rest to operate the relays but I want to add a DTMF transceiver and to connect to an outside line so I'm going to need quite a few more. Enter stage right the  74HC165 shift in register for the inputs. This has 8 inputs which will be configured as per the map below... #define ShIn_L1_OH_Pin 128 // call sense line 1 #define ShIn_L2_OH_Pin 64  // line 2 #define ShIn_L3_OH_Pin 32 #define ShIn_L4_OH_Pin 16 #define ShIn_OH_Pin 8 // source phone off hook and used for the pulse dial train #define Dest_Phone_OH_Pin 4 // call answered, ie destination phone off hook //#define Call_Progress_Pin 2 // not used #define External_Ring_Pin 1  // incoming call from outside exchange #define SHIN_CLEAR 0  // used to check no inputs are active With the shift register IC at the top right, below shows t...

7 Call Sensing

Image
Now I have power I can start to building the first component of the exchange - call sense control. I add in the the 3w 1k resistor that will feed power to the four lines. When a handset is lifted the line is energized and so will operate the quad ILQ74 optocoupler that will eventually fit into the 16 pin socket. Below the socket are the diodes, the 1w 1k resistors and 10k pull-up resistors for each line that will operate the optocoupler. Also present is the 4 way socket that will hold the  Panasonic AQW210EH  solid state dual relay  the will switch out the call sense lines once a handset is lifted. The other relay will be used to "bridge" the source and destination phones between the radial capacitor when a call is connected.  The lesson to learn here is always check the data sheet as I made a mistake in the wiring feeding the optocoupler. From the picture above I have the feed going from top to bottom, in on pin 1, out on 2, in on 3, out on 4 and so on. In rea...

6 Pwr Supply

Image
So the first thing to do is find a decent transformer. I think the telephone exchange gods must have been smiling on me the day I started my search on eBay as pretty quickly found me a decent 240v to 36v/18v transformer for a reasonable price that would be just the job. A few days later it's mine and we are ready to go.  For the 36v feed, DC conversion is via a bridge rectifier and ripple removal by use of a 1000uf capacitor which I think gave me around 44v DC. I used a LM317  VR. and arranged the resistors to give me pretty much 36v, as near to the required 40v on Andrews design as I can get. This is at the very limits of the VR but it seems to work ok. When I do get to connect a phone I do get a bit of hum but it's not too intrusive. I recently found out much better ripple rejection can be achieved using a capacitor multiplier, so maybe that's something for version III.  The other rectifier and capacitor are for the 18v feed that I'll use for the 5v components via ...

5 The Plan Revisted

Image
So by now I've made a couple of projects and gained a good understanding the ways of the telephone network. Based on what I had learnt what would be nice would be to revisit the Plan 7 and think of a way to make it work properly, as it was designed to work. What I really needed was some kind of method to get connected into something that would detect the dial pules, de-code them and route calls to the desired phone on a telephone network. And the same thing but going in the other direction. Then I could use the extension phone properly in that I could dial out from it and transfer calls to it. What I really needed was a DIY telephone exchange. So really the point to this blog is that I just wanted to make a few notes about my journey from knowing nothing about electronics and telecom systems to actually building a working telephone exchange of my own.  I'm afraid it's not going to be a detailed "how to" type of thing and I'm not going to release any of my cod...