Things You'll Need
Instructions
Test the Keypad
Set your digital multimeter to continuity mode.
Place one of the multimeter's probes on one of the keypad's pins that's used to form a closed switch and the other probe on the other pin that closes the switch. The keypad's datasheet tells you which pins are grouped into switches. For example, the datasheet might say that pins one and three form a closed switch when you press "3" on the keypad.
Press the button on the keypad that corresponds to the pins you're testing. Listen for a beep, indicating a closed switch. Test each switch with your multimeter until you've confirmed all the buttons listed in the datasheet are correctly mapped to the keypad's pins.
Draw the Keypad Table
Draw a table that represents the layout of your keypad on paper. Add an extra column and row to accommodate the keypad's pin numbers. For example, if you have a standard 12-button keypad, draw a table with four columns and five rows.
Write the names of the keypad's buttons in the table's cells according to the keypad's layout. For example, if you're using a standard 12-button keypad, the first row of buttons are labeled "1,"2" and "3." Write "1," "2" and "3" in the top three cells of the table, starting with the left-most cell.
Write the pin numbers that correspond to a closed switch for each of the keypad's buttons in the remaining column and row. For example, if pins three and two form a closed switch when you press "1" on the keypad, write "3" in the empty cell below "1" at the bottom of the table, and write "2" in the empty cell to the far right of "1."
Label the pin numbers in the table's bottom row "input pins" and the pin numbers in the right column "output pins." The "input pins" are the keypad's pins that connect to the microcontroller's inputs and the "output pins" connect to the microcontroller's outputs.
Connect the Keypad to the Microcontroller
Connect each of the keypad's output pins to the breadboard with wire. Use a separate track on the breadboard for each pin.
Connect one of the breadboard's tracks containing one of the keypad's output pins to a digital output on the microcontroller with wire. Repeat for each track containing an output pin, using a separate digital output on the microcontroller for each of the keypad's output pins.
Connect the microcontroller's ground pin to an empty track on the breadboard with wire.
Connect one resistor per input pin on the keypad to the ground track on the breadboard.
Connect the remaining ends of each resistor to empty tracks on the breadboard.
Connect each resistor on the breadboard to an input pin on the keypad. Use the ends that aren't connected to the ground track.
Connect each resistor on the breadboard to a digital input on the microcontroller with wire. Use the ends connected to the keypad.