Jump to content

Engineering Projects/ComboLockPick

From Wikiversity
Sketchup drawing of Solenoid pulling open a combination lock

Problem Statement (Finish description)

[edit | edit source]

Mechanism attached to a computer that can open a Masterlock combination lock.

Conceive

[edit | edit source]
Why
  1. Opening a Masterlock without knowing the combination is not the goal. This can be done with a shim video.
  2. Reuse abandoned Masterlocks by retrieving forgotten combination
Original Inspiration
  • Original project by students at Olin College
  • Step by Step guide to how a masterlock can be opened:
  • Wikihow steps for cracking a Masterlock Combo Lock.
  • Hackaday step by step guide for Masterlock.

Design

[edit | edit source]
  • The algorithm or steps to figuring out the combination of a Masterlock manually are well known.
  • Videos exist on how to do this.
  • The goal is to automate this process.
  • This design section here focuses on the mechanical subsystems and electrical components:
Physical Mechanism .. putting the lock into the device, mounting physical pieces, knob grabber
Rotating Shaft

The gear mechanism was damaged every time a new lock was inserted. Ultimately the stepper motor was damaged. Several innovative solutions were tried that suffered the same fate. Success was achieved when the two bearing solution was abandoned. One bearing flopped while the lock was being replaced, but then when put back together, the knob on the combo lock turned into the second bearing or second support and the shaft locked into place.

Solenoid from dollar bill changer
Finding Relay driven by Arduino to switch Solenoid's AC power on and off

Reviewing existing relays

Gave up and purchased a Power Switch Tail II

Stepper motor to turn the knob and test all combinations

Next step is to mount the new motor and perhaps change the small gear or change the big gear on the shaft to the combo lock knob.

Switch to tell if the solenoid has successfully opened the lock

A new project was formed to hack the Vernier laser photogate. This was completed successfully:

Mounting switch on apparatus

Came up with 3 different options that could potentially be used to attach the photogate to the ComboLock

  • Option 1 could work but slight problem becomes apparent. Screws have to be screwed into photogate. The problem with this is that it could interfere with the wiring and other components of the photogate.
  • Option 2 is a different form of option 1 and could also work. but again there is a problem with this option as well. The solution is a permanent one and once the photogate is glued to the metal bracket it can not be swapped out if the photogate is faulty.
  • Option 3 seems like the best choice. Photogate can be removed and also positioned precisely as needed for the solenoid to break the laser beam. Went with option 3; however, major mods had to be done for this mounting option to work.

First, had to cut aluminum rod to the right length for it to fit properly on the chemistry test tube clamp.

Next, flatten one end so it sit flush on the backboard of the ComboLock.

Once the rod was flattened drill a screw hole on the flattened end so a screw could be used to attach it to the ComboLock back board.

Now the chemistry clamp will hold the photogate. To move up and down will have to drill hole in wood. To move in and out loosen chemistry clamp.

Final step was to screw on flattened rod on to the backboard of the combolock and to attach photogate.

Implement

[edit | edit source]

This section focuses on the software.

stepper motor testing software

Used the example programs that came with the original motor shield.

current code (has solenoid firing in it also)

//uses Adafruit Motor shield library
#include <Wire.h>
#include <Adafruit_MotorShield.h>

#include <utility/Adafruit_PWMServo Driver.h>

Adafruit_MotorShield AFMS = Adafruit_MotorShield();

//AF_Stepper motor(200, 2);
Adafruit_StepperMotor *motor = AFMS.getStepper(200,2);
int solenoid = 6; //set solenoid to digital pin 6
int first;
int second;
int third;
 
void setup() {
  Serial.begin(9600);    // set up Serial library at 9600 bps
  Serial.println("Complete test of stepper motor.");
  AFMS.begin();            // create with default frequency 1.6 kHz
  motor->setSpeed(120);    // 120 rpm 
 
  // initialize the digital pin as an output
  pinMode(solenoid, OUTPUT);
  digitalWrite(solenoid, LOW);
}
 
void loop() {
  //continue interations until lock is opened
  combinations();
}
 
void combinations() {
  for (first = 1; first < 40; first++){
    for (second = 1; second < 40; second++){
      for (third = 1; third < 40; third++){
        motor->step(first*5, FORWARD, DOUBLE);
        delay(250);
        motor->step(200, BACKWARD, DOUBLE);
        motor->step(second*5, BACKWARD, DOUBLE);
        delay(250);
        motor->step(third*5, FORWARD, DOUBLE);
        delay(250);
 
        digitalWrite(solenoid, HIGH);   // turn the solenoid on (HIGH is the voltage level)
        delay(20);                     // wait for a 0.02 seconds
        digitalWrite(solenoid, LOW);    // turn the solenoid off by making the voltage LOW
        delay(100);                     // wait for a tenth of a second
 
        Serial.print("Combination attempted is ");
        Serial.print(first);
        Serial.print(", ");
        Serial.print(second);
        Serial.print(", ");
        Serial.print(third);
        Serial.print(".");
 
        //finish with three full forward rotations
        motor->step(600,FORWARD, DOUBLE);
        delay(1000);
      } 
    }
  }
}

If get error message such as "AF_Stepper does not name a type", then need to download the driver from [| Adafruit]. This link is to the driver for the motor controller version 1.

switch testing software

Use arduino example>analog>analogyInOutSerial video. See design section on switch for more detail.

soleniod testing software

Can use the example>digital>blink program if solenoid is attached to digital pin 13.

Change on to 50ms and off to 200ms for testing purposes.

Want high only long enough for the switch to test if the right combination has been found. Don't know this yet.

Figuring out which arduino pins to use when combining all the programs
Writing software that tests all three assemblies sequentially in one sketch
Code that figures out all three combinations
Code that displays current progress and enters the third number found manually
  • do in processing ... so emulates entering the third number video ad displays progress

Operate

[edit | edit source]

Operation manual, troubleshooting manual would go here.

presentation

Next Steps

[edit | edit source]
  • Spin Off Project: Design knob grabber in openSCAD and then print on makerbot so can grab any serrated knob in the future
  • Mount new stepper motor
  • Redo gears so that stepper motor has really small one on it's shaft and really big one on the knob shaft
  • Work on code that tests solenoid, switch and stepper motor, then start doing some reliability testing
  • Find the combination of a lock by hand using one of the internet video's
  • Write receiving processing sketch running on computer and sending arduino sketch that communicate through a USB cable