ESP32-S3 BLE actuator + SwiftUI iPhone app that pulls the door handle open on a tap. Fully 3D-printed mechanism with DC gear motor, limit switches, and closed-loop control. Daily driver on a real apartment door.
Featured on Sam Snyder's portfolio — see the Precision Mechatronics section.
- Open the OpenSesame iPhone app (or trigger from lock screen / widget).
- App scans for the BLE peripheral named
DoorOpener. - Tap "Open" → writes the command
"OPEN"to the BLE characteristic. - ESP32-S3 executes the full cycle:
- Motor forward until
LIMIT_OPENtriggers → stop. - Hold open for 2 seconds.
- Motor reverse until
LIMIT_CLOSEDtriggers → stop.
- Motor forward until
- Firmware continuously notifies status (
Opening/Open/Closing/Closed). App animates with glow effects and short video loops. - Handle returns to closed and ready state. Cycle is reliable and repeatable.
Serial console also accepts the literal string OPEN for testing.
| Component | Detail |
|---|---|
| MCU | ESP32-S3 |
| Motor Driver | L298N-style (IN1/IN2/ENA + PWM) |
| Motor | DC gear motor driving 3D-printed spur gear on the handle |
| Endstops | 2× normally-open limit switches (INPUT_PULLUP) |
| Indicator | 1× Adafruit NeoPixel (RGB) |
| Power | USB or wall adapter to door frame |
| Mechanism | 5-part 3D-printed assembly (see below) |
| Signal | Pin | Notes |
|---|---|---|
| MOTOR_IN1 | 5 | Direction control |
| MOTOR_IN2 | 6 | Direction control |
| MOTOR_ENA | 7 | PWM enable (speed) |
| LIMIT_OPEN | 8 | Active LOW when handle fully open |
| LIMIT_CLOSED | 9 | Active LOW when handle fully closed |
| RGB LED | 21 | NeoPixel data |
Motor ramp: Starts at PWM ~80 to overcome static friction, then ramps to full over ~180 ms. Prevents gear stripping on initial engagement.
Key behaviors:
- BLE server with READ | WRITE | NOTIFY on a single characteristic.
- Device name:
DoorOpener - Service UUID:
4fafc201-1fb5-459e-8fcc-c5c9c331914b - Characteristic UUID:
beb5483e-36e1-4688-b7f5-ea07361b26a8 - WiFi + ElegantOTA (wireless firmware updates at
http://<ip>/updateor mDNSopensesame.local/update). - Status notifications on every state change.
- BLE advertising watchdog in the main loop (restarts advertising if it drops).
- Limit-switch homing with 10 s safety timeout.
- LED feedback: solid red (closed), green flash (opening), solid green (open), yellow flash (closing).
The firmware lives in firmware/Door_Handle_BLE_Code/Door_Handle_BLE_Code.ino.
- OpenSesame — native SwiftUI app using CoreBluetooth.
- Scans for and connects to
DoorOpener. - Single prominent action to send the open command.
- Real-time status text + color glow updates driven by BLE notifications.
- Bundled short video assets (
Door Opening.mov,Door Open.mov,Door Closing.mov) for rich animated feedback (fixed-height player area so layout doesn't jump). - Core Data persistence layer.
- Clean, minimal UI designed for quick one-tap use.
Project is in the ios-app/OpenSesame/ directory (Xcode project).
All parts were designed for easy FDM printing and apartment-door installation. The mechanism uses a toothed arc on the existing handle + spur gear on the motor shaft.
Files under hardware/stl/ (GitHub renders these interactively in 3D — click any .stl):
Door Handle - Base Plate.stlDoor Handle - Motor Mount Final.stlDoor Handle - Motor Gear Final.stlDoor Handle - Top Cover.stlDoor Handle Toothed Arc.stl
.
├── README.md
├── LICENSE
├── .gitignore
├── hardware/
│ └── stl/
│ └── Door Handle - *.stl # 5 mechanical parts (view in 3D on GitHub)
├── firmware/
│ └── Door_Handle_BLE_Code/
│ └── Door_Handle_BLE_Code.ino # ESP32-S3 Arduino firmware (BLE + OTA + motor)
└── ios-app/
└── OpenSesame/ # SwiftUI iPhone app (Xcode project + video assets)
- Open
firmware/Door_Handle_BLE_Code/Door_Handle_BLE_Code.inoin Arduino IDE (or PlatformIO / Arduino CLI). - Select ESP32-S3 board, appropriate partition scheme (for OTA + BLE).
- Update WiFi credentials if needed for your network (current:
WAVLINK-N). - Flash over USB.
- After first boot you can use ElegantOTA for future updates.
- Open
ios-app/OpenSesame/OpenSesame.xcodeprojin Xcode. - Select your iPhone target, sign with your developer account (requires BLE / Local Network capability).
- Build & run. The app will request Bluetooth permission on first launch.
Test without the phone: connect via Serial Monitor and type OPEN + Enter.
Installed on a real apartment door. Works from the lock screen via the app or Shortcuts integration potential. Limit switches provide reliable end-of-travel detection with no encoder needed. The 2-second hold gives enough time to enter before it auto-closes.
- Embedded: ESP32-S3 (FreeRTOS under the hood), Arduino/C++, BLE (GATT server + notify), WiFi + OTA
- Motor control: PWM ramping, limit switch homing, direction logic
- iOS: SwiftUI, CoreBluetooth, AVKit (video players), Core Data
- Mechanical: 3D printed custom mechanism design + integration with existing door hardware
- End-to-end ownership: firmware ↔ BLE protocol ↔ phone UX ↔ physical mechanism
MIT License — see LICENSE.
Sam Snyder — Robotics / Automation / Precision Mechatronics
Austin, TX | samhsnyder.com | Portfolio
This is a complete, ship-it personal project showing firmware + app + mechanism integration under real-world constraints.