Skip to the content
PCBKitNew board
2 layers15.5 × 12.5 mmLatch, the printed circuit board in 3D

magstripe emulation keychain!

Size
15.5 × 12.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
19
Nets
11
Pads
48
Tracks, vias
96, 29
Pours
11
Routed
Yes
KiCad
KiCad 10.99 (file 20260831)
Created
11 Sep 2026
Updated
14 Sep 2026

Overview

Latch is an open-source printed circuit board by pmnlla, from the pmnlla/neokey repository on GitHub. It is a 2-layer board of 15.5 × 12.5 mm with 19 parts on 11 nets, routed with 96 tracks and 29 vias.

It is built around the DRV8837DSG, DMP3013SFV and MMBF170. Its parts include 4 resistors, 2 transistors, 1 IC and 1 diode.

Main components

3

README

latch/README.md

XIAO RP2040 push-button power latch

This circuit powers a Seeed Studio XIAO RP2040 for as long as its button is held, then lets firmware keep power on for one second after release. After that the XIAO disconnects its own supply. Off-state current is principally MOSFET, diode, and capacitor leakage.

The populated circuit is in latch.sch. On first opening it, KiCad 10 will offer to convert the legacy container to latch.kicad_sch; save it beside the project files. The electrical content is not legacy-specific.

Connections

NetXIAO pinPurpose
SYS_3V33V3Switched supply
GNDGNDCommon ground
POWER_HOLDD1 / GPIO27High keeps power enabled
BUTTON_SENSED2 / GPIO28Low while SW1 is held

Q1 is the high-side switch. SW1 and D1 turn Q2 on before the XIAO has power. Firmware immediately drives POWER_HOLD high through D2, allowing Q2 to keep Q1 on after SW1 opens. Q3 provides a separately isolated button indication; this is necessary because Q2 holding the PMOS gate low otherwise looks exactly like a held button.

Use an AO3401A or another P-channel MOSFET specified for low resistance at VGS=-2.5 V. Do not substitute a MOSFET whose resistance is specified only at -10 V. Q2 and Q3 may be 2N7002 devices. D1 and D2 are low-leakage Schottky diodes; BAT54H is preferred over very leaky power Schottky parts.

The XIAO is intentionally fed through its 3V3 pin, not 5V, so its regulator is bypassed. Do not connect USB while the CR2032 is installed unless the power paths have first been checked for back-feeding on the exact XIAO revision.

CR2032 and coil warning

A CR2032 has appreciable internal resistance. C1 (100 uF) and C2 (100 nF) help with short load steps, but verify SYS_3V3 on an oscilloscope during RP2040 boot and coil pulses. Keep the coil off the GPIO: use a separate transistor driver and an appropriate inductive clamp. Size the battery and capacitor for peak current, not average current.

Firmware

The example uses the Raspberry Pi Pico SDK. Provide pico_sdk_import.cmake (normally copied or linked from the SDK), then build in the usual way:

sh
cmake -S . -B build -DPICO_BOARD=seeed_xiao_rp2040
cmake --build build

power_latch_init() must remain the first initialization in main(). A press during the one-second release interval cancels shutdown.

Parts

19
QtyValueFootprintReferences
7TestPoint_Pad_D1.0mmTestPoint:TestPoint_Pad_D1.0mm|ctl|, c, coil, ctl, s, sw, sw
3TestPoint_Pad_D2.0mmTestPoint:TestPoint_Pad_D2.0mm+, b, gnd
2100kResistor_SMD:R_0805_2012MetricR1, R3
110kResistor_SMD:R_0603_1608MetricR4
13k3Resistor_SMD:R_0603_1608MetricR2
1DDiode_SMD:D_0603_1608MetricD1
1DMP3013SFVPackage_SON:Diodes_PowerDI3333-8Q2
1DRV8837Package_SON:Texas_DSG0008A_WSON-8-1EP_2x2mm_P0.5mm_EP0.9x1.6mmU1
1MMBF170Package_TO_SOT_SMD:SOT-23Q3

The 18 most common of 19 parts.

Questions

How big is the Latch PCB?

It measures 15.5 × 12.5 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Latch use?

19 parts, built around the DRV8837DSG, DMP3013SFV and MMBF170. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Latch KiCad files?

From the pmnlla/neokey repository on GitHub, at the commit this page was made from: the board is latch/latch.kicad_pcb and its schematic latch/latch.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Latch design in my own project?

Its repository states no licence, so its author keeps all rights: ask pmnlla before reusing the design.

Similar boards

  • 4 layers54 × 11.6 mmBrodBoost PD, the printed circuit board in 3D

    BrodBoost PD

    axiometa/BrodBoost-PD

    Breadboard Powersupply with Power Delivery. Available Voltages 20,15,12,9,5. Based on CYPD3177 Chip

    39 parts38
  • 2 layers94 × 100 mmRobocar unified integrated carrier, the printed circuit board in 3D

    Robocar unified integrated carrier

    laurigates/mcu-tinkering-lab

    This repository contains projects for various embedded platforms (ESP32, Arduino, STM32).

    98 parts7MIT
  • 4 layers48 × 44.5 mmSmol servo rpi2350-tmc6200, the printed circuit board in 3D

    Smol servo rpi2350-tmc6200

    dognotdog/smol_servo

    circuitry and software for controlling NEMA17 size brushless motors and stepper motors as servos.

    151 parts5
  • 4 layers65 × 56.8 mmMPCIe HAT, the printed circuit board in 3D

    MPCIe HAT

    PiSupply/PiJuice-mPCIe

    Resources for the PiJuice mPCIe board

    135 parts5Apache-2.0
  • 2 layers27.4 × 58.7 mmLc29h mikrobus PCB, the printed circuit board in 3D

    Lc29h mikrobus PCB

    i2hm/micro_climate_station

    Open the KiCad project using KiCad 7 and above.

    48 parts3
  • 2 layers17.7 × 42.1 mmAnavi fixed power delivery, the printed circuit board in 3D

    Anavi fixed power delivery

    AnaviTechnology/anavi-fixed-power-delivery

    Small 2-layer fixed USB-C PD power sink with CYPD3177 and 2 pin terminal block.

    27 parts2
  • 2 layersMy power supply, the printed circuit board in 3D

    My power supply

    malcops/ps_pcb

    KICAD power supply project (TPS54560)

    68 parts1
  • 4 layers53 × 30 mmP42 PD Sink EPR r2, the printed circuit board in 3D

    P42 PD Sink EPR r2

    wolfgangfriedrich/P42-USB-C-PD-Sink-EPR

    USB-PD3.1 Sink EPR Diodes AP33771C

    57 parts1