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

DIY SmartLock

BROKER-2 avatarB
BROKER-2
@BROKER-2
Are you the creator of this robot?
Claim this project on orobot.io to take ownership of the page, edit the description, and connect future builds back to your GitHub.
raspberry-piesp32stm323d-printablediysmartlock

Confirmed fresh May 27, 2026

Sign up to Install
Share
𝕏 TwitterReddit
Details

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

🖨 Print Files (10)

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

upload-8836-1777905468009-0-SmartLock-assembled.stl

STL
↓ Download
Page 1 of 2
Hardware

Required Hardware

Slot 1
Unknown
Bill of Materials
Product links updated May 30, 2026 · Confirmed fresh May 27, 2026
$37–$89 estimated
QtyPartNotes
1- geared motor at 9V can close lock and open door
1- used Ultimaker 2 with black filament
1- ESP32's deep sleep current is very low (depending on the board) and it also has bluetooth.
1- 2*AA batteries ~= 3.2V for ESP32: alkaline < 5 Wh
1- 9V block battery for motor: alkaline < 3 Wh
1- step-up from 3.2V seems better since ESP is running more often than the motor and AA have higher capacity
1- then tried TB6612FNG Wemos I2C motor shield: works and specs are more than enough (two motors, 2.7-5.5V logic, <15V motor, 1.2A const./3.2A peak per channel)
1- seems unreliable and energy-intense - how long can the motor pull it open w/o damage?
1- ESP32 can stay in deep sleep and wake up from touch via one of its touch pins; metal on the inside is connected to the outside of the door
1- ESP32 as client: need some server running on the phone
1- ESP32 as server that phone connects to
1- yes if sequence: door sensor open/close, no motion, phone disconnected from WiFi for x min, phone connected to WiFi
ESP32 DevKit V1 / LOLIN D32 Development BoardTB6612FNG Dual Motor Driver BreakoutN20 Micro Gear Motor 6V (with shaft)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
Builds

Community Builds

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

Comments

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