explaingit

2dom/keypad

Analysis updated 2026-05-18

89C++Audience · developerComplexity · 4/5Setup · hard

TLDR

An open-source DIY Zigbee touch keypad built around the ESP32-C6, with PCB Gerber files, a 3D-printable case, and PlatformIO firmware for Home Assistant integration and six-month battery life.

Mindmap

mindmap
  root((keypad))
    Hardware
      ESP32-C6 board
      MPR121 touch controller
      LiPo battery
      Custom PCB
    Build Files
      Gerber files
      3D printable case
      PlatformIO firmware
    Protocols
      Zigbee
      Matter
      Thread
    Home Assistant
      ZHA integration
      Zigbee2MQTT
      Automation YAML
    Features
      6 month battery life
      Deep sleep wakeup
      No cloud needed
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Build a battery-powered Zigbee door keypad using the included Gerber files, 3D-printable case, and PlatformIO firmware

USE CASE 2

Integrate the keypad with Home Assistant via ZHA or Zigbee2MQTT to trigger lock or alarm automations on code entry

USE CASE 3

Adapt the same ESP32-C6 hardware to run Matter or Thread instead of Zigbee by swapping the radio stack

USE CASE 4

Order custom PCBs from a fab service using the included Gerber files in black-on-white or white-on-black color scheme

What is it built with?

C++PlatformIOESP32-C6ZigbeeMPR121Home Assistant

How does it compare?

2dom/keypadiamsopotatoe-coder/tinyload5ec1cff/injectrc
Stars8910065
LanguageC++C++C++
Setup difficultyhardmoderatehard
Complexity4/54/54/5
Audiencedeveloperresearcherdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · hard Time to first run · 1day+

Requires ordering a custom PCB from a fabrication service, 3D printing the case, assembling the hardware, and flashing the firmware with PlatformIO.

In plain English

keypad is a do-it-yourself wireless touch keypad designed to work with smart home systems like Home Assistant. The creator built it because existing off-the-shelf Zigbee keypads were expensive or locked to a single ecosystem. The result is a battery-powered, slim device roughly the size of a pack of gum, with twelve capacitive touch buttons arranged in a 2x6 grid (digits 1-9, zero, clear, and enter). It runs for about six months on a single charge and wakes from deep sleep the instant a key is touched. The hardware centers on an ESP32-C6 development board paired with an MPR121 touch controller chip. The ESP32-C6 is a microcontroller with built-in support for Zigbee, Matter, and Thread radio protocols. The firmware in this repo targets Zigbee, but the README notes that switching to Matter or Thread only changes the radio stack, the touch handling and power management code stays the same. The device connects to a 1300 mAh LiPo battery, and the whole assembly clips together without screws. Labels on the keys are printed directly into the PCB solder mask rather than applied as a separate overlay, so there is nothing to peel off over time. The repository includes everything needed to reproduce the design: Gerber files ready to upload to a PCB fabrication service, an STL file for 3D-printing the case, and C++ firmware that builds with PlatformIO. Two color schemes are available (black on white, white on black). Wiring is straightforward: five signals connect the touch controller to the ESP32-C6 via I2C, plus one interrupt pin that also wakes the device from deep sleep. When a code is entered and the user presses Enter, the keypad reports the numeric value over Zigbee and resets two seconds later. Home Assistant picks it up through the ZHA or Zigbee2MQTT integrations, where the device appears as "DrDoms KeyPad2." A sample automation YAML file is included in the repo to help with mapping codes to lock or alarm actions.

Copy-paste prompts

Prompt 1
I'm building the 2dom/keypad project. Walk me through uploading the Gerber files to JLCPCB and flashing the firmware with PlatformIO.
Prompt 2
Help me write a Home Assistant automation that triggers an alarm disarm when the correct code is entered on the DrDoms KeyPad2 sensor.
Prompt 3
The 2dom/keypad firmware always prepends a '1' to every entered code. Where in the firmware can I change or remove this behavior?
Prompt 4
How do I extend the keypad code length beyond 8 digits in the 2dom/keypad firmware? Which variable should I change?
Prompt 5
I want to add a second 2dom/keypad to my Home Assistant setup. What do I need to change in the firmware so the two devices report to separate sensor entities?

Frequently asked questions

What is keypad?

An open-source DIY Zigbee touch keypad built around the ESP32-C6, with PCB Gerber files, a 3D-printable case, and PlatformIO firmware for Home Assistant integration and six-month battery life.

What language is keypad written in?

Mainly C++. The stack also includes C++, PlatformIO, ESP32-C6.

How hard is keypad to set up?

Setup difficulty is rated hard, with roughly 1day+ to a first successful run.

Who is keypad for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub 2dom on gitmyhub

Verify against the repo before relying on details.