Introduction: Robotic Lock Box

Hi, I am Patrick Mckee. I did this project as the final assessment to my robotics class this spring term. It took me about 8 weeks working on it for about 2-3 hours per week. I am still a beginner to robotics so that may explain the long timeline. I had a lot of fun with this project and I hope you can too. This can also be used as a starting point and feel free to tweak it for your needs. Enjoy!

Supplies

Nuts and Bolts

1 Hinge

1 Deadbolt

Electric Tape

Arduino Board: https://store.arduino.cc/usa/arduino-uno-rev3

Adafruit MotorShield: https://www.adafruit.com/product/1438

Micro Servo: https://www.adafruit.com/product/169

Battery Pack

Double Sided Tape

Drill

Laser Cutter

6 Sheets of Acrylic

Step 1: Cutting Your Box

To get the svg file for this box, I used https://www.festi.info/boxes.py/. You will want to use the “Closed Box” You can make the box any size you want. Then, just match up the ridges and push them together. If you are sure that all of your sides fit, but they don’t always remain together, you can use some super glue to reinforce the connection, but remember to keep one side off, because you will need to cut your door with it.

Step 2: Making Your Door

On Adobe Illustrator, make a simple box. Take the side you are choosing to put the door on and place it under the laser cutter. Run the perimeter and situate the door on the lower half of the box, leaving about 7 inches at the top for the servo and deadbolt. Then, cut your door.

Step 3: Attaching the Hinge

Putting the hinge on the door is pretty simple. Just situate the hinge on the door so it swings upward to open. Then, drill holes in the acrylic and attach the hinge with nuts and bolts. If the door does not swing freely or does not match up with the opening, feel free to sand down the sides of the acrylic.

Step 4: Attaching the Deadbolt

The deadbolt is very similar to the hinge. Set it up so that it drops down to lock. It is helpful to drill the holes for the nuts and bolt with the deadbolt in the locked position so you are sure it will line up. When you are done with this, add a handle of some kind to help with opening and closing the box. I layed two pieces of electrical tape sticky side together and left some room at both ends of one strip to tape it to the door.

Step 5: Locking/Unlocking

To set up the opening and closing of the dead bolt, connect a string to the servo arm and the arm of the deadbolt, so the when the servo rotates up, the bolt unlocks. I suggest that you put the servo arm in the farthest down position you can and put the deadbolt in the locked position while you do this. Then, take a piece of double sided tape and attach it to the box above the deadbolt.

Step 6: Coding Pt. 1

Connect your Arduino Board to your computer and plug the servo into the MotorShield. Then, upload the code in the next step to the board, which should unlock and lock the deadbolt by pulling the bolt up and down. You might have to tweak the range of the servo arm depending on your box side and the particular deadbolt you are using. Unplug the board from your computer and connect it to the battery pack. Connect the battery pack, Arduino Board, and MotorShield to the EXTERIOR of the box.

Step 7: Coding Pt. 2

<p>* Sweep<br> by BARRAGAN <http: barraganstudio.com="">
 This example code is in the public domain.</http:></p><p> modified 8 Nov 2013
 by Scott Fitzgerald
 <a href="http://www.arduino.cc/en/Tutorial/Sweep"> http://www.arduino.cc/en/Tutorial/Sweep
</a>
*/</p><p>#include <servo.h></servo.h></p><p>Servo myservo;  // create servo object to control a servo
// twelve servo objects can be created on most boards</p><p>int pos = 0;    // variable to store the servo position</p><p>void setup() {
  myservo.attach(10);  // attaches the servo on pin 9 to the servo object
}</p><p>void loop() {
  for (pos = 0; pos <= 130; pos += 1) { // goes from 0 degrees to 180 degrees
    // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for (pos = 130; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
}

Step 8: The Finale

The deadbolt should be continuously locking and unlocking when the power to the board is on. If it works consistently, firmly connect the final side WITHOUT ANY SUPER GLUE OR ADHESIVE to complete the box. Run the wire for the servo through one of the notches on the box and you are all done! Enjoy!