Vintage Rotary Phone MIDI Controller

I’ve wanted to do something musical with a vintage rotary telephone for a while now, so when I happened to come across one in a charity shop, I jumped at the chance to have a go!

Be warned: there are many “vintage styled” modern phones with a pile of modern electronics inside.  This is not one of those – this is a genuine original phone.  You can easily tell if you get inside it – the electronics definitely look like something from the 70s and 80s.

On getting it home, I discovered that this one had been properly converted to be (still) usable on the UK phone system, so rather than my original plan of gutting it and adding an Arduino (like the majority of tutorials and projects you’ll find on the Internet), I wanted to find a way to use it without changing any of the circuitry or wiring inside.  This means trying to find a way to use it from the plug-in phone socket only.

This it the first in a series of posts looking at how best to do that.  In this post I describe the workings of the phone and what I plan to do with it.  If you are only interested in the final result – hooking up the Arduino and reading the dials, you may wish to skip ahead to part 2, although you’ll need to know how to wire it up as described later in this post first.

  • Part 1 – Understanding the telephone hardware and interfacing to an Arduino.
  • Part 2 – Decoding the rotary dial from the Arduino.
  • Part 3 – Rotary phone MIDI note controller.
  • Part 4 – Rotary phone MIDI program change.
  • Part 5 – Rotary phone MIDI random note sequencer.
  • Part 6 – Rotary phone to MIDI adaptor.
  • Part 7 – Rotary phone multi-mode applications.

IMG_5885

Warning! I strongly recommend using old or second hand equipment for your experiments.  I am not responsible for any damage to expensive instruments!

Extra Caution: You must NOT connect anything you’ve changed using any information in this or subsequent posts, or even the linked references (as I cannot vouch for their accuracy), to the public switched telephone network.

The information in these posts assumes a phone that was used in the UK. I don’t know if any of it translate across to another country’s systems.

If you are new to Arduino, see the Getting Started pages.

Parts list

  • Arduino Uno
  • “GPO” or “BT” original 746 rotary telephone
  • Optional: Scrap ADSL filter
  • 120kΩ resistor
  • Breadboard and jumper wires

Background: Inside a 746 Vintage Telephone

There is a fair bit of information around about how these phones work, but nothing that I could find that talked about the actual “on the wire” protocol in terms of how you could use it with a microcontroller.

Here are some resources for reading about the technical detail of these phones:

The original circuit is described in the “British Telecom Note” N846.  You can find scans of “issue C” of this note all around the Internet, but this describes the “original state” of the wiring before the UK telecoms system switched over to “plug and socket” wiring.  The official upgrade to a 746 phone consists of the following (as far as I can tell):

  • Reconfiguring some of the jumpers between the terminal connections (the T1 to T19 screw connections on the circuit board).
  • The reconfigured jumpers I believe will (among other things) isolate C1 and C2 (as this functionality is now meant to be in the master socket).
  • Ensuring the ringing circuit has a 4000Ω resistance, which means either swapping out the ringer circuit coils or adding a 3k3 resistor in series with the original coils.

This is the circuit from the N746 datasheet updated to use “modern” wiring (this is taken from the Vintage Telephone Wiring Schematics site – reproduced here for information – there is no implied statement of accuracy of correctness here – use at your own risk and certainly not for connecting to the public switched telephone network!).

GPO 746 Telephone Wiring Schematic

This seems to be exactly the arrangement in my phone.  More details can be found on the British Telephones site, although I repeat that any unofficial modification like that described does NOT allow you to connect it to the public switched telephone infrastructure.

IMG_5886

Given all this, on seeing that the wiring inside my phone has been officially updated, that the ringer unit was upgraded to proper dual-2000Ω coils, that it has a “Tele 8746 G; B.T.Q.C” sticker on it, and given at some point it also had a pre 01 UK area code and a 5-digit phone number (it was written on the reverse of the label), leads me to believe I have a proper, old, but usable-today unit.  And it does indeed ring and allow me to make and take calls, so my exchange must still support pulse-dialing (at least until 2025 anyway).

So, whilst there are a number of tutorials on the Internet about how people have rewired phones and installed Arduinos inside them, or taken out the rotary dial unit and used that directly, I was determined to see if I could find a way to use my phone “from the outside” without any changes inside at all.

The key is understanding a little how the four wires in the BT style “flat” socket are used.  Here are the resources I’ve found:

Of the six possible conductors in the flat plugs, only four have a meaning, and often only two or three are actually used:

  • Pin 2 – “Line B” – Red
  • Pin 3 – “Bell” – Blue
  • Pin 4 – “Earth” – Green
  • Pin 5 – “Line A” – White

