Skip to the content
2 layers60 × 40 mmArmored rear hub, the printed circuit board in 3D

A universal-fit, zero-friction smart lock that gives any standard bicycle the premium security and convenience of high-end electric scooters.

Size
60 × 40 mm
Copper layers
2
Thickness
1.6 mm
Parts
32
Nets
18
Pads
200
Tracks, vias
11, 20
Pours
1
Routed
Yes
KiCad
KiCad 8 (file 20240108)
Created
22 Oct 2026
Updated
23 Oct 2026

Overview

Armored rear hub is an open-source printed circuit board by SanjayButCodes, from the SanjayButCodes/Aegis-Smart-Cycle-Lock repository on GitHub. It is a 2-layer board of 60 × 40 mm with 32 parts on 18 nets, routed with 11 tracks and 20 vias.

It is built around the ESP32-WROOM-32U. Its parts include 9 resistors, 8 capacitors, 5 connectors, 4 ICs and 1 transistor. It belongs with the ESP32 boards of this library.

Main components

1

README

README.md

Aegis Smart Cycle Lock

Aegis is a heavy-duty, open-source, distributed smart bicycle lock. Unlike standard commercial locks, Aegis uses a split-node architecture to physically separate the user interface from the vulnerable locking mechanism, making it highly resistant to tampering and brute-force attacks.

🏗️ System Architecture

The system consists of two custom-designed nodes connected by a weather-sealed Cat5e bridge cable:

The Handlebar Hub (User Interface): A compact, IP65-rated pod mounted to the handlebars. It contains an Arduino Nano, an NFC card reader, an RGB status LED, and a locking button. It operates purely on 5V logic.

The Armored Rear Hub (The Brain & Brawn): A heavy-duty horseshoe frame lock mounted over the rear tire. It houses the ESP32 brain, a 12V worm-gear motor, a 3S battery pack, a 110dB siren, and an IMU accelerometer for theft detection.

The "Dead-Man Loop" Tamper Trace

A continuous 3.3V continuity loop originates at the Rear Hub, travels up the Cat5e cable, and traces the exact outer physical perimeter of the Handlebar Hub PCB. If a thief cuts the communication cable or attempts to crack open the Handlebar enclosure, the circuit breaks and the Rear Hub instantly triggers the 110dB siren.

⚡ Hardware Specifications

Armored Rear Hub (Main PCB)

Microcontroller: ESP32-WROOM-32U (Requires external antenna)

Power Supply: 3S (11.1V-12.6V) 18650 Battery Pack

Charging: IP2326 3S Type-C BMS charging IC

Logic Power: MP2315 Buck Converter (Steps 12.6V down to clean 3.3V)

Motor Driver: DRV8871 H-Bridge (Handling up to 2A stall current)

Actuator: JGY370 12V Worm Gear Motor

Sensors: MPU6050 Accelerometer (Wired to ESP32 ext0 wake interrupt)

Audio: 5V Active Piezo Siren

Handlebar Hub (UI PCB)

Microcontroller: Arduino Nano (DIP-30)

Authentication: PN532 NFC/RFID Module (I2C)

User Input: 12mm Waterproof Momentary Push Button

Feedback: Common Cathode RGB LED

Communication: 9600-baud UART over Cat5e Bridge

🛠️ Mechanical & CAD Design

The physical enclosures are designed to be FDM 3D-printed in highly impact-resistant materials like PETG, ABS, or Polycarbonate.

The Deadbolt: The locking mechanism uses a 12mm hardened steel rod acting as a deadbolt.

Rack and Pinion: The JGY370 motor drives a Module 1.5 pinion gear, converting rotational torque into linear motion to slide the deadbolt across the rear tire spokes.

Limit Switches: Two KW12-3 micro limit switches are installed at the ends of the deadbolt track to cut motor power precisely when fully locked or fully unlocked, preventing gear stripping.

Weatherproofing: The enclosures utilize overlapping lap joints designed to hold TPU gaskets or silicone bead seals to protect against rain and tire splash.

💻 Firmware & Software

The codebase is split into two environments:

/firmware/handlebar_nano/: Runs a non-blocking loop polling the PN532 for authorized MIFARE tags. Upon reading a tag or button press, it transmits a clean UART string (e.g., CMD:UNLOCK:UID) down to the rear hub.

/firmware/rear_esp32/: The central state machine. It manages the DRV8871 motor phases, parses UART commands, and handles extreme power conservation.

Deep Sleep Architecture

To allow the lock to run for months on a single charge, the ESP32 enters deep sleep immediately upon locking. It consumes only ~10µA until the MPU6050 accelerometer detects physical tampering, which triggers a hardware interrupt on GPIO 25, waking the ESP32 instantly to sound the alarm.

⚠️ High-Current Safety Warning

This project drives a high-torque 12V motor capable of drawing up to 2 Amps when stalled against a jammed lock.

PCB Routing: The VBAT and MOTOR nets on the Rear Hub PCB must be routed at a minimum of 4.0mm trace width.

Battery: Only use protected 3S battery packs with an integrated BMS. Never run standard 1S cells in series without balancing protection.

🚀 Getting Started

(Instructions for ordering PCBs, flashing code, and assembling the CAD files will be added here as the final manufacturing files are released.)

Parts

