Arduino Anti-Theft Device
by sophiatnguyen586 in Circuits > Arduino
146 Views, 0 Favorites, 0 Comments
Arduino Anti-Theft Device
This DIY anti-theft device is a fun, hands-on project for anyone looking to create a simple security system. Using an Arduino Uno and an ultrasonic sensor, it detects movement and triggers an alarm if the monitored distance changes. A combination of tactile buttons lets you arm and disarm the device, with a buzzer and flashing LEDs signaling any alert. It’s an ideal project for building practical skills in electronics and programming while creating something useful to keep items secure.
*** Side Note: After step 6, the remaining parts of the project are optional, as it functions fully without the aesthetic enhancements.
Downloads
Supplies
1 Arduino Uno
- Purpose: The microcontroller to run the logic for the device, monitor the sensor inputs, and control outputs (alarm, lights, etc.).
1 Ultrasonic Sensor
- Purpose: Measure the distance from the object to detect movement. When the distance changes by more than 1 inch, it will trigger the alarm.
2 Tactile Buttons
- Purpose:
- One Button: Start the system by pressing a button. It will begin monitoring the distance.
- Two Buttons: To disarm the alarm, press a specific sequence of two buttons in the correct order.
1 LED RGB
- Purpose: Flashing lights when the alarm is triggered.
3 Resistors (330Ω)
- Purpose: To limit current for the LEDs and buttons.
1 AA Battery Holder
- Purpose: Power the Arduino Uno and components when not connected via USB.
17 Jumper Wires and 1 Breadboard
- Purpose: Connect all the components without soldering.
4 Male - Female Wires
- Purpose: Extend the connection between the board and LED RGB
1 Micro Servo
- Purpose: Adds actuation (movement) to the device
3D Printer
- Purpose: Create covers for the wires and board
- This is purely optional as covers can be made with any other material
1 Bell
- Purpose: Produces noise when hit
1 Nail/Extension
- Purpose: To extend the Micro Servo arm
Hot Glue/Tape
- Purpose: Hold the cover pieces together
Thread/Wire
- Purpose: Hang the bell from the stand
Gather Supplies
Gather all of the necessary supplies for the project as listed above
Power Connections
Materials Needed:
- 2 wires
- Battery holder
Assembly:
- Connect the 5V pin on the Arduino to the positive rail (5V) of the breadboard.
- Connect the GND pin on the Arduino to the ground rail (GND) of the breadboard.
- Ensure the AA Battery Holder is connected to the Arduino's 5V and GND pins if using battery power instead of USB.
Ultrasonic Sensor Connections
Materials Needed:
- Ultrasonic Sensor
- 4 wires
Assembly:
- Connect the Ultrasonic Sensor to pins: J24 (VCC), J23 (TRIG), J22 (ECHO), J21 (GND)
- The sensor should face away from the board.
- Arduino and Breadboard Wiring:
- TRIG → Digital Pin 7
- Wire I23 to Pin 7
- ECHO → Digital Pin 6
- Wire I22 to Pin 6
- VCC to 5V rail
- Wire I24 to 5V
- GND to the GND rail
- Wire I21 to GND
LED RGB Connections
Materials Needed:
- RGB LED
- 3, 330 Ω resistors
- 4 Female - Male connector wires
Assembly:
- RGB LED:
- Connection to the breadboard is temporary (as shown in the photos)
- Attach each of the F-M connector wires to the legs of the RBG LEB
- Connect the F-M wires of the LED to pins J1, J2 (GND long leg), J3, and J4
- Breadboard and Arduino:
- Connect resistors to the LED on the breadboard
- Resistor 1: F1 to E1 (connected to Arduino Pin 9) (Wire A1 to Pin 9)
- Resistor 2: F3 to E3 (connected to Arduino Pin 10) (Wire A3 to Pin 10)
- Resistor 3: F4 to E4 (connected to Arduino Pin 11) (Wire A4 to Pin 11)
- Connect the common cathode (GND pin) of the LED RGB to the ground rail on the breadboard. Wire (A2 to (-)GND)
Tactile Button Connections
Materials Needed:
- 2 tactile buttons
- 4 wires
Assembly:
- Button 1 (Red): F8, F10, C8, C10
- Connect one side to (-)GND on the Arduino. (Wire A8 to GND)
- Connect the other side to Digital Pin 5 on the Arduino. (Wire A10 to GND)
- Button 2 (Blue): F14, F16, C14, C16
- Connect one side to (-)GND on the Arduino. (Wire A14 to GND)
- Connect the other side to Digital Pin 4 on the Arduino. Wire (A16 to GND)
Micro Servo Connections
Materials Needed:
- Micro servo
- 2 wires
Assembly:
- Connect the signal pin of the servo to Digital Pin 3 on the Arduino. (White wire)
- Connect the power (VCC) pin to the 5V rail on the breadboard. (Red Wire)
- Connect the ground (GND) pin to the GND rail on the breadboard. (Black Wire)
Download Code
You need to complete this step now so that the Arduino stores the code in its memory. This ensures it can operate independently, running off batteries later, instead of relying on being plugged into a computer to execute the program.
Code download is at the bottom of this step.
Steps:
- Plug in the board to the HDMI port of your device (computer/laptop)
- Download the Arduino IDE app
- Select Arduino Uno in the app
- Press the checkmark (Verify) and arrow (Upload) buttons in the top left to run the code
Downloads
Print 3D Models
Files to Print:
- 2 Extended Button Rods
- 1 Breadboard Cover
- 1 Arduino Cover
- 1 Bell Stand
Assemble
This step does NOT utilize the bell stand.
Assembly:
- Lay newly printed pieces on top of assigned place
- Thread LED RGB and Micro Servo into correct places
- Tape the battery pack to any desired place
Extend Micro Servo
Materials Needed
- 1 screw
Assembly:
- Secure the screw with tape to the micro servo's arm
Bell Installation
Materials Needed:
- 3D printed bell stand
- 1 bell
- Thread/wire
- Hot glue
Assembly:
- Glue the stand to the device, directly between the two covers
- Tie and hang the bell to the stand using a thread or wire
Run the Code
Congratulations! The project is complete. Once the Arduino is powered on, the system is active. Press the red button to arm the device, and hold down the blue button to disarm it after movement is detected.