How to Prototype a Keypad and Display for Your Keypad Entry System Arduino Project - dummies

How to Prototype a Keypad and Display for Your Keypad Entry System Arduino Project

By Brock Craft

This Arduino project has a lot of connections, so it’s a good idea to prototype it first using a breadboard. After you’ve built and tested your prototype, you can then install the breadboard into an enclosure or transfer the circuit to a more permanent substrate, such as a stripboard.

You need to solder pin headers onto your keypad so that you can insert it into your breadboard for testing. Later, this will make it easier to connect a ribbon cable either by soldering it to the pins or with a header socket that is soldered to the ribbon cable. After the pins are soldered on, you can start assembling your breadboard.


The parts layout on your breadboard diagram shows the connections for the Rapid Keypad and Avago LED display. If you are using different parts, your connections will probably be slightly different. Add components to your breadboard as follows:

  1. Add your keypad.

  2. Insert your quad LED display on the left side of the breadboard.

  3. Add the 7219 display driver to your breadboard.

  4. Connect your keypad to the digital pins of your Arduino, making sure the keypad pins for rows and columns correspond to the correct digital pins on your Arduino.

  5. Double-check your connections.

    It’s easy to make a mistake.


It’s always worthwhile to check your datasheet to be sure of your connections. Sometimes there may be extra pins on the unit that are not connected to anything. It depends on the manufacturer. If you are using a different unit, you can test its connectors to determine how to connect it to your Arduino.

Currently, the datasheet for the Rapid Keypad part #78-0305 shows the wrong pinouts.

Arduino Digital Pin SparkFun/Rapid Keypad Pin Keypad Row/Column
2 7 Row 1
3 6 Row 2
4 5 Column 2
5 4 Row 3
6 3 Column 0
7 2 Row 0
8 1 Column 1

Now connect the Max 72xx Driver IC to your Arduino by connecting jumper wires. Pretty simple, because you are using the SPI library to communicate with the IC, and it only needs three connections!

Arduino    Digital Pin Max 72xx Pin
10 1
11 12
13 13

Add your capacitors to the breadboard. The .01 µF capacitor straddles the IC. To be most effective at preventing electrical noise from disturbing the IC, it needs to be as close as possible to output Pins 9 and 19. Straddling the IC is an easy way to do this. The 10 microfarad electrolytic capacitor simply needs to be placed across the ground and power rails.

The 10 µF is “polarized,” meaning it operates correctly in only one direction. Make sure that the negative leg is connected to the negative power rail on your breadboard. You identify the negative side by a “–” printed down the side of the capacitor. The leg on that side is the negative leg.

You may be tempted to omit the two capacitors, especially if you don’t have them lying around your workbench. Don’t! This can lead to erratic behavior and even permanent damage. They prevent noise on the power input and should be placed as close as possible to the V+ and Ground pins of the IC.

Next, add your resistor between Pins 18 and 19 of the Max 72XX Driver IC. This is used to limit current through each LED segment. The maximum current rating for your display determines the value of the resistor value, which limits how much current flows through the LED. The 72xx datasheet has a table that specifies the resistor values that should be used for your LED display.

The HDSP-B09G has a maximum of 25mA per segment at a forward voltage of 2.2V. Checking the table, this would indicate a resistor value of somewhere between 17KΩ and 28KΩ, but it’s good to have a bit of a safety margin, so a 33KΩ resistor is specified.

This works for both the Lite-On and Avago displays, but you might need a different value if you are using a different display. Using a lower value could reduce the life of your LED or your driver IC.

Now connect your Max 72xx to your quad LED display. The way you connect your LED display to your Max 72xx will depend on the layout of its pins. The schematic diagram doesn’t show both displays. The pinouts for the quad LED vary by manufacturer, so in the diagram they aren’t labeled by pin number.

MAX 7219/7221 Lite-On    LTC-4727JR Avago HDSP-B09G
2 1 12
6 6 8
7 8 6
11 2 9
14 14 11
15 11 10
16 16 7
17 15 5
20 13 4
21 5 1
22 7 2
23 3 3