Compact Anti-Theft Alarm for Bikes (Easy DIY Circuit)

by Pro Maker_101 in Circuits > Electronics

3776 Views, 45 Favorites, 0 Comments

Compact Anti-Theft Alarm for Bikes (Easy DIY Circuit)

Untitled design 12.PNG
This Little DIY Gadget Keeps Your Bike Safe!

I built a tiny, low-power bike alarm that detects tampering using a vibration switch and triggers a buzzer via an IRLB4132 MOSFET driver. The circuit uses a PC817 optocoupler for isolation and a Hall-effect sensor as a secure reset — the alarm can only be turned off by placing a magnet over the Hall sensor.


This compact, DIY-friendly device is perfect for anyone who wants a discreet, easy-to-make anti-theft alarm for bikes and scooters. Includes wiring close-ups and a test demo for guidance.

Supplies


  1. Vibration Switch (tilt/shock sensor)
  2. PC817 Optocoupler
  3. IRLB4132 MOSFET
  4. 100Ω Resistor
  5. 3.7V Li-ion Battery
  6. Hall Effect Sensor
  7. Buzzer (3–5V)
  8. ON/OFF Switch
  9. Small PCB / Perfboard
  10. Wires and Connectors

PCB Design & Assembly

IMG_0400.PNG
IMG_0382.jpg
IMG_0401.PNG
IMG_0404.PNG
IMG_0405.PNG
IMG_0406.PNG

I designed the circuit PCB using EasyEDA and ordered the final board from PCBWay for a professional finish.

👉 pcbway.com/?from=Promaker1


After receiving the PCB, I placed and soldered the IRLB4132 MOSFET and the PC817 optocoupler in their respective positions as shown in the attached circuit diagram/photo.

This ensures a compact, reliable, and durable build compared to breadboard wiring.

Adding Switch, Buzzer, Hall Sensor & Vibration Sensor

IMG_0412.PNG
IMG_0413.PNG
IMG_0407.PNG
IMG_0408.PNG
IMG_0409.PNG
IMG_0410.PNG
IMG_0411.PNG

Next, I connected the ON/OFF switch, buzzer, Hall-effect sensor, and vibration switch to the PCB:


  1. ON/OFF Switch: Controls power to the circuit.
  2. Buzzer: Connect to the MOSFET output so it sounds when the vibration switch is triggered.
  3. Vibration Switch: Detects any shake or tampering of the bike and triggers the alarm.
  4. Hall-effect Sensor: Acts as a secure reset — the alarm can only be turned off by placing a magnet near the sensor.

All components are carefully soldered to the PCB, keeping wires short for a compact, tidy setup.


📷 (Insert photo showing all components fixed to PCB and wiring)

Trimming, Soldering & Cleaning

IMG_0419.PNG
IMG_0420.PNG
IMG_0415.PNG
IMG_0416.PNG
IMG_0417.PNG
IMG_0418.PNG

After placing all components on the PCB:

  1. Trim excess legs of all components with side cutters.
  2. Solder all connections properly, ensuring no cold joints.
  3. Clean the PCB using liquid flux cleaner or isopropyl alcohol to remove solder residue and flux for a neat finish.


Installing the Battery

IMG_0421.PNG
IMG_0422.PNG
IMG_0424.PNG
IMG_0425.PNG


  1. I used a small 3.7V Li-ion battery
  2. Fixed the battery in place using a small amount of gum or double-sided tape to secure it.
  3. Soldered the +ve and -ve terminals to the PCB carefully, ensuring correct polarity.

Making the Enclosure

IMG_0426.PNG
IMG_0427.PNG
IMG_0429.PNG
IMG_0430.PNG
IMG_0433.PNG
IMG_0434.PNG


  1. Measure the length and width of your PCB carefully.
  2. Cut a 3mm acrylic sheet to size — I used a laser cutter for precise edges.
  3. Assemble the acrylic pieces into a box shape to house the PCB and components.
  4. Use gum or strong adhesive to fix the sides together securely.

This creates a compact and protective enclosure for your bike alarm.

Join the First-Ever PCBWay 3D Printing Design Contest!

15522362870e975b7c2914f5aaf42d5f0293e98fd4478t.jpg
FS0GUTCM7NCVD6P.jpg

Unleash your creativity and bring your 3D ideas to life! PCBWay invites all makers and designers to participate in two exciting categories:

  1. Eon-Themed Designs: Give PCBWay’s mascot, Eon, a fresh new look with your imagination — new outfits, poses, or expressions!
  2. Open Creative Designs: Design your own original 3D character, figurine, or collectible — from fantasy creatures to action figures.

Why participate?

  1. Win up to $500 cash, coupons, and certificates
  2. Have your design professionally 3D printed
  3. Get featured on PCBWay’s platform and show your talent to the community


How to enter:

Submit your 3D files (STL, STEP, or similar) through the PCBWay Open Source Community. You can enter one or both categories!

Deadline: November 10, 2025 — Don’t miss your chance to turn imagination into reality!

Click here to enter the contest!

Installing the PCB and Adding TP4056 Charging Module

IMG_0436.PNG
IMG_0437.PNG
IMG_0438.PNG
IMG_0440.PNG
IMG_0442.PNG
IMG_0444.PNG
IMG_0446.PNG
IMG_0447.PNG
IMG_0448.PNG


  1. Insert the PCB into the acrylic box and secure it using gum/adhesive.
  2. Connect the TP4056 charging module:
  3. Solder wires to B+ and B- terminals of the module (red = +, black = -).
  4. At the other end, solder a 2-pin female header for easy connection.
  5. Insulate all exposed wires and solder joints using heat shrink tubing to prevent shorts.


Battery Charging Setup

IMG_0449.PNG
IMG_0450.PNG
IMG_0452.PNG
IMG_0453.PNG

The TP4056 module is now ready and can be used to charge your 3.7V battery safely.


  1. Simply connect the female 2-pin header from the TP4056 to the male header on the PCB.
  2. This allows easy plug-in charging without opening the enclosure.

Final Testing

IMG_0454.PNG
IMG_0455.PNG
IMG_0456.PNG
IMG_0457.PNG
IMG_0459.PNG


  1. Turn ON the switch and mount the completed alarm box securely on your bike.
  2. Test the alarm: shake or tap the bike — the vibration switch triggers the buzzer.
  3. Reset the alarm: place a magnet near the Hall-effect sensor to turn it off.
  4. Once everything works perfectly, close the acrylic box to protect the circuit.

Working & Demo

This Little DIY Gadget Keeps Your Bike Safe!
IMG_0460.PNG
IMG_0462.PNG
IMG_0463.PNG
IMG_0465.PNG
IMG_0466.PNG

The DIY bike alarm is now fully functional:


  1. The vibration switch detects any shake or tampering.
  2. The buzzer sounds instantly when the bike is disturbed.
  3. The Hall-effect sensor ensures the alarm can only be turned off using a magnet, keeping your bike secure.


📹 Watch the full working demo on YouTube: https://youtu.be/uCkH_dk6y90?si=77p7BOPlh4xo_rIQ