The availability of a “bell” signal is really from the days when there was a separate link required to make the phones actually ring.  The “Earth” I think is only used when connected to a PABX, so goes unconnected in my phone.  These days, I believe there tends to be just two conductors to the “outside world” (the “A” and “B” lines) with the “bell” signal achieved via a modulation of the Line signals creating a third signal from the electronics within the phone master socket (via a “ring capacitor” I believe).

Pairing all this information with the previous circuit diagrams and the photo of my own phone, then it looks like I can maybe use the RED wire as an INPUT to the Arduino with the WHITE wire to GND and then the whole phone will act as a switch-to-ground when in use…

But the only way to really find out is to have a go!

BT Flat Phone Plug to Arduino

I could have done any of the following to gain access to the RED and WHITE terminals:

  • Remove the original lead and hook directly to the relevant screw terminals inside the phone (RED goes to T8 and WHITE goes to T18).
  • Cut the original plug off and access the RED and WHITE cables directly.
  • Find an old phone extension cable and cut off a BT style socket and expose the wiring that way.

In the end, I opted to use an old ADSL filter pcb as a “BT Phone Socket Breakout”, as I seem to have a fair few of these kicking around for some reason.  To do this, I did the following:

  1. Removed all components apart from the sockets from the PCB.
  2. Identified the four connectors from the BT plug.
  3. Soldered on the required cables. In my case I started with RED, WHITE, and BLUE, as I wasn’t sure if I’d need BLUE or not.  It turns out RED and WHITE are sufficient.

IMG_5888IMG_5889

That first photo shows an Arduino Pro Micro for scale.  As you can see there are some interesting possibilities there – but let’s not get ahead of things for now…

The test circuit for now is therefore as follows.  Note: this gets a minor update – see later!

ArduinoRotaryPhoneLink_bb

The Code – Part 1

At this stage, I’ve gone for total simplicity to try to see what is going on.  Here is the code I’ve used:

void setup() {
   pinMode(2, INPUT_PULLUP);
   Serial.begin(9600);
}

void loop() {
   Serial.println(digitalRead(2));
}

This literally just samples the IO pin that is connected to the RED wire and prints the value out, which will either be HIGH or LOW – i.e. 1 or 0, to the serial port.  This allows me to fire up the Serial Plotter and have a look at the signals directly.

Here is a sample trace, when dialing number 7.

RotaryPhoneDial

There are seven distinct pulses and a bit of noise.  This already has the phone off the hook.  When the phone is on the hook, the input reads a constant HIGH all the time.

This starts to give a hint at how the pulses might be decoded:

  • Look for the long HIGH going LOW, indicating the phone is now off the hook.
  • Count the sequence of pulses that follow for the first digit.
  • Do the same to subsequent digits, noting the longer gap between the last pulse from one digit and the first pulse for the next.
  • Notice when the signal goes HIGH for a long time again, signifying the phone is now back on the hook.

But exactly how best to do this will be the topic for the future.

Arduino and Telephone Tests

Whilst I don’t really understand the telephone’s circuit, I thought it would be prudent to take a few measurements to see if that makes it clearer what is going on.  Here are the current and voltage measurements across the WHITE and RED wires at various stages when connected to the Arduino:

  • On Hook: Constant 4.5V at ~9uA.
  • Off Hook: Constant 2.25V at ~80-85uA.
  • Dialing: Pulled round prior to release: 0V at ~155uA.
  • Dialing: Released: Pulses go from 0V (~155uA) to 4.5V (~9uA).

I don’t quite understand that “off-hook” half-voltage measurement, so this is my simplification of the Arduino/Phone circuit to help trying to think about what is going on.

IMG_5899

My primary initial concern was the current load on the Arduino… but actually those values should be fine.  The ATmega328 datasheet suggests a maximum current of 20mA for an IO pin (40mA for short periods at a push) and 100mA for VCC and GND.

The “on hook” switch is a normally open switch (open when “on hook”, closed when “off hook”) and basically just disconnects the WHITE cable when the phone is on hook.  This means the IO pin will simply read HIGH.  I’m not sure why there is a current measured across the RED wire (9uA) as I believe the only current should be through the Arduino’s internal PULLUP resistor from VCC via “leakage” into the IO pin.  The ATmega328 suggests a maximum current leakage of 1uA, but I wouldn’t be able to measure that from “outside” anyway I think?  So I’m probably missing something here, but given the levels involved I’m not too worried for now.

