matrix keypad/What is in your box/05. The adapter, pin by pin
What is in your box · 05 of 12

The adapter, pin by pin

One chip and four jobs: eight pins for the keypad, four for your board, the address, and a pad on the back that removes the pull-ups. On the TK85 the address is fixed at 0x20; the compact adapter adds three address pads, two of them labelled the wrong way round.

The TK85, both sides

The TK85 from the front, keypad header up: eight right-angle pins along the top edge under TO MATRIX KEYPAD, the 16-pin chip below them with two capacitors to its right, two round LEGO holes, a keypad-and-finger drawing, lonely binary up the left edge, two resistors at the lower right, and four pins along the bottom edge under GND, VCC, SDA and SCL.
The front. The eight pins at the top are the keypad's; the four at the bottom are your board's, GND on the left.
The back of the TK85: TO MATRIX KEYPAD over the eight solder joints at the top, I2C PULLUP over a small two-part pad at the upper left, a large keypad-and-finger drawing, the two LEGO holes, a gold box printed TK85 beside MATRIX KEYPAD I2C ADAPTER, four solder joints with one square pad, and CONVERT MATRIX KEYPAD TO I2C along the bottom.
The back. No pin names here, and no address pads: just the pull-up cut pad.

Four jobs

Every part on the board belongs to one of four jobs. Pick one to light it, turn the board over, or switch to the compact adapter to see what changes.

The adapter, to scale
TK85, v2 · 22.4 × 30.4 mm · front

P7 → chip pin 12 · P6 → chip pin 11 · P5 → chip pin 10 · P4 → chip pin 9 · P3 → chip pin 7 · P2 → chip pin 6 · P1 → chip pin 5 · P0 → chip pin 4

Form
Show
Side
Pins
8
Parts in between
0
Order, left to right
P7 … P0
Eight pins, straight to the chip, in the same order on both forms. Each one is a port pin of the PCF8574, with no resistor on any of them. The chip itself decides which of the eight are pulling low and which are listening.

The keypad header is eight pins wired straight to the chip's P0 to P7, with nothing in between. Seen from the front with the header at the top, they run P7 on the left to P0 on the right. The header prints no names; P7 to P0 are the chip's.

The bus header is GND, VCC, SDA and SCL, left to right along the bottom edge. The chip runs on 2.5 to 6 V. Feed VCC from your board's own logic voltage — 3.3 V on an ESP32, 5 V on an Uno — because the next job ties SDA and SCL to it. There is no regulator on the board.

The pull-ups are two 10 kΩ resistors from SDA and SCL to VCC. I²C needs them: devices on the bus only ever pull the lines down, and something has to pull them back up. They reach VCC through the pad printed I2C PULLUP on the back, which ships joined by a thin copper link. Cutting the link removes them, which matters only when many boards share one bus.

The address has no part of its own on the TK85. The chip's three address pins are wired to GND under the chip, so it answers at 0x20, always.

What the compact adapter adds

The back of the compact adapter: TK85 MATRIX KEYPAD I2C ADAPTER printed in the middle, GND, VCC, SDA and SCL beside the four pins on the right, three solder pads labelled A0, A1 and A2 with I2C ADD at the top left, and I2C PULL UP printed down the left side.
The compact adapter's back, which is where its labels are. Turned over, its four bus pins are on the right.

The compact adapter in the keypad packs has the same keypad header, the same pull-ups behind a cut pad printed I2C PULL UP, and its four bus pins out of the side. What it adds is the address pads: three pairs of pads on the back, one per address bit. Each address pin is held at 0 by a 10 kΩ resistor to GND; a blob of solder across a pad connects it to VCC instead and makes that bit 1.

The two labels that are swapped

On the compact adapter the design files and the silkscreen disagree. The pad printed A0 is wired to the chip's A2 pin, and the pad printed A2 to A0. A1 is right.

So bridging the pad marked A0 moves the adapter from 0x20 to 0x24, not 0x21. Nothing is harmed — it is still a different address, which is the point — but do not trust the arithmetic. After soldering, scan the bus and use the address it prints. More than one keypad walks through it.

When it does not work

Can I use the chip's interrupt pin to avoid polling?

Not on either form. The PCF8574 has an INT output, and the I2CKeyPad library can use it, but neither board brings it out to a pin. Poll every 20 ms or so; it costs well under a millisecond each time.

What are the two small parts beside the chip?

A 10 µF and a 100 nF capacitor across the supply. They hold VCC steady at the chip while it switches, and they need nothing from you. On the TK85 they sit to the right of the chip; the two further down are the pull-ups.

Why are there no resistors on the eight keypad pins?

The chip does not need them. A PCF8574 pin set to 1 is held high only by a weak current source of tens to hundreds of microamps, which a pressed key can overpower; a pin set to 0 pulls down hard. The next chapter shows why that is enough to read a key.

Is the I2C PULLUP pad on my TK85 open or closed?

Closed. A thin copper link joins its two halves as it ships, so the pull-ups are on. A meter on continuity across the two halves beeps. Cut the link only when other boards on the bus already pull it up.

Where this goes next

How the library finds a pressed key with two writes and two reads, and why the answer is a number, not a character.

Two reads per key →

Edit this page — content/books/matrix-keypad/the-adapter-pin-by-pin.mdx

Community

Questions about this product

See what other owners have asked, and read their solutions.

This page covers several products. Choose yours to see the right discussions.

Discuss this article

Ask about this page. The answer stays here, on the page it belongs to, for whoever hits the same wall next.

Browse Modules and blocks on the forum →