Although these instructions are primarily for the Tiffany Coke phone that I used in this build it should apply to almost any retro touch pad phone.
Step Zero: Working phone -- see it before you build it =)Step One: Dismantling the phoneFirst I removed the handset and prepared the area for taking the phone apart.
Turn over the phone and remove the size screws from the bottom to reveal the following guts of the phone. Also nice to see that we had lots of space to work for.
After the phone is opened we remove all the parts that we are not going to need. These include the old circuit board, the led light, the speaker and one of the weights. I had to also break a few of the plastic screw holders to free up space for the Raspberry Pi, case and wires. I don't have a pic of this step but it really is just freeing up space in the old phone for the pi. The next step is to remove the screws for the top half of the case and remove the cardboard separator.
That reveals the keypad which is held in place by a two screws.
Step Two: Figuring out the keypadRemove the keypad from the case and set it aside so that we can work on it.
The keypad is made up of two parts. The first is that actual board and the other are the esthetics and the buttons. Lay the buttons face down and remove the 4 screws. Carefully remove the back board so that we can see what wires do what.
Above you can see the board with my markup so you can see what button goes with what part of the board. Next step is tedious, but you have to map each pin to what buttons they connect.
After have the pins mapped out we have to figure out how the matrix keypad is laid out in rows and columns. The following table was used to work on this:
Then from their we proceed to look at that in a row column matrix like so
Now we have the rows and columns.
Step Four: Test the keypadNext step was to wire everything up to a bread board and a Raspberry Pi Zero to test out the keypad.
I didn't save off the specific source code for this step but it was a simple one that used pad4pi to check for input. Anyways you will get to see the working code later. I did take a video of this feature when reassembled and it made sense to show it here:
The handset of the phone is just an analog source for mic and speaker. So we just found out what wire were for each by looking on the board.
Then we soldered the wire to the 3.5mm jacks up the standard phone jack. Make sure you mind the positive and negative for the jack.
Once you have it wired up you can perform a test with any laptop.
If things are going right you will be able to hear the audio and record audio. Then we just clean up the connections
After getting the USB sound card all wired I tested out the space in the case. I had to make a few adjustments. Remove a raised portion where the old switches from the retro phone where. The result was a pretty good fit for everything
We used a drill bit the size of the momentary switch and made sure it was in a good place to put for the layout. Next we soldered the switch to a few cables from a ribbon so that they an plug into the pi.
I removed the two screws holding in the receiver switch and it revealed the switches workings. The receiver switch had seven wires and that was overkill for my needs.
I figured that only two should work for on and off so used my meter to test the wires and found the ones that were working. Then I performed a test to verify this setup with an led, the switch and 2 batteries.
Step Nine: Wire the status LEDA red led light was used as the status indicator for google aiy. The led was wired to GPIO 22 (Pin 15) and to the ground at Pin 30.
Next I soldered all of the connections between the keypad an the ribbon cable for the Pi. I tried to match colors up the best I could so that it is easy to match up the pins from the keypad to the Pi.
The pin mapping is shown in the following code sample:
# KEYPAD MATRIX
MATRIX = [ [1,'~',2,3,'~','~'],
[4,5,'~',6,'~','F'],
[7,8,'~','~',9,'~'],
['*',0,'~','~','#','R'] ]
# ACTUAL PINS: 1,5,9,7
# BOARD PINS 15,19,7,11
# BCM PINS
ROW = [22,10,4,17]
# ACTUAL PINS: 3,8,2,4,10,6
# BOARD PINS 8,10,12,16,18,24
# BCM PINS
COL = [14,15,18,23,24,8]
Step Eleven: Connect the receiver switch and momentary shutoff to the PiThe receiver switch is wired to GPIO 11 (Pin 23) and the other to the ground at Pin 20. This is used in main.py for the trigger:
if args.trigger == 'gpio':
import triggers.gpio
triggerer = triggers.gpio.GpioTrigger(channel=11)
msg = 'Press the button on GPIO 11'
The shutoff switch is wired to GPIO 27 (Pin 13) and the other to the ground at Pin 9. This is used in main.py for the shutdown event:
# setup the gpio pin for shutdown
GPIO.setup(27, GPIO.IN, pull_up_down=GPIO.PUD_UP)
# Add our function to execute when the button pressed event happens
GPIO.add_event_detect(27, GPIO.FALLING, callback = Shutdown, bouncetime = 2000)
Step Twelve: ReassemblyScrew the receiver switch back into its original position an make sure that the button goes up and down. Put the keypad and board back together and screw in the four screws. Put the keypad back into the phone and attach the two screws. Use double side adhesive tape to attach the pi to the bottom of the phone location that allows the case to shut. Plug in the usb sound card via the right/left extension. I used another extension to come out the back of the phone. Put the rest of the wires back in the case and screw in the size screws at the bottom. I had to remove part of the back to allow for hdmi, usb and power to come out the back. The phone is now reassembled.
The code for the project can be found at https://github.com/gschaetz/retro-aiy-touch-phone. The repo has the instruction for putting the code on the Pi. To tweak the buttons to do what you want. Change the following code in main.py to your needs:
def processKey(key):
print(key)
lang = 'en-US'
if key == 1:
words="turn on the basement lamps"
subprocess.call(['pico2wave', '-l', lang, '-w=out.wav', words])
elif key == 2:
words="turn off the basement lamps"
subprocess.call(['pico2wave', '-l', lang, '-w=out.wav', words])
elif key == 3:
words="turn on lights"
subprocess.call(['pico2wave', '-l', lang, '-w=out.wav', words])
elif key == 4:
words="turn off lights"
subprocess.call(['pico2wave', '-l', lang, '-w=out.wav', words])
elif key == '#':
words="what is the weather like"
subprocess.call(['pico2wave', '-l', lang, '-w=out.wav', words])
elif key == '*':
words="time"
subprocess.call(['pico2wave', '-l', lang, '-w=out.wav', words])
else:
words="what is my name"
subprocess.call(['pico2wave', '-l', lang, '-w=out.wav', words])
The words are the text that will be covered to speech and sent to the API. I just made a few examples.
Step Fourteen: Sit back and enjoy your Google Home air retro phone
Comments