I²C Keypad Backpack Board

seeeduino and I2C Keypad
i2c keypad backpack and keypad
i2c keypad backpack board

Description

Keypads are widely available and are very reasonably priced. They come in different configurations (4×4, 4×3, etc.) and in many physical sizes . Nearly all electronic suppliers sell them, and you can even get them on Amazon and eBay.

Keypads typically require a lot of pins from the microcontroller to operate, but this board interfaces to keypads with the two pin I²C interface. This project consists of a board that sits on the back of the keypad, and provides two Grove type I²C connectors for easy connection to a microcontroller. This board also has the I²C pullup resistors (enabled with solder jumpers) and jumpers to select the I²C address. The board will operate on either 3.3 or 5 volts. The board only has one chip on it (MCP23008). The total parts cost is under five dollars.

The keypads need to be a “matrix” style keypad, where there is one pin for each row and one pin for each column of keys. For example, a keypad with 4 rows of keys and three columns of keys will have 7 pins on it. When a key is pressed, it produces a shorted connection between the row and column pins. This backpack board will work with keypads that have a maximum of 8 pins (and 16 keys is the maximum supported size, 4×4).

various keypads

To make it easy to use this board and keypad, I wrote a software library for the Arduino and Particle microcontrollers.

Here are some related projects and posts that might also interest you.

Files

The schematic and pcb layout files (Eagle and pdf) are available at this Github repository.

Parts

This project does not require many parts, and most are available from Mouser. Bare PC Boards are available from OSH Park.

Qty Part Value Package Vendor Part Number
1 C1 .1uF 0805 Mouser.com 80-C0805C104M5R
1 C2 10uF 0805 Mouser.com 647-F921A106MPA
2 J1,J2 4 pin Grove SMD 90 Seeedstudio.com 320110032
1 J3 8 pins .1 Header Pins Mouser.com 855-M20-9991645
1 J4 2 pins .1 Header Pins Mouser.com 855-M20-9991645
3 R1-3 10K 0805 Mouser.com 71-CRCW0805-10K-E3
2 R4,R5 4.75K 0805 Mouser.com 71-CRCW0805-4.75K-E3
1 U1 MCP23008 SSOP20 Mouser.com 579-MCP23008-E/SS
1 PC Board OSH Park Order Link

You can purchase keypads from many sources including Mouser, Amazon and eBay. The keypad must be a matrix style keypad where this is a pin for each row of keys and a pin for each column of keys.

Bare pc boards are available from OSH Park.

Assembly

i2c keypad backpack board

As you probably noticed, this board uses surface mount components, so you will need some skill in dealing with these small parts. Sparkfun has an excellent series of tutorials if you want to brush up your knowledge on soldering these small parts.

Depending on your keypad, you may not need the J3 connector pins, as the backpack board can be soldered directly to a keypad. You probably won’t need J4, unless you are using interrupts to detect when a key is pressed on the keypad. The library routines that I wrote do not use interrupts.

Hookup

rear of keypad
i2c keypad backpack on keypad

Most keypads have a row of .1 inch spaced pins. Slip the backpack board over this row of pins and solder the board in place.

Using a 4 pin Grove type cable, attach the backpack board to a microcontroller that has a I²C Grove type connector on it. This will power the display and connect the SDA and SCL lines to the microcontroller.

Jumpers

There are five solder jumpers near the center of the backpack board. To “close” a jumper, carefully solder a bridge across the two pads using a small amount of solder.

SJ1, SJ2, and SJ3 control the I²C address of the board. The following table shows the possible address combinations.

SJ3 SJ2 SJ1 I²C address
closed closed closed 20 hex
closed closed open 21 hex
closed open closed 22 hex
closed open open 23 hex
open closed closed 24 hex
open closed open 25 hex
open open closed 26 hex
open open open 27 hex

If you solder across SJ4 and SJ5 you can enable pull up resistors on the signals SDA and SCL (respectively). At least one pull up resistor is required on these lines somewhere on your various hardware boards.

Software

For Arduino and Particle users, the I2cKeypad library provides functions that make it easy to read the keys as they are pressed on the keypad. An included demo program shows the usage of the functions. These links give the details.

Miscellaneous

Seeeduino Version 4.2 is an Arduino compatible board with Grove I²C connectors on it and is available from Mouser, Amazon and Seeedstudio.

Seeedstudio makes the Particle Photon Base Shield which is a board that allows you to plug in a Particle Photon module. It has the Grove type connectors on it for easy connection to this backpack board.

Grove cables in various lengths are available from Seeedstudio, Mouser, Amazon, and Digikey.



Leave a Reply

Your email address will not be published. Required fields are marked *

*