Ultimate Safe

This Instructables is made to show you how to build an Arduino safe step by step. The purpose of the safe is for you to be able to store your prized possessions safely where no one can get them. I was inspired by real lifes safes and movies where people cracked open safes and I wanted to make my own and make it hard to crack into. The safe uses 3 potentiometers as the unlock and locking system paired with a servo. There is use of an RGB LED and an OLED display to show the status of the safe.
Supplies
- Cardboard: Old boxes/ Purchase
- X-acto knife or scissors: Purchase
- Ruler: Purchase
- Pencil/Pen: Purchase
- Straws: Purchase
- toothpicks/skewer: Purchase
- Tape: Purchase
- Hot Glue: Purchase
- Arduino Uno R3: Purchase
- 3 Potentiometers: Purchase
- 1 330 Ohm Resistor: Purchase
- Breadboard: Purchase
- 1 RGB LED(CA): Purchase
- 1 0.91’ OLED screen: Purchase
- 1 Servo motor: Purchase
- Male to Female Cables: Purchase
- Male to Male Jumper Cables: Purchase
Coding

Connect your arduino to your computer and open the arduino ide (tutorial on how to install ide). create a new sketch. Code each component separately. Start with the main mechanism of the potentiometers and servo. Then set up the RGB LED and OLED in sync with the main mechanism. Make sure to set up the RGB LED in such a way that you use common anode. Or you can use this already written code with comments. Make sure to download each library for the code to work.
Downloads
Coding in Depth

Start off by declaring libraries, To declare the libraries just type in the code as in the picture. For libraries to work you need to download them. You can download libraries on the Arduino ide by going sketch>include library> manage libraries>and searching the library name and clicking install. Next set up the pins and OLED and servo motor.
Coding in Depth
.png)
Coding in Depth
.png)
Next use the void setup to declare if your pins are input and output. For convenience you do not need to declare the analog pins in the setup. start the serial monitor, OLED, and servo motor. After the setup is done create the set color function with an integer return type. Make sure to reverse the signal of the RGB Led as we are using a common anode RGB led.
Coding in Depth
.png)
Lastly set up the main mechanism of the code. You need to set a on and off status of the safe based on the value of 3 different potentiometer values. Make sure to set the RGB led to green when unlocked and red blinking when locked. Display the status on the OLED and lastly read the values of each potentiometer and change the degrees of the servo motor.
Building the Safe



Cut out 6 identical wall pieces for the safe. They can be any size in this case these were (25cm x 25cm). Out of these 6 wall pieces cut the door out of one of them and hot glue carboard onto of each other to create a latch for the servo to hold onto. With the second piece of that same wall piece use a pencil to cut 3 holes for our potentiometers and 1 hole for the RGB LED. Lastly cut out a hole for the 0.91' OLED display, make sure to draw an outline first. With another 1 of those wall pieces cut approximately 8 cm away from one of the edges in a straight line as shown in the photo.
Building the Safe

With the remaining 4 side walls build up the safes sides, base, and back leaving 1 side open. Use extra cardboard to create a mini box to put our circuitry (8cm in this case). Make sure to cut a hole in the back wall of the minibox for wires. Use some more carboard to add a support that will go on the right side of the door of the same. Make sure to add a bit of cardboard for the servo to sit on and cut out a whole for the servo to turn through so it can lock into the latch. Try to make it look as identical to the picture shown. Cut out a whole the size of the arduino cable on the right side of the safe as well.
Schematic

Follow this schematic to the best of your ability for the wiring.
Building the Ciruit



Using the piece made before fit the potentiometers, OLED, and RGB led into place using some tape. Also you can fold the furthest leg on the RGB led towards the carboard for a stronger fitting.
Building the Circuit


Using our female to male jumper cables create bundles of wires for each potentiometer, OLED, and RGB led. Use red for positive and black for negative. Use tape to create the bundles. Once this step is done hot glue this whole front circuit with the wires connected to the front of the safe.
Wiring Our Components

After connecting the front circuit to the safe hot glue a servo to its tiny holder from inside the case. Make sure the center of the spinning part of the servo is on the bottom half. Next place the Arduino and breadboard into their circuit box. Using male to male jumper cables connect 5v and GND from the Arduino to the breadboard power rails. Connect the potentiometers positive to the breadboards positive rails. For the far left potentiometer connect its signal to the pin A0. For the middle potentiometer connect its signal to the pin A1. For the far right potentiometer connect its signal to pin A2. Connect the OLEDs positive to positive and negative to negative. Connect SCL to A5. Connect SDA to A4. Connect a 330 ohm resistor from the positive power rail to any point on the breadboard. Then connect the RGB led anode to a point in line with the 330 ohm resistor. Connect RGB led red pin to pin 7. Connect RGB led green pin to pin 8. Lastly connect the servo using male to male jumpers positive to positive, negative to negative, and signal to pin 10. Lastly test if the circuit works. SHOULD WORK LIKE THIS.
Installing Door

Cut about 1.5cm away from the left side of the door all the way to the bottom (keep the scrap). Using scissors cut a straw to the height of the door. Hot glue the straw to the left side of the door making sure the latch is in the top right. Insert 1 toothpick into the left underside of the front circuit wall. place the door into its place with the toothpick inside of the straw. From underneath the safe poke a second toothpick into the straw. Hot glue the toothpick into place.
Installing the Roof of the Circuit Housing

Cut a straw to the size of the length of the top of the front wall. Cut away about an inch from both side and draw an outline of the straw on the top of the front wall. Cut that outline out. Place the straw in that hole you just made and insert 1 toothpick from the left and 1 from the right. Hot glue both the toothpicks in place. Lastly take the 8cmx25cm panel and hot glue it to the straw in parallel. Using the scraps from the last step fill in the fap on the left of the safe main door.
Installing the Roof of the Safe

Lastly hot glue the roof of the safe making sure not to hot glue the circuit housing roof to this side of the roof. Lastly test your safe one more time to make sure there are no problems. The safe should work like this.