The Automatic Padlock Opening Controller is a microcontroller-based system designed to automatically open a padlock using a motor-driven dial mechanism. Users interact with the system via a 4x4 keypad and monitor machine status in the Arduino Serial Monitor.
- Set and track dial position (
0-39for a 40-mark lock). - Open padlock in automatic mode with combination sequence logic.
- Provide one-click manual dial control in both directions.
- Display mode status, prompts, and errors via Serial Monitor.
- User enters initial dial position through keypad.
- System stores the position and prepares for operation.
- Dial position and prompts are shown in Serial Monitor.
- User enters three combination numbers.
- System performs lock sequence:
- Two full turns clockwise (RIGHT) to first number.
- One full turn counter-clockwise (LEFT), passing first number, to second number.
- One turn clockwise (RIGHT) to third number.
- System prompts user to pull shackle after completion.
- User rotates dial manually with keypad:
1: one-click clockwise2: one-click counter-clockwise
- Initializes variables, flags, and mode defaults.
- Reads keypad and selects operating mode.
- Captures initial dial position and transitions system to ready state.
- Executes complete lock-opening sequence from three user-entered numbers.
- Executes one-click movement per key press.
- Not required in this project; not implemented.
- Prints mode changes, prompts, and machine status to Serial Monitor.
- Handles invalid input and run-time fault messages.
The interface displays:
- Current mode
- Dial position
- Combination input progress
- Error and reset messages
Example main menu:
EME-154 Mechatronics
Free Time System
Yusen Hu
****************************************
OPERATION MENU
****************************************
1. Manual Operation
2. Automatic Operation
3. Machine Data Set-Up
5. Exit
Key development items completed:
- Implemented dial movement helpers:
moveCwToDialNO()moveCcwToDialNO()
- Implemented automatic sequence in
ACSfunction(). - Completed setup and automatic menu text blocks.
- Added/updated emergency recovery in
ERTfunction(). - Added PI controller parameters scaffold (
KI,INTEGRAL_LIMIT) for experimentation.
- Motor tuning difficulty
- Finding reliable
MIN_PWM,KP,KIfor different motor friction points.
- Finding reliable
- Memory / compatibility constraints
- Adopted
F()macro usage for many Serial strings.
- Adopted