When “off hook” the switch is now closed and that completes the circuit.  RED is now connected to WHITE (GND) via the phone’s circuit, including passing through the MIC.  I’m guessing that the combined resistance of the phone circuit (through the MIC) is comparable to the resistance of the Arduino’s internal PULLUP resistor, so the circuit is acting like a potential divider – hence reading half-voltage at the IO pin.  The current reading on the RED wire is around 80-85uA, which presumably is a current from VCC to GND, so that is well below the Arduino’s limits.

When the dial is first turned, but not released, then the normally open “dial” switch is closed which shorts out the MIC. In this case, the voltage now reads 0V, and there is now a current measured on the RED wire of 155uA.  If this is now flowing from VCC via the telephone’s circuit (skipping the MIC) through to GND.

When the dial is pulsing, it is opening and closing the “dial pulse” switch, so is making and  breaking the circuit between the 0V/155uA state (with RED connected to WHITE skipping the MIC) and the 4.5V/9uA state (the telephone circuit is disconnected, so it is just the internal PULLUP reading HIGH).

My experiments seem to indicate that the “off hook” state can be read successfully by finding a HIGH to LOW transition, but with the resulting voltage of 2.25V feels a lot more by luck than judgement.  The ATmega328 datasheet describes the LOW state as being less than 0.3 x VCC and HIGH as being more than 0.6 x VCC.  Typically values of <1.5V and >3V are used for a 5V system, so this is directly within the “undefined” region.

If the phone circuit and the pull-up are indeed acting as a potential divider, then there are two possibilities:

  • Reduce the resistance of the phone circuit.
  • Increase the resistance of the PULLUP resistor.

The simplest option on the phone circuit is to mimic what happens when the dial starts – it shorts out the MIC which removes the MIC’s resistance from the circuit.  But if I’m trying not to change the telephone itself, then I might not want to do that.  It also permanently disables the MIC.  Another possibility then is to use an external PULLUP resistor instead.

The ATmega328 datasheet is a little vague on the value of the internal pull-up, but it says it is guaranteed to be between 20kΩ and 50kΩ so rather than try to calculate a value, I tried a few out to see what happens.

The compromise here is that as the resistance is increased, then the voltage for HIGH is reduced as well as the voltage for LOW.  It cannot be reduced below the minimum for a HIGH reading – i.e. 3V.  It will be acting as a potential divider with the INPUT pin’s impedance (well technically it won’t that is too simplistic as I understand it, but there will have an interaction and that will do for now).

There are several calculations suggested in various tutorials for calculating pull-ups but I’ve not really found any that were particularly useful…

In the end, I just tried a few resistors and made some measurements and found the following.

PULLUP ON HOOK OFF HOOK
V uA V uA
10k 4.5 – 4.75 8 4.0 – 4.25 524
33k 4.25 – 4.5 9 2.0 – 2.25 81
51k 4.25 – 4.5 8 2 56
100k 3.5 – 4.75 8 1.75 – 2.0 30
120k 3.5 – 4.25 7 1.75 25
220k 2.5 – 3.5 6 1.50 – 1.75 15

So it looks like an external pull-up of 120k gives me a HIGH reading of >3.5V and a LOW reading of <1.75V.  That still isn’t perfect – ideally it would be <1.5V – but it is a lot better than 2.25V!

This therefore leads to the following updated circuit and code.

ArduinoRotaryPhoneLink2_bb

And the new code just uses INPUT mode rather than INPUT_PULLUP.

void setup() {
   pinMode(2, INPUT);
   Serial.begin(9600);
}

void loop() {
   Serial.println(digitalRead(2));
}

The results are largely the same, but I believe the off-hook indication will be a lot more reliable when I get that far.

In fact, I actually went one step further and updated my BT plug breakout to include the pull-up resistor, so now it simply has three connections to the Arduino:

  • 5V (the BLUE wire – I just reused what I had)
  • GND (WHITE)
  • Signal (RED)

So here you can see it going “off hook” then dialing three.

RotaryPhoneDial2

Closing Thoughts

This is a great start.  I was concerned that I’d have to compromise the internal wiring somehow in order to get a signal out from the phone, but it looks like I won’t have to do that at all now as the on/off hook and dialing pulses are plainly visible to the Arduino.

I did try to work through the circuitry to work out how applying a signal might work “through” the phone, but in the end gave up and just starting having a go.

There may still be a better option at some point, and I don’t know what those components are making of the signal from the Arduino’s side – they are used to a -48V or -50V signal on the RED cable for example, but I think I get an appreciation at the top level of what is going on.  I suspect most of that circuitry relates to the “AC” side of the phone – the part involving the MIC and ear-piece.

Kevin

IMG_5897

Leave a comment