Skip to content
Buy 10+ on select items — save 10% auto-applied
Free US shipping on orders $35+
Order by 3pm ET — ships same-day from the US
Skip to main content

Arduino ADXL345: Bike theft alarm alerts | ShillehTek

May 19, 2026 12 views

Arduino ADXL345: Bike theft alarm alerts | ShillehTek
Project

Build an Arduino Nano bike theft alarm using an ADXL345 accelerometer to detect motion, trigger a loud buzzer, and send Bluetooth alerts with parts from ShillehTek.

1.5 hr Intermediate7 parts

Project Overview

Arduino Nano + ADXL345 bike alarm: Build a motion-triggered bike theft alarm where an ADXL345 accelerometer detects movement, an Arduino triggers a 110 dB buzzer, and an HC-05 sends a Bluetooth alert to your phone.

This build is battery-powered, compact enough to hide in a saddle bag, and can run for weeks depending on your battery and usage.

  • Time: ~1.5 hours
  • Skill level: Intermediate
  • What you will build: A vibration-triggered bike alarm with a buzzer and a phone notification.
Arduino Nano bike theft alarm hidden in a saddle bag with ADXL345 accelerometer, buzzer, and HC-05 Bluetooth module
ADXL345 + buzzer + HC-05 equals a hidden alarm with phone alerts.

Parts List

From ShillehTek

External

  • 18650 LiPo cell
  • Android phone + "Bluetooth Terminal" app (or any HC-05 reader)
  • Small project box

Note: For iPhone-compatible alerts, swap HC-05 for our HM-10 BLE module.

Step-by-Step Guide

Step 1 - Gather the components

Goal: Make sure you have all modules and power parts ready before wiring.

What to do: Collect the Arduino Nano, ADXL345, buzzer, HC-05, TP4056, jumper wires, and your enclosure.

Arduino Nano bike alarm parts on a breadboard including ADXL345 accelerometer, KY-006 buzzer, HC-05 Bluetooth module, and battery power
Arduino + ADXL345 + buzzer + HC-05 + battery fits in a small box.

Expected result: All parts are ready to be wired and fit your planned enclosure.

Step 2 - Wire the ADXL345, buzzer, and Bluetooth module

Goal: Connect the sensor over I2C, connect the buzzer output pin, and connect Bluetooth serial.

What to do: Follow the wiring list below. The ADXL345 uses the Arduino I2C pins (A4/A5 on Nano). The HC-05 uses SoftwareSerial on D2/D3.

Wiring diagram showing Arduino Nano connected to ADXL345 via I2C, KY-006 buzzer on D8, and HC-05 Bluetooth on D2 and D3
ADXL345 on I2C, buzzer on D8, HC-05 on SoftwareSerial D2/D3.
  • ADXL345: VCC to 5V, GND to GND, SDA to A4, SCL to A5
  • Buzzer signal to D8
  • HC-05: VCC to 5V, GND to GND, TX to D2 (Arduino RX), RX to D3 (Arduino TX through divider)
  • Power: TP4056 to 18650 to Arduino Vin

Expected result: Your modules are powered correctly, the ADXL345 is on the I2C bus, and the HC-05 is connected for serial messages.

Step 3 - Upload the Arduino sketch

Goal: Program the Nano to detect movement, sound the buzzer, and send a Bluetooth alert.

What to do: Install the required libraries, then upload the sketch below to your Arduino Nano. The code measures a baseline acceleration magnitude at startup and triggers when the reading differs by more than the threshold.

Code:

#include <Wire.h>
#include <Adafruit_ADXL345_U.h>
#include <SoftwareSerial.h>
Adafruit_ADXL345_Unified accel(12345);
SoftwareSerial bt(2,3);
const int BUZZ = 8;
const float THRESHOLD = 1.5; // m/s² of additional shake
float baseline = 0;
void setup() {
  bt.begin(9600);
  accel.begin();
  pinMode(BUZZ, OUTPUT);
  sensors_event_t e; accel.getEvent(&e);
  baseline = sqrt(e.acceleration.x*e.acceleration.x +
                  e.acceleration.y*e.acceleration.y +
                  e.acceleration.z*e.acceleration.z);
}
void loop() {
  sensors_event_t e; accel.getEvent(&e);
  float mag = sqrt(e.acceleration.x*e.acceleration.x +
                   e.acceleration.y*e.acceleration.y +
                   e.acceleration.z*e.acceleration.z);
  if (abs(mag - baseline) > THRESHOLD) {
    tone(BUZZ, 2000, 500);
    bt.println("ALARM! Movement detected.");
    delay(2000);
  }
  delay(50);
}

Expected result: When the bike is moved or shaken, the buzzer sounds briefly and the HC-05 transmits the text alert.

Step 4 - Pair your phone and arm the alarm

Goal: View the Bluetooth alert message on your phone when movement is detected.

What to do: Pair your phone with the HC-05, open your Bluetooth terminal app, connect to the HC-05, and leave it running while the bike is parked.

Android Bluetooth Terminal app connected to an HC-05 module displaying the message ALARM Movement detected
Pair phone with HC-05, open Bluetooth Terminal, and leave it running.

Expected result: When the alarm triggers, your phone shows: "ALARM! Movement detected."

Step 5 - Optional upgrades and next steps

Goal: Decide how you want to extend the same alarm concept.

What to do: Pick any of the options below and adapt the hardware and code accordingly.

  • Swap HC-05 for HM-10 for iPhone compatibility
  • Swap HC-05 for ESP32 with Wi-Fi for Telegram alerts from anywhere
  • Add GPS (NEO-6M) + LoRa for off-grid theft tracking
  • Add a tilt-arming mode and only sound the alarm when the bike is upright

Expected result: You have a clear plan for the next feature to add without changing the core motion detection approach.

Conclusion

You built an Arduino Nano bike theft alarm using an ADXL345 accelerometer to detect movement, a buzzer for a loud local alarm, and an HC-05 module for Bluetooth alerts to your phone.

Want the exact parts used in this build? Grab them from ShillehTek.com. If you want help customizing this project or building something for your product, check out our IoT consulting services.

Photo credit: Reference photos adapted from Instructables.