1x4 membrane keypad (4 keys) with ESP32

Supply 3.3 V Bus GPIO
COMK1K2K3K4

Pins and ESP32 wiring

PinRoleESP32 pinNotes
COMGroundGNDCommon line to GND. On some keypads the common is pin 2: check with a multimeter
K1Output (the part drives it)D25Key 1: to a GPIO with INPUT_PULLUP, reads LOW when pressed
K2Output (the part drives it)D26Key 2
K3Output (the part drives it)D27Key 3
K4Output (the part drives it)D32Key 4

Suggested wiring for the 30-pin ESP32 DevKit, avoiding flash, input-only and strapping pins. BoardPilot checks it for you as you wire.

Starter code (Arduino)

void setup() {
  Serial.begin(115200);
  pinMode(25, INPUT);  // K1
}

void loop() {
  Serial.println(digitalRead(25));
  delay(100);
}

Sources

Try it in 3D in BoardPilot

BoardPilot Part data (JSON)

Related parts

Part data: CC BY 4.0, free to reuse with credit to BoardPilot.