programs/@broker-2/DIY SmartLock
DIY SmartLock — Home Automation
§ program
Home Automation

DIY SmartLock

broker-2 avatarB
broker-2
@broker-2
raspberry-piesp32stm323d-printablediysmartlock

Confirmed fresh May 27, 2026

Sign up to Install
Share
𝕏 TwitterReddit

About this program

DIY SmartLock

A battery-powered 3D-printed smart lock powered by an ESP32 and driven by an N20 geared motor. Designed for residential door locks, it replaces the manual key turn with touch-triggered automation — touching the metal door knob from outside wakes the ESP32 from deep sleep and checks MQTT for authorization before unlocking.

How It Works

The ESP32 spends nearly all of its time in deep sleep (as low as 5.2 µA on bare ESP32), waking only when the capacitive touch sensor detects contact with the door knob. On wake it connects to WiFi, subscribes to an MQTT topic (door/auth), and drives the N20 motor clockwise or counter-clockwise to lock or unlock. The system integrates naturally with Node-RED, Home Assistant, or any MQTT-capable automation stack for presence-based auto-auth.

Specifications

PropertyValue
ControllerESP32 (bare WROOM-32 or LOLIN D32)
MotorN20 geared DC motor (9 V, ~40 mA no-load)
Motor DriverTB6612FNG (direct GPIO control)
Power — Logic2x AA alkaline batteries (~3.2 V)
Power — Motor9 V block battery
Deep Sleep Current~5.2 µA (bare ESP32), 125 µA (LOLIN D32)
Wake TriggerCapacitive touch sensor (ESP32 pin T2)
ConnectivityWiFi 802.11 b/g/n + MQTT
Printed Parts4 (base, gear-motor, cage-motor, gear-key-knob)
Build DifficultyIntermediate
FirmwareArduino / PlatformIO

3D-Printed Parts (4 total)

All parts designed in Fusion 360. The full assembled model is also included for reference.

  1. Base — mounts to door hardware, holds electronics
  2. Gear Motor — gear interface between motor shaft and key
  3. Cage Motor — retains N20 motor in position
  4. Gear Key Knob — adapter that couples to existing door key

Bill of Materials (Estimated)

ComponentNotes
ESP32 bare / LOLIN D32LOLIN D32 recommended (125 µA deep sleep from battery)
N20 geared DC motorMust operate at 9 V to actuate door trap reliably
TB6612FNG motor driverDirect GPIO control; no I2C overhead
2x AA battery holderPowers ESP32 logic rail
9 V battery + clipPowers motor only
Jumper wires3 control pins: BIN1 (pin 27), BIN2 (pin 14), STBY (pin 26)
Metal screw or plateConnected to touch pin T2 to sense door knob contact

Attribution

Designer: Florian Vogler (@vogler on GitHub) Source: https://github.com/vogler/SmartLock License: Source-available (no explicit open-source license — check repo for usage terms) 3D Model: https://a360.co/4lLHHwa (Fusion 360, downloadable in multiple formats) Build Album: https://photos.app.goo.gl/bewiZ1qH8sHnJjmg7

🖨 Print Files (5)

0-SmartLock-assembled.stl

STL
↓ Download

1-base.stl

STL
↓ Download

2-gear-motor.stl

STL
↓ Download

3-cage-motor.stl

STL
↓ Download

4-gear-key-knob.stl

STL
↓ Download

Required Hardware

~$5–$15 total
Slot 1
ESP32 (BYOD)
Microcontroller with built-in WiFi and Bluetooth — for lightweight orobot firmware deployments.
$5–$15
Where to buy →
Product links updated May 30, 2026 · Confirmed fresh May 27, 2026
$37–$95 estimated
QtyPartNotes
1ESP32 DevKit V1 or LOLIN D32LOLIN D32 recommended — 125 µA deep sleep vs ~10 mA on DOIT DEVKIT
1N20 Geared DC Motor, 9VMust be rated 9V; 3–6V motors will not reliably actuate the door trap
1TB6612FNG Motor Driver BreakoutControls motor direction via GPIO; two-channel, handles up to 1.2A
12×AA Battery Holder with SwitchSupplies ~3.2V logic rail for ESP32
19V Battery Snap Connector with LeadsPowers motor rail from 9V block battery
1Energizer AA Alkaline Batteries (8-pack)Powers logic rail; AA alkaline recommended for capacity
1Energizer 9V Alkaline Battery (4-pack)Powers motor; 9V block alkaline
1Black PLA Filament 1.75mm 1kgFor printing base, gear-motor, cage-motor, gear-key-knob parts
1Dupont Jumper Wire KitConnects ESP32 GPIO pins to TB6612FNG (BIN1, BIN2, STBY)
1Electrical Insulating TapeWraps key slot for snug fit; insulates touch-pin metal contact
ESP32 DevKit V1 / LOLIN D32 Development BoardTB6612FNG Dual Motor Driver BreakoutN20 Micro Gear Motor 9V 105RPM (single)AA Battery Holder 2-Cell with Switch9V Battery Snap Connector with LeadsEnergizer AA Alkaline Batteries (8-pack)Energizer 9V Alkaline Battery (4-pack)Black PLA 3D Printer Filament 1.75mm 1kgDupont Jumper Wire KitElectrical Insulating Tape

Community Builds

I'm building thisShare your build
No community builds yet. Be the first to share yours!

Comments

Sign up to comment·or sign in
No comments yet — be the first!