You know those ole 12 button keypads which are very easy to use but eat microcontroller IOs like they are candy? Well now you can have your cake and eat it with this simple backpack board which will convert one of these hungry beasts down to consuming only a single analog input rather than 12 digital inputs.

You will need:
  • 12 button common terminal keypad. 1x
  • 1k ohm resistor, 12x
  • 12k ohm resistor, 1x
  • Protoboard (approx 1.5" x 1.5"), 1x
  • Soldering iron & solder
  • Hookup wire (red - approx 2"), x1
  • Hookup wire (black - approx 2"), x12
  • Hookup wire (red,black,yellow - approx 5"), x3
  • Molex crimp pins, 3x
  • Molex female connector, 1x
  • Molex male connector, 1x
  • Hot glue gun
  • Mini vise

Step 1: Circuit Design

The circuit is a simple series resistor ladder + voltage divider.
The common terminal of the keypad is held high through a 12k pullup resistor.
Each key terminal of the keypad is connected to a 1k resistor.
That resistor is in turn connected in series with its neighbor in a ladder twoards the common terminal.
The end of the resistor ladder is tied to ground.
The signal line is a voltage divider with its reference point between the 12K resistor and the resistor ladder.
Depressing a key causes a chain of resistors with a unique value to be introduced into the voltage divider, giving each key a unique analog value.

Eagle schematic files are attached for ease of reproduction on a protoboard or single sided etched copper board.
<p>Thanx for this tutorial. <br>I have used it to make a toy organ.<br>It's works perfectly</p>
<p>Thank you for making this easy step-by-step tutorial. Worked like a charm.</p>
Very ingenious implementation!
Here's an image of my DIY keypad<br><br>http://dominion-network.co.uk/projectstuff/keypad.jpg<br><br>I'm currently in the process of neatening it up so it looks a lot better, and so I'm also able to 'waterproof' it with a diy membrane.
Hey, it's me again, I'm trying to get your library to work with this library<br>http://www.arduino.cc/playground/Code/Password<br>But I'm not having any luck, could you give me a hand?
Sure, send me your code - declan@shanaghy.com<br><br>Also, are you 100% sure you have a common terminal keypad?<br>Sorry but i have to start with the basic questions, some people do try to use this library with a matrix keypad and it wont work with that.<br>
I don't have a fancy one like you, I've scratch built mine (Working on turning it into an instructable) and it works perfectly (All the buttons match up with the keys) and I've not really got any code (None that work anyway) other than the two separate libraries, I've tried combining the &quot;PasswordKeypad&quot; example with the analog keypad library but doesn't seem to want to work and I'm currently at a loss.
OK Send me the code you have anyway.<br>I cant help without seeing what you're working with.<br><br>Also send me some pics of the hardware physical <br>hardware setup or eagle schematics.<br><br>Im also a little unclear on what you mean by combining both.<br>I assume you want to capture input from the keypad and pass it onto<br>the password library. Is this correct?<br>
I sent the stuff you requested, it'll be from &quot;webmaster[at]dominion-network[dot]co[dot]uk&quot;
I haven't been able to make it into a solder board project yet (the board hasn't been delivered yet), I've currently got buttons 1 through 9 on a solderless breadboard at the moment.<br><br>But yeah I'm trying to capture input from the analog keypad and pass it through to the password library and so far everything I've attempted has failed... <br><br>Once I've had my dinner I will take the required photos and I will email them as well as the code I've got.
By any chance would you be able to take some more photos of the resistors? I'm trying to design a PCB and some of the steps are a little confusing for example the placement of the black, red and yellow wires, a diagram would be great.
HEADS UP!<br>All the source is avaiable on github:<br>https://github.com/declanshanaghy/KeypadBackpack<br><br>I've started implementing the Arduino Library to read the keys (see here)<br>https://raw.github.com/declanshanaghy/KeypadBackpack/master/AnalogKeypad/AnalogKeypad.pde<br><br><br>However, the code doesn't include any debouncing logic yet. I should get that implemented within the next week. (busy with some other stuff)<br><br>Feel free to fork and send me a pull request if you implement it yourself.<br>
Added debouncing and repeat rate options to the code. Files are pasted above.<br>
Thank you for this!, I've read an instructable (look for Arduino 3 wire Matrix Keypad) saying how to do this, but it never gave any actual step by step instructions with images, I've bookmarked this and when I get one of these keypads I'll be doing this.<br><br>Where did you get your keypad from? was it Maplins? (UK) or Sparkfun? (USA)
This approach won't work with a Matrix keypad (such as the one sparkfun sells)<br><br>The keypad must be the type that has 13 terminals.<br>1 for each of the 12 keys and 1 common termal<br><br>I got this &quot;common terminal&quot; keypad at allelectronics.com<br>http://www.allelectronics.com/make-a-store/item/KP-12/12-BUTTON-KEYPAD//1.html<br><br>Most people use matrix keyds because it saves pins compared to a common terminal keypad. However, i think the common terminal approach is much easier since you can get it down to only using 1 pin with a few measly resistors.<br><br><br>
I have another question about that keypad, do you have a datasheet for it? I'm looking at creating a disposable one for a project (Don't want to pay money for a keypad that may get damaged in this particular project)
Sorry, I dont have a datasheet.<br>AllElectronics is pretty bad when it comes to datasheets - basically non existent for any of their products.<br><br>
Thanks for the link and the information, I can't wait to do/use this for my project

About This Instructable


23 favorites


Bio: I Make stuff. Use Arduino with DIY manufactured PCBs. Love the precision of CNC, Getting into 3D Printing. Someday I'll have a CNC mill. :-)
More by declanshanaghy: XBox 360 Mini Stand JabberBot! The Arduino robot with an ATMega brain and bluetooth braun! :-) Analog Keypad Backpack
Add instructable to: