3 ms·
I should do a technical writeup - ion the meantime: Here's a video I made mainly for myself so no polish at all: https://www.youtube.com/watch?v=jjLPGDQlgKQ ht
by andrewstuart 5y ago
I should do a technical writeup - ion the meantime:
Here's a video I made mainly for myself so no polish at all: https://www.youtube.com/watch?v=jjLPGDQlgKQ https://www.youtube.com/watch?v=jjLPGDQlgKQ
Here's the Python code: https://gist.github.com/bootrino/9c6c82e3243782da23308e50a38686db https://gist.github.com/bootrino/9c6c82e3243782da23308e50a38...
In short I installed a Raspberry Pi Zero into the case of the phone. I considered using an esp32 but the Raspberry Pi is alot more straightforward because I can simply run Linux and code in Python. On the esp32 I could write the code in C++ but it would take longer, or use micropython for esp32 but that no doubt would be harder than the Raspberry Pi.
I found several YouTube videos and also some web ages that described how to connect the rotary dialler to the GPIO pins on the Raspberry Pi, and I found some example code that captured the number dialled on the dialler.
To connect the speaker in the handset it was a little more involved. First I had to work out which wires coming out of the handset cable were the speaker wires - there were four wires coming out, two yellow and two pink. I screwed off the speaker portion of the handset and pulled out the speaker, revealing two yellow wires. The Raspberry Pi zero does not have an audio out port. So I bought the cheapest possible USB audio card for about $20 https://www.centrecom.com.au/shintaro-usb-audio-adaptor-with-35mm-headphone-and-microphone-jack-convert-35mm-headset-to-usb https://www.centrecom.com.au/shintaro-usb-audio-adaptor-with... and also bought a 3.5MM audio cable which I cut and stripped back the two wires and connected them to the two yellow wires from the handset speaker.
I knew that the hangup/pickup switch must allow/deny a flow of electricity, so I got out my cheap multimeter and started randomly touching parts of the phones circuit board in two places, and lifting and pressing the hangup switch. Eventually I found two points which resulted in electricity flowing or stopping when the switch went up and down, so I knew this must be right connection points, which I then connected to two of the GPIO pins on the Raspberry Pi.
I removed the wire which connected the phone to the plain on telephone line and instead put a USB power cable there.
At this point I had worked out how all the various bits and pieces worked so I wrote a Python program to tie it all together.
When the phone handset was lifted, I played a dial tone audio file. I had about 60 audio files, which I uploaded to the Linux file system. I gave each audio file a number from 100.mp3 to 160.mp3 so when a phone number was dialled, I searched a list of the files, and if the dialled number matched an mp3 filename then I played that file.
I had to remove the bells from the phone unfortunately to fit the computer in.
One of the disappointing things is that it is not possible to make the phone ring because the ringer requires a much higher voltage than can be generated by a small computer. You could probably fake this by installing a small speaker and just playing the sound of a phone ringing.
Credit should be given to the various people who've written blog posts and on YouTube who have done something like this before me - I read lots of pages and viewed lots of videos that do this in differing ways. This guy was most helpful: https://www.youtube.com/watch?v=JChn7tV_qBk https://www.youtube.com/watch?v=JChn7tV_qBk. also this person is a real inspiration, she's very creative: https://www.youtube.com/channel/UCEFrHGqsKTvBXk0FC-q_iag https://www.youtube.com/channel/UCEFrHGqsKTvBXk0FC-q_iag. and this guy takes a completely different approach which does not require pulling the phone apart: https://www.youtube.com/watch?v=siwq1FxvRrw https://www.youtube.com/watch?v=siwq1FxvRrw
- hunter2_ 5y agoCool! > One of the disappointing things is that it is not possible to make the phone ring because the ringer requires a much higher voltage than can be generated by a small computer. Voltage can be stepped up using a transformer, no problem. It's that you need 20~25Hz AC and a certain amount of current (see "ringer equivalent" calculations). Either way, you're probably right to skip it for this project :)
- jcims 5y agoI think anyone that was busy wrapping their phone line around a terminal when a call came in would agree. :)
- vidarh 5y agoWe had a little mini-thread on getting shocked when a call comes in just yesterday: https://news.ycombinator.com/item?id=29613712 https://news.ycombinator.com/item?id=29613712
- jacquesm 5y agoI built my first modem from discrete parts and the first time a call came in on that line the whole thing went up. Major design oversight :)
- danachow 5y ago> because the ringer requires a much higher voltage than can be generated by a small computer. I mean that’s not quite true. A magicjack which is basically an ATA is about the size of the Pi Zero and produces ring power. A REN is on the order of 10 mA which at 90V can be generated by a very small (like smaller than a dime) switcher. Indeed the quickest and easiest way to “modernize” an old phone is probably to stuff the guts of a readily available analog telephone adapter and interface it to a Pi, or a Wi-Fi adapter, etc. You might even dispense with the pi: https://randywestergren.com/reverse-engineering-obi200-google-voice-appliance-part-2/ https://randywestergren.com/reverse-engineering-obi200-googl...