Bakelite to the Future - 1950s rotary phone ESP32 bluetooth headset
Edit: since creating this post I've also created a video about this project on YouTube. See it below or jump straight into all the details below.
Here's a very beautiful antique rotary phone. It's a Dutch PTT phone model called simply "1950".
But, what's this at the back? A USB-C port?
A peek inside shows us some weird things! How did that LiPO battery get there?
Ok let's quit the jokey intro, this was all me. I've had this phone for about 15 years and over the last couple of weeks I've converted into a fully functioning Bluetooth headset using an ESP32 microcontroller.
In this post:
- 1 - Features
- 2 - Lessons Learned
- 3 - Pictures and story! of how it got made (scroll down!)
but first...
Does it work?
This morning was the first Google meet I've used it in:
A participant reported on the sound quality
"I didn't know how much I missed the different sound quality! Beautiful. We could hear you very well, not distorted. I wish I recorded your speech ehehe"
I could hear them very well too, so I consider this a great success!
Get the source code on Github jtwaleson/bakelite-to-the-future-esp32
Features
If you count the hours and multiply it by my hourly rate, this is BY FAR the most expensive phone I've ever touched. But you get a lot:
- The buzzer works when you are dialed (but not if you are dialed on Whatsapp?)
- The rotary dial can be used to dial complete phone numbers
- The red button connects / disconnects my phone
- The red button connects / disconnects my laptop
- The two indicators indicate Bluetooth usage (bottom) and an active audio connection (top)
- Lifting the horn or putting it down picks up / hangs up call. If no number is dialed you are connected too Google Assistant/Siri.
- It has a 1500mAh battery lasting for about 1 day. I didn't implement any power savings. As it's mostly a gimmick and easily connected to usb-c for charging this is fine.
- Most importantly: I can once again slam down the phone if I'm having an angry phone call. Which I never have, but still.
Lessons Learned
I have some new skills under my belt:
- I2S protocol and its many flavors, and how finding the right components is tricky (the software only supports variant left-shifted, but this chip only support Philips! So have to order new parts, look at datasheets and wait 3 days)
- An oscilloscope and function generator are great tools!
- This is my first ESP-IDF project, so getting to use that stack was fun. It works quite well!
- You are on your own. Even though the ESP32 community has tens of thousands of people, there's not many people that have tried out this part of the stacks. Poorly documented functionality and missing integrations all around. However, Espressif has great people on Github.
- Why flyback diodes are needed and what inductive loads are. (Yes I am a beginner).
- The difference between MOSFETs (voltage controlled) and BJTs (current controlled) and NPN (low-side switching) and PNP (high side switching).
- How simple rotary dials are.
- How class-d amplifiers work. I vaguely knew this, but now I learned why there's no common ground in class-d amps and that you need that if you have a headset, because the mic and speaker will share a common ground over a three-wire connection.
- Super glue can be removed with nail polish remover.
Pictures and the story
The un-opened phone and connection box. I bought it for like 10 euros in a second hand shop 15 years back. Actually it had 3.5mm audio jacks because I already tried to convert it 10 years ago into a wired headset. Now we are going to do much better!
It's pretty full on the inside! You can see my wires for tapping off the audio signal made with UTP wires. The phone originally had two lines and you could switch between red and black. I don't know what the white buttons were used for. I'm going to use them for * and # DTFM codes and some other hacky stuff.
The indicators on the bottom left look weird, but we'll get to that.
The speaker and microphone look like this. I suppose they can be upgraded later.
It was made by a company Standard Electric in The Hague.
And of course the PTT (Dutch postal service, for Post, Telegraph and Telephone)
Was it made in 1965? The model is called 1950.
Ok let's start dismantling it with my fantastic soldering iron that heats up in 4 seconds (pro-tip, buy this 150 euro Aixun T3A T245, it will blow your mind)
Wires are loose, I'll re-use them later.
And this? I don't know what it does but there were two of them. If you want them feel free to reach out.
There is no sensor for the horn, but I would like one, would this work? The answer is no.
Hooking them up to power and controlling them with some simple BJTs. They also make a nice clicky sound when switching on/off.
It works. The controlling wire (yellow) takes 0 mA. This is safe to use by the GPIO on the ESP32.
Let's try a lot of switching with a signal generator. It works, but what are these huge voltage spikes I seen on my scope?
And no more voltage spikes. |
Let's prepare all the buttons etc for connecting.
Ok the signal that the HFP_HF library sends is weird, the microphone is not compatible. I went with a WM8782 ADC based board instead. I also bought a DAC , because the first I2S board I bought was a class D amp and I need a common ground one. The new DAC/ADC boards can both be figured to "standard" left-aligned 16 bit i2s signals and don't need any further amplification.
The microphone in the headset was an electret and with +5V and a 4.7k Ohm resistor, hooked up via a tiny capacitor to the ADC, produced good results.
I spent like two full days trying and learning about the microphone and I2S and could tear my hair out at some points. Without on oscilloscope to see what's actually going this would have been impossible.
On the other hand, the rotary dial was super simple. One power (or ground) and the other one line gives a long pulse (while not at rest position) and the other pulses for each digit. The code to interpret this was like 10 lines.
Starting the put everything together. I used an ESP32 T-Koala dev-board. The newer ESP32 chips (like C3/C6 etc) don't have classic bluetooth so you'll need to pick one that has both BLE and classic BT.
On the top you see the buzzer which needed 7 volts, so underneath there's a voltage booster from 5 to 7 volts configured with a switching NPN MOSFET.
On the top you see the buzzer which needed 7 volts, so underneath there's a voltage booster from 5 to 7 volts configured with a switching NPN MOSFET.
Top view with the battery added.
The bar in the middle has a spring underneath it which presses the horn up. I isolated the spring and the bar with some plastic and added solder. If the spring (hooked to a GPIO) is up it touches the bar (hooked to ground). Now it acts like a switch! It bounces around (literally) so I need to add some debounce in the software.
I modified the original back plate to add a USB-C and on/off switch. I had to cut off a bit of the steel with my Dremel, but it fit seamlessly into the original case. No bakelite was hurt during the making of this phone.
In this picture you see a simple "power-only" usb port, but I switched it for a fully functioning one, so now I can update the ESP32 firmware without opening the phone again.
In this picture you see a simple "power-only" usb port, but I switched it for a fully functioning one, so now I can update the ESP32 firmware without opening the phone again.
The completed thing. It's wireless and has about 1 day of standby time. This one sparks joy :)
Links
- debug issue 1 https://github.com/espressif/esp-idf/issues/14700
- debug issue 2 https://github.com/espressif/esp-idf/issues/14231
- debug issue 3 https://github.com/espressif/esp-idf/issues/13738
- debug issue 4 https://www.esp32.com/viewtopic.php?t=40279
- Hacker News post https://news.ycombinator.com/item?id=41986452
This is absolutely epic! I have one of those old phones as well, yearning for a make over.... (I also have an 18xx Olivetti typewriter, can we make that in a laptop ;)
ReplyDeleteMy brain is running at 200% trying to figure out how we could make a typewriter into a computer ;) Would be epic!
Delete