DIY Arduino Safe (Beginner - Intermediate)

by Mantavya in Circuits > Arduino

231 Views, 3 Favorites, 0 Comments

DIY Arduino Safe (Beginner - Intermediate)

IMG_0487.jpeg

In a world where security is paramount, it's essential to have a reliable safe that offers peace of mind. Traditional safes can be expensive and might not always meet your needs. By taking the matter into your own hands and combining it with the power of an Arduino you can create an inexpensive safe which can protect your belongings efficiently.

The level of this project is beginner-intermediate, so you may require some prior knowledge of Arduino before you start following this guide.

By following this step-by-step guide you will gain valuable insight into the world of electronics, coding and craftsmanship. So without further delay let's begin.

Supplies

Theory

  1. IR receiver:
  2. Infrared radiation, although similar to the light we perceive, exists beyond the range of visible light and is invisible to the human eye. Consequently, direct visual contact is necessary for effective communication using infrared signals.
  3. In a typical infrared communication system, two essential components are the IR transmitter and the IR receiver. The transmitter, resembling a regular LED, emits light within the infrared spectrum rather than the visible range. On the other hand, the IR receiver comprises a photodiode and a pre-amplifier, which work together to convert the received IR light into an electrical signal.
  4. Whenever a button is pressed on the remote control, a distinct hexadecimal code is generated. This code serves as the modulated information that is transmitted over infrared to the receiver.
  5. Servo Motor:
  6. The servo circuitry is integrated within the motor unit itself, featuring a shaft that can be positioned and typically equipped with a gear. The motor's movement is governed by an electric signal, dictating the extent of the shaft's displacement.
  7. Internally, the setup is relatively straightforward, consisting of a compact DC motor, a potentiometer, and a control circuit. The motor is connected to the control wheel through gears, facilitating rotational motion. As the motor rotates, the potentiometer's resistance alters, enabling the control circuit to accurately manage the degree and direction of movement.

Connect the Wires

IMG_0475.jpg
Stunning Kieran.png
Screenshot 2023-06-19 at 8.37.26 AM.png
  • Connect the 5V pin of the Arduino to the positive rail on the breadboard.
  • Connect the GND pin on the Arduino to the negative rail on the breadboard.
  • Interconnect the power and ground rails on the breadboard.
  • Connect Pins 4, 5, 6 and 7 of the Arduino to the on side of the dip switch.
  • Connect the negative rail to the dip switch using the 10K Ω resistors.
  • Connect the Servo motor to pin 2 of the Arduino and connect it to power and ground as well.
  • Connect pin 9 to the R pin of the Dual Color LED and pin 10 to the G pin of the Dual Color LED; Connect the GND pin to the ground rail of the breadboard.
  • Connect pin 3 to the IR receiver and make the power and ground connections as well.

Note: In the circuit diagram and Schematic provided I have used 2 different coloured LEDs as TinkerCad does not have a Dual Color LED.

Setting Up the Code

First run the IRrecvDemo File to find the HEX value for the button you are pressing on your IR remote and then add that HEX value to the code in the ComputerEngFinal file.

Building the Safe

IMG_0476.jpg
  1. Take an old shoe box and clean it.
  2. Using a pencil and a ruler draw a rectangle, leaving 3.5 inches of space on each side, on the back of the box.
  3. Cut out the rectangle to make a hole and when cutting the hole leave one side of the hole open so that it can act as a hinge for the gate of the safe.
  4. Now you have the apparatus which you can use to assemble the safe. You can use the lid of the shoe box to insert your components inside it and set up the safe.

Assembling the Safe

IMG_0477.jpg
IMG_0481.jpg
  1. Place you breadboard and Arduino on top of the safe (Shoe box).
  2. Using a box cutter cut out holes through which you can pass the wires of the servo motor.
  3. Set up the servo motor in the bottom middle of the gate of the shoe box. You may use the glue gun to secure the servo in place.
  4. Cut out another hole at the top of the shoe box (where you have placed your breadboard) and pass you dual colour LED through it to make it look neater.
  5. Fix your breadboard in place using tape or any other method you may deem suitable.

Final Results

  1. Test your project to see if it works.
  2. Connect the Arduino to a power supply and close the gate of the safe.
  3. First try the switch method. Place the switches in the order that you had assigned in the code and see if the gate opens.
  4. If the gate opens, close it and test it again with the IR remote. Press the button you had assigned to open the gate (Plus in this case) and check to see if the door opens.
  5. If you face any problems with the functionality of the project recheck you wiring and your code to see that it matches steps 1 and 2 in this tutorial.
  6. If your project works then, Congratulations! you have made your Arduino Safe.

Common Mistakes

Here are some mistakes to look out for to ensure the proper functioning of your project:-

  1. Ensure that the IR receiver is connected properly.
  2. When pressing buttons on the IR remote do not hold them down as this may lead to the hexadecimal code of "FFFFFFF" to be generated.
  3. When connecting the Dual Color LED ensure that you have connected the R and G pins to the correct Arduino pins and have specified this in the code.
  4. When placing the Servo in the shoe box ensure that you have placed it the right way so that the movement opens the gate.
  5. When inserting the wires for the Dual Color LED and the Servo into the shoe box, ensure that you have used appropriate length wires so that they are not stretched when placed inside the shoe box.