DIY Arduino Safe (Beginner - Intermediate)
by Mantavya in Circuits > Arduino
231 Views, 3 Favorites, 0 Comments
DIY Arduino Safe (Beginner - Intermediate)
![IMG_0487.jpeg](/proxy/?url=https://content.instructables.com/FV5/KTSA/LJ2V9TIC/FV5KTSALJ2V9TIC.jpg&filename=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
- Arduino Board
- Breadboard
- Dip Switch x 1
- Resistors (10K Ω x 4)
- Dual Color LED
- Servo Motor
- IR receiver
- IR remote
- Hot Glue Gun
- Shoe box (or cardboard)
- Tape
- Box Cutter
- Wires
Theory
- IR receiver:
- 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.
- 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.
- 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.
- Servo Motor:
- 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.
- 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](/proxy/?url=https://content.instructables.com/FEK/MQGG/LJ1FV7F7/FEKMQGGLJ1FV7F7.jpg&filename=IMG_0475.jpg)
![Stunning Kieran.png](/proxy/?url=https://content.instructables.com/FNP/NX35/LJ1FVJGE/FNPNX35LJ1FVJGE.png&filename=Stunning Kieran.png)
![Screenshot 2023-06-19 at 8.37.26 AM.png](/proxy/?url=https://content.instructables.com/F3X/SOO4/LJ1FVJJW/F3XSOO4LJ1FVJJW.png&filename=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](/proxy/?url=https://content.instructables.com/F8W/MZJJ/LJ1FV7F8/F8WMZJJLJ1FV7F8.jpg&filename=IMG_0476.jpg)
- Take an old shoe box and clean it.
- Using a pencil and a ruler draw a rectangle, leaving 3.5 inches of space on each side, on the back of the box.
- 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.
- 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](/proxy/?url=https://content.instructables.com/F2M/F751/LJ1FV7FB/F2MF751LJ1FV7FB.jpg&filename=IMG_0477.jpg)
![IMG_0481.jpg](/proxy/?url=https://content.instructables.com/F9F/NOIU/LJ1FV7FC/F9FNOIULJ1FV7FC.jpg&filename=IMG_0481.jpg)
- Place you breadboard and Arduino on top of the safe (Shoe box).
- Using a box cutter cut out holes through which you can pass the wires of the servo motor.
- 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.
- 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.
- Fix your breadboard in place using tape or any other method you may deem suitable.
Final Results
- Test your project to see if it works.
- Connect the Arduino to a power supply and close the gate of the safe.
- First try the switch method. Place the switches in the order that you had assigned in the code and see if the gate opens.
- 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.
- 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.
- 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:-
- Ensure that the IR receiver is connected properly.
- 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.
- 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.
- When placing the Servo in the shoe box ensure that you have placed it the right way so that the movement opens the gate.
- 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.