Phone Keypad Hacking: Part 2

Go back and read Part 1 if you want to the full story on this little project. I did decide to get rid of the PCB on the old phone keypad. Good thing I’ve been getting a lot of desoldering practice. In order to remove the PCB, I first had to remove the wires I had added to the column and row contact points. That was easy and getting the PCB off was a pretty smooth process as well.

PCB and new look of the back side of the keypad.
Other side of the PCB. The white rectangle is the back of the 557D IC.

Now that I didn’t have the PCB to carry power and ground around everywhere, I had to solder in my own wires. I also had to solder back in all of my connection points to provide the outputs I’d feed into a microcontroller (I used an Adafruit Feather 32u4 Basic Proto).

Once all of the wires were in place and then connected to my microcontroller I wasn’t getting expected results from a simple little program I wrote to display the values. Took far too long for me to remember I needed to use pull down resistors to prevent floating values. I put 10k Ω resistors in each of the circuits…

img_8994
Prototyping with pull down resistors.

Output from the pins couldn’t get any better…

phone-keypad-row-col-values.png

I loaded an example from the Arduino KeyPad library, which gave me very weird behavior. After looking at the underlying code, I realized it wanted the outputs of the keypad to be HIGH when a key was not pressed and LOW when it was. Well, my circuit was doing the opposite, so I had to have to invert everything. I didn’t have any inverter ICs, so I used NPN transistors to create an inverter circuit on each output.

img_8993
Prototyping by inverting the output of the keypad column and row values.

Progress. Now I was able to get the library to correctly recognize some key presses. 95% of the time it seemed to think everything was coming from column 1 (1, 4, 7, *) though. The library comes with a MultiKey example. When I ran that, it was reporting every key on the row as being pressed. WTF?!

For the life of me I could not figure out what caused this. I checked wires, measured voltages, did continuity tests, resoldered connections, changed boards, used different GPIO pins, and countless other things. Nothing made a difference. My own code was working beautifully though. Eventually I gave up on the library. It wasn’t worth the effort and I was out of ideas.

Update: Later on I went back and read the KeyPad library code again because it was bugging me. Turns out these keypads don’t actively read the column pins like they do the row pins. My assumptions about how they worked was very wrong because I hadn’t read far enough into the code before. When checking for key presses, typical keypads iterate through the columns to send a pulse which feeds over in to the rows, which are then read in. How a Key Matrix Works has a pretty good explanation with visuals. If I get my hands on another similar keypad maybe I’ll try to recreate this functionality.

I rewired everything to use the pull down resistors again (video of soldering). A huge benefit of the decision was it drastically simplified my circuitry. This would save me 49 solder points! I probably would have needed to use a half-size perma-proto board instead of the 1/4 size I ended up using.

I decided to put in a piezo buzzer to add sounds. I also used a tiny LED, which I had salvaged from some old computer speakers, to show when power is switched on to the backlight.

The finished board. Isn’t it a thing of beauty?

 

Side view before bending the output wires off to the sides.

I tried a couple of different methods of producing touch tones (DTMF) to match up with each key, but with the microcontroller I’m using and the small piezo buzzer, the sound was terrible. I would need something a little more capable I think.

Here’s a demo video.

Hard to see the OLED screen in the video, but I was only using it to output each key press. Something like this…

phone-keypad-oled-output.jpg

All of the code and Fritzing wiring are available in my phone-keypad repo on GitHub.

I even went out of my comfort zone and did a quick share of this on Adafruit’s Show and Tell. If the video doesn’t start at the right spot you can skip ahead to the 12:42 mark. Going back to watch, my demo kind of sucked since it’s hard to hold something up to the Mac camera and push buttons at the same time.

Update: Continue on to Part 3, where I create a matrix of buttons to act as a keypad.

Yellowbook

A couple of weeks ago I came home to find this 2017/2018 Yellowbook thrown in my driveway. How is a physical phone book still a thing?

Remember the white pages where you could look up the phone number for anyone in your area? Seems like decades ago, though I couldn’t tell you the last time I called a personal land line.

The MagPi Magazine: Issue 57

