All wiring guides

Free wiring guides

Wire the 3×4 keypad to the ESP32-C3

Membrane keypad, 3×4. Twelve keys on seven wires.

When buying: Seven pins: four rows, then three columns.

Which pin goes where

On the partOn the ESP32-C3
R1GPIO 0
R2GPIO 1
R3GPIO 3
R4GPIO 4
C1GPIO 5
C2GPIO 6
C3GPIO 7

Wire it with the USB cable unplugged. Follow the names printed on your own part: makers sometimes reorder the pins.

In 3D

Example sketch

// Membrane keypad, 3×4
// on the ESP32-C3 Super Mini
// https://stem.manusignal.com/en/parts/3x4-keypad-esp32-c3
#include <Keypad.h>

const int PIN_R1 = 0;
const int PIN_R2 = 1;
const int PIN_R3 = 3;
const int PIN_R4 = 4;
const int PIN_C1 = 5;
const int PIN_C2 = 6;
const int PIN_C3 = 7;

char keys[4][3] = {{'1', '2', '3'}, {'4', '5', '6'}, {'7', '8', '9'}, {'*', '0', '#'}};
byte rowPins[4] = {PIN_R1, PIN_R2, PIN_R3, PIN_R4};
byte colPins[3] = {PIN_C1, PIN_C2, PIN_C3};
Keypad keypad = Keypad(makeKeymap(keys), rowPins, colPins, 4, 3);

void setup() {
  Serial.begin(115200);
}

void loop() {
  char key = keypad.getKey();
  if (key) Serial.println(key);
}
  • Tools > Board > ESP32C3 Dev Module (USB CDC On Boot: Enabled), then Tools > Port and choose the board's port.
  • Keypad: install it from Sketch > Include Library > Manage Libraries.

This sketch is compiled for the board before the page is published. It has not been run on real hardware by us.

What you should see

Open the Serial Monitor at 115200. Each key prints its own character.

If it does not work

The wrong key registers.
The ribbon is plugged in mirrored. Pin 1 is on the left with the keys facing you.

The same part on the ESP32-S3

More parts on the ESP32-C3