32
QtyValueFootprintReferences
4M3 NPTHMountingHole:MountingHole_3.2mm_M3H1, H2, H3, H4
1100K IMU PDResistor_SMD:R_0805_2012MetricR6
1100n 3V3Capacitor_SMD:C_0805_2012MetricC3
1100n IMUCapacitor_SMD:C_0805_2012MetricC5
1100n USBCapacitor_SMD:C_0805_2012MetricC1
1100n VMCapacitor_SMD:C_0805_2012MetricC7
110K EN PDResistor_SMD:R_0805_2012MetricR5
110K RX DIVResistor_SMD:R_0805_2012MetricR8
110u 3V3Capacitor_SMD:C_0805_2012MetricC2
11K DEADMANResistor_SMD:R_0805_2012MetricR9
11u IMUCapacitor_SMD:C_0805_2012MetricC4
11u VMCapacitor_SMD:C_0805_2012MetricC6
120K RX DIVResistor_SMD:R_0805_2012MetricR7
1220uF 25V MOTOR BULKCapacitor_THT:CP_Radial_D8.0mm_P3.50mmC8
13S BMS BATTERYConnector_JST:JST_XH_B2B-XH-A_1x02_P2.50mm_VerticalJ2
14K7 SCLResistor_SMD:R_0805_2012MetricR4
14K7 SDAResistor_SMD:R_0805_2012MetricR3
15K1 CC1Resistor_SMD:R_0805_2012MetricR1
15K1 CC2Resistor_SMD:R_0805_2012MetricR2
15V ACTIVE BUZZERBuzzer_Beeper:Buzzer_15x7.5RM7.6BZ1
1BUZZER NMOSPackage_TO_SOT_SMD:SOT-23Q1
1CAT5e BRIDGETerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-6-5.08_1x06_P5.08mm_HorizontalJ4
1DRV8871 H-BRIDGEPackage_SO:SOIC-8-1EP_3.9x4.9mm_P1.27mm_EP2.29x3mm_ThermalViasU2
1ESP32-WROOM-32URF_Module:ESP32-WROOM-32UU1
1IP2326 3S CHARGERPackage_DFN_QFN:VQFN-24-1EP_4x4mm_P0.5mm_EP2.5x2.5mmU4
1JGY370 MOTORConnector_JST:JST_XH_B2B-XH-A_1x02_P2.50mm_VerticalJ3
1MP2315 3V3 BUCKPackage_TO_SOT_SMD:TSOT-23-8U3
1MPU6050 MODULEConnector_PinSocket_2.54mm:PinSocket_1x08_P2.54mm_VerticalJ5
1USB-C CHARGE INPUTConnector_USB:USB_C_Receptacle_HRO_TYPE-C-31-M-12J1

More from SanjayButCodes/Aegis-Smart-Cycle-Lock

1
  • 2 layers60 × 40 mmHandlebar Hub revB, the printed circuit board in 3D

    Handlebar Hub revB

    SanjayButCodes/Aegis-Smart-Cycle-Lock

    A universal-fit, zero-friction smart lock that gives any standard bicycle the premium security and convenience of high-end electric scooters.

    12 parts3

Similar boards

  • 2 layers55 × 80 mmBoard esp32 v2, the printed circuit board in 3D

    Board esp32 v2

    sudomesh/disaster-radio

    A (paused) work-in-progress long-range, low-bandwidth wireless disaster recovery mesh network powered by the sun.

    101 parts1.1k
  • 2 layers110 × 110 mmFreeDSP aurora, the printed circuit board in 3D

    FreeDSP aurora

    freeDSP/freeDSP-aurora

    freeDSP ADAU1452 with 8 analog input, 8 analog outputs, S/P-DIF I/O, ADAT I/O, USB Audio Class2, WiFi, Bluetooth

    506 parts226CC-BY-SA-4.0
  • 2 layers63.5 × 63.5 mmMain pcb, the printed circuit board in 3D

    Main pcb

    peterkrull/quad

    Firmware, hardware and documentation for my autonomous quad copter project

    45 parts210GPL-3.0
  • 4 layers65 × 56 mmEdrumulus, the printed circuit board in 3D

    Edrumulus

    corrados/edrumulus

    Open Source E-Drum Trigger Module

    112 parts163GPL-2.0
  • 2 layers94 × 79 mm5 - Lizard Car, the printed circuit board in 3D

    5 - Lizard Car

    TRD-B/Lizard

    3D printed RC race car with custom electronics

    54 parts129CC-BY-4.0
  • 2 layers263.5 × 63.5 mmTobor, the printed circuit board in 3D

    Tobor

    evezor/tobor_v00

    Tobor (robot spelled backwards), was built to be the most versatile open-source robotics system

    124 parts126CERN-OHL-P-2.0
  • 2 layers121 × 68 mmFreeds sanchez, the printed circuit board in 3D

    Freeds sanchez

    pablozg/freeds

    Derivador de energía solar excedente creado por Pablo Zerón, Diseño PCB por Amcalo, Tester original por Aeizoon, Wiki por Zoilo Mora

    42 parts108
  • 2 layers74.4 × 51.2 mmEsp32-wroom timer, the printed circuit board in 3D

    Esp32-wroom timer

    AlessandroAU/Chorus32-ESP32LapTimer

    This is an ESP32 port of the popular Chorus RF Laptimer

    66 parts102GPL-3.0

Questions

How big is the Armored rear hub PCB?

It measures 60 × 40 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Armored rear hub use?

32 parts, built around the ESP32-WROOM-32U. 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 Armored rear hub KiCad files?

From the SanjayButCodes/Aegis-Smart-Cycle-Lock repository on GitHub, at the commit this page was made from: the board is LockWithPCB/Electrical/MainPCB/armored_rear_hub.kicad_pcb and its schematic LockWithPCB/Electrical/MainPCB/armored_rear_hub.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Armored rear hub design in my own project?

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