Phone Keypad Hacking: Part 3

In parts 1 and 2, I walked through my journey of repurposing the keypad out of a phone from 1980. I learned that a more modern keypad matrix doesn’t exactly function (behind the scenes) in a way I’d expect. I wanted to understand it better so I set out to recreate a 2×2 keypad (kept it simple to make wiring easier) that would function the same way as something you can buy today. It would be a success if it worked with the Arduino Keypad Library.

adafruit-3x4-keypad

From my earlier looks through the code I knew it pulsed power out to a column pin and then read in each row’s key from that column before switching to the next column and repeating the process. I figured that should be enough for me to wire this up and try example programs without going back to look at the library’s code again.

I don’t know why I was thinking this would be more complicated and at least a little more exciting, but it was unbelievably easy. I guess I should be celebrating I understood how it worked. Literally all you do is connect one side of every button in a column to a pin and one side of every button in a row to a pin. No need for connections to power, or ground. No pull up/down resistors.

2x2-keypad-matrix-wiring.png

It immediately worked with the Arduino Keypad library examples, even the MultiKey one. I guess being able to detect multiple key presses at once is where the advantage to this implementation comes in. It worked flawlessly when pressing 2 of the 4 buttons, but when you get to 3/4 there are too many connections to distinguish the keys.

Just to be sure I had it figured out, I added a 3rd column to make it a 2×3 grid and it was just as easy.

2x3-keypad-matrix-wiring.png

I love the beauty of how simple this is. I’ve added Fritzing for both of these to my phone-keypad GitHub repo (2×2 & 2×3). If you check this PDF, in the How it Works section it has a really good explanation and shows the row and column connections exactly like I came up with.

Naturally now I need to do a part 4 and attempt to recreate the keypad implementation I ended up with from the old phone. Due to how it mechanically makes the electrical connections I think it’s going to be a bit more complicated than this was. We shall see…

Update: Read part 4.

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.

Combining 74HC74 & 555 Integrated Circuits

After working with some basic 74HC74 and 555 circuits, it was time to get fancy. I replaced one of the button triggers from my 74HC74 circuit with a 555 timer delay.

74HC74-555-button-wiring.png

Then I replaced the other button with a 555 timer delay as well.

555-74HC74-555-wiring.png

What do you think happens if I swap out the 22 μF capacitors for 4.7 μF? Remember the capacitor charge time formula from the 555 post? Multiply the capacitance (farads) by the resistance (ohms) to get the time. I’m still using the same 100 K ohm resistors.

t = RC

100000 * 0.0000047 = 0.47

So the delay decreases from 2.2 seconds to 0.47.

There is really no point in the 74HC74 here. You can connect two 555s to each other for a similar result. The video shows a double 555 circuit with 3 different timings, where I swap the capacitors from 22 μF to 4.7 μF and then 1 μF (delay of 0.1 second).

double-555-wiring.png

Are there any other circuits I should try with the 74HC74 and/or 555?

Using a 555 Integrated Circuit

555-pins
555 Pins

I posted about the 74HC74 flip-flop on Saturday. For the same project I’m going to use that IC for, I’ll probably use a 555 timer. It’s often referred to as one of the most useful ICs you can get. I’ve never used the 555 either, so I wired up some simple demos using it. In order to show two common timing uses, I’ve created similar circuits each triggered by the same power source and button.

The circuit on the left shows a delay off timer and the one on the right shows a delay on timer. Notice when power is connected (or the button is used as a reset) that the red LED turns on right away and turns off after a few seconds. Just the opposite, the white LED is off when the timer is reset and turns on after a few seconds.

The length of the delays is determined by the capacitor and resistor used with the 555. I’m using an Adafruit Feather to provide 3.3 volts to the circuits with a 22 μF capacitor and 100 K ohm resistor. Using the capacitor charge time formula to multiply the capacitance (farads) by the resistance (ohms), it’s easy to get the time.

t = RC

t = 100000 * 0.000022

Comes out to 2.2 seconds. To change the time delay all you have to do is use a different capacitor and/or resistor.

Here is a simplified wiring setup because it’s hard to see how everything is connected in the video.

555-wiring.png

Also check out Combining 74HC74 & 555 Integrated Circuits.

Using a 74HC74 Integrated Circuit

74HC74-pins
74HC74 Pins

I received some advice to use a 74HC74 flip-flop for a project idea I’ve had. I’ve never used an integrated circuit so I thought a good first step was to put together a very simple demo I could hack around with it. This IC is big enough it actually provides two flip-flops, one on each side as you can see from the pin diagram on the right. Both sides work the same, but are completely independent other than sharing power and ground. I’m only using the first side for this example.

 

As I press the buttons connected to CLR and PRE, you can see the outputs (Q and not Q) alternate. I’ve set the data (D) and clock (CLK) pins to ground. The truth table for the 74HC74 comes in handy to understand what’s going on.

74HC74-truth-table.png

Here is a simplified wiring setup because it’s hard to see how everything is connected in the video.

74HC74-wiring.png

Also check out Combining 74HC74 & 555 Integrated Circuits.