Close

Starting the ToxPhone

A project log for ToxPhone

Vintage phones repurposed to communicate through Tox

rodolphehRodolpheH 01/05/2016 at 21:480 Comments

So after a few weeks of discussing and procrastinating, we decided to step up in creating a ToxPhone (some kind of secured landline in layman terms). I found an old phone in my attic, from 1995, and decided to start today tinkering with it (while some components are being delivered)

I was surprised at how easy it was to open. Just one screw. From there I had a look at the mainboard and spotted the PCD3310 which is a pulse and DTMF dialler. Its only goal is to communicate with the phone network and manage the keypad. From there, I knew what I had to do if I wanted to keep the original keypad : just desolder the chip and connect the rows and the columns from the keypad to the Raspberry Pi. All the components had their pins bent after being soldered so I had to be a little bit violent with the PCD3310. Some of the pads got off but I was able to make a reliable connection anyway. I decided to take away some passive components aroud the PCD3310 to gain some place and liberty. The datasheet helped me to identify the rows and the columns of the keypad.

I took a small piece of a breadboard to make some kind of connector. Once soldered, I took time to install a brand new Arch Linux on the Raspberry Pi. I had to fight a little since Arch Linux is not packaged anymore in NOOBS. I followed this page for the installation on an SD card and then this page for setting a chroot with QEMU in order to add some software (I couldn't connect the wifi at first boot : no wpa_supplicant). From there, I was able to set up a SSH connection and start writing some python.

Using the Rpi.GPIO python library, I wrote a small python class (Keypad) that configure the GPIO and find what key have been pressed. All rows are connected into interrupt-driven pins with pull-down resistor enabled. The columns are configured as outputs in high-state. When a key is pressed, one of the rows is pulled to high-state, which trigger an interrupt. The callback for this interrupt will turn off and on each of the column pins. During this change of state, the pin that have triggered the interrupt is measured again. If it goes to the low-state, that means that we have disabled the column corresponding to the key pressed and we can then deduce the key that have been pressed.

It's basically how the Keypad library for Arduino works. The only difference is that I used the internal pull-down resistors of the Raspberry Pi and I used interrupts to avoid using some polling systems (too cumbersome and cpu consuming).

Discussions