This morning when I saw the latest issue of The MagPi Magazine came with an exclusive Google kit, I wanted it. I was up early for a golf meeting and some errands so I stopped at Barnes & Noble to see if they had any copies. I was excited to find a couple on the shelf!

Easy to find in a sea of magazines.

The woman working the register said she had just put them out and there was actually a 3rd copy that was coming apart so she was going to glue it back together.

At $15 for a magazine, I don’t think you can really call this a “free” kit, but it’s still a good value. I don’t think I’ve ever “unboxed” a magazine before…

I love the emphasis on the maker here. Google is in this together with us.
The actual magazine is the first thing you see when you open the box.
A sheet with the typical warnings and instructions.
The fun stuff! Various electronics parts and cardboard pieces to make a case.
I guess the kits come with either a green, yellow, red or blue button.

This will be neat to mess around with. I’ve thought about turning one of my Pis into an Alexa type device to put in my office or bedroom and could easily do it now. If you have any project ideas involving voice, let me know.

New Garage Gym Equipment

In addition to making my own Farmers Carry handles, I’ve picked up some new items to expand the garage gym.

I bought this 10 foot climbing rope on Amazon. The ceiling obviously isn’t high enough for rope climbs, but I can use it for legless climbs starting from a seated position on the floor or simply do rope pull-ups. Can never have too many ways to do a pull-up or hang!

An upper body lifting program I’ve been following assigns half kneeling single arm bottoms up kettlebell presses every week. When I’m at home I’ve been using a dumbbell, but it’s nowhere near the same stimulus as stabilizing the uneven weight of an upside down kettlebell. It’s a very challenging exercise; if you’ve never done them before you’ll have to start much lighter than you’d expect.

I picked up this adjustable kettlebell from Dick’s Sporting Goods plus two 10 pound plates and a 5. As pictured I took out 3 of the spacers, which are on the right side. With this combination I can adjust it anywhere from 20-45 pounds in 5 pound increments. I already have a 50# kettlebell at home as well as a 53# and 70# I keep at the gym since I use those a lot more there.

These furniture movers, or SuperSliders, work really well on the rubber gym flooring. You can put your heels or toes on one of these and slide your legs in and out for core work.

Not Gonna Binge It

Last night I watched the first episode of Netflix’s series, “The OA.”

Seven years after vanishing from her home, a young woman returns with mysterious new abilities and recruits five strangers for a secret mission.

I didn’t get that feeling where I want to binge watch the show. I don’t know if I’ve even been intrigued by a single episode quite like I am. It’s hard to explain, but I feel like I want to appreciate each hour for what it is. After watching, I went to YouTube and loaded up the trailer. Within a few seconds I hit stop and exited; I didn’t want to catch a glimpse of what might be coming.

Electronics Engineering ToolKit

Electronics Engineering ToolKit is a useful iOS app if you’re messing around with electronics. I think I paid $6.99 to upgrade to Pro, which unlocks all of the formulas, reference material, and tools.

My favorites in the app

I recently posted Using a 555 Integrated Circuit. There are many ways to use these 555s. To get a sense of the power of this app, it has 10 tools in its 555 Timer IC group! Here’s a look at the Monostable operation mode. Each tool in the app has a great info panel like this one, describing what it does.

The tool itself gives 2 inputs where you set your resistor and capacitor values and it calculates the time for you.

It provides a circuit schematic where the R (resistor) & C (capacitor) values are updated instantly, based on you input values. This schematic doubles as a simulation, where it really gets cool. You can tap on the button to see how the circuit reacts. In this case, the LED turns green (ON) for 2.42 seconds and then turns off.

I wired up the circuit to try it for myself. Worked exactly as expected. I even triggered my live circuit and the simulation at the same time and the LEDs turned off simultaneously.

This is just one example of many useful things you can do in the Electronics Engineering ToolKit app, especially with the Pro upgrade. Not only can you favorite (as shown at the beginning of this post) the tools you find most useful, but the app also has a great search feature.

You can find similar tools for specific formulas and uses around the Internet, but I haven’t come across anything where it’s all in one place with an easy to use interface like this. Perhaps the best web site I’ve found is Basic Electronics Tutorials and Revision, which is a bit higher level in the way their descriptions.