Contents — 26 sections
Project Overview
Feels a parked motorcycle being tampered with, warns and alerts the owner instantly, and tracks it live if it is taken — deterrence, alarm and recovery in one.
Motorcycles and scooters are stolen far more easily than cars — they are light enough to lift into a van, quick to hot-wire, and often parked in the open — and once gone they are rarely recovered because there is no way to follow them. This project builds an anti-theft tracker that covers the whole timeline of a theft: it detects tampering on a parked bike, alerts the owner instantly, and if the bike is taken, tracks it live so it can be recovered. Deterrence, alarm and recovery in one small, hidden unit.
The core is motion-based tamper detection. While the bike is parked and armed, an accelerometer watches for the signatures of theft — the bike being lifted, wheeled, tilted onto its stand, knocked, or started — distinguishing a real tampering event from harmless nudges (wind, a passer-by brushing past) so it does not cry wolf. On a genuine event it does two things at once: sounds a local alarm as a deterrent, and sends the owner an instant alert over cellular. If motion continues — the bike is actually being taken — it switches to live GPS tracking, streaming location so the owner and, where appropriate, the police can follow and recover it.
The design is built around the realities of a hidden, battery-lean device on a parked vehicle: it spends almost all its life in low-power sleep, woken by the accelerometer only when something moves, so a small battery lasts; it is hidden and tamper-resistant so a thief cannot simply pull it off; and it escalates sensibly (nudge → warn, sustained motion → alarm + track). It is honest that no tracker guarantees recovery, that thieves may find and disable a unit, and that recovery should go through the police rather than owner heroics. But as a motion-triggered, alerting, live-tracking anti-theft device tuned for two-wheelers, it turns a bike from an easy, untraceable target into one that fights back — noisy when touched, and followable if taken.
What this project does
- Detects tampering on a parked bike via motion (lift/tilt/wheel/knock)
- Distinguishes real theft from harmless nudges
- Sounds a local alarm as a deterrent
- Alerts the owner instantly over cellular
- Switches to live GPS tracking if the bike is taken
- Sleeps in ultra-low power, woken only by motion
- Stays hidden and tamper-resistant
Real-World Applications
| Setting | How it is used |
|---|---|
| Personal two-wheeler security | Deterrence, alarm and recovery tracking for a bike or scooter. |
| Delivery-fleet two-wheelers | Anti-theft across many riders' vehicles. |
| Rental / shared mobility | Tamper alerts and location for shared scooters/bikes. |
| High-value parked assets | Motion-triggered alerting for anything parked and portable. |
Deployment contexts where a build of this kind earns its keep.
Features & Capabilities
- Motion/tamper detection with false-alarm rejection
- Instant owner alert + local alarm
- Live GPS tracking on sustained motion
- Escalation (nudge → warn → alarm + track)
- Ultra-low-power sleep, accelerometer wake
- Hidden, tamper-resistant install
- Honest about recovery limits and lawful process
Difficulty, Time & Required Skills
| Attribute | Value |
|---|---|
| Difficulty level | Intermediate |
| Estimated completion time | 12–18 hours |
| Indicative build cost | ₹2,500 – ₹4,500 |
| Primary discipline | Automotive |
| Reference platform | ESP32 DevKit V1 (ESP-WROOM-32) |
Skills you should have (or will pick up)
- Accelerometer motion/tamper classification
- False-alarm rejection (real theft vs nudge)
- Ultra-low-power sleep + motion wake
- GPS tracking and cellular alerting
- Hidden, tamper-resistant installation
Bill of Materials
Every part below is commonly available from Indian and international hobby-electronics suppliers. Prices are indicative 2026 retail figures in Indian rupees and will drift — treat them as a budgeting guide, not a quotation.
| Component | Key specification | Qty | Approx. cost |
|---|---|---|---|
| ESP32 DevKit V1 (ESP-WROOM-32) Wi-Fi transmit bursts peak near 500 mA — size the regulator accordingly. | Dual-core Xtensa LX6 @ 240 MHz, 520 KB SRAM, 4 MB flash, Wi-Fi 802.11 b/g/n + BLE 4.2, 34 GPIO, 18× 12-bit ADC, 2× 8-bit DAC | 1 | ₹450 |
| MPU-6050 6-axis IMU Gyro bias drifts with temperature — re-zero at boot while the device is still. | 3-axis gyro ±250–2000 °/s, 3-axis accel ±2–16 g, 16-bit ADC, on-chip DMP | 1 | ₹190 |
| u-blox NEO-6M GPS module + ceramic patch antenna Needs clear sky view; indoors it will never get a first fix. | 50 channels, −161 dBm tracking, 2.5 m CEP, 1–5 Hz update, cold start 27 s | 1 | ₹550 |
| SIM800L GSM/GPRS module Transmit bursts hit 2 A — needs a 4.0 V supply and a 1000 µF bulk capacitor. | Quad-band 850/900/1800/1900 MHz, GPRS class 12, SMS + TCP/IP | 1 | ₹550 |
| Active piezo buzzer 5 V Active buzzers make tone on DC; passive ones need a PWM carrier. | 85 dB at 10 cm, 2.3 kHz resonance, 12 mm diameter | 1 | ₹25 |
| 18650 Li-ion cell 3400 mAh + holder Never charge below 0 °C; always use a protected cell or a BMS. | 3.7 V nominal, 4.2 V full, 3400 mAh, ~12.6 Wh, 2 C discharge | 1 | ₹450 |
| Accelerometer Wakes the MCU only when moved | Motion/tilt with wake-on-motion interrupt | 1 | ₹150 |
| GPS + cellular | Live location and alerting | 1 | ₹1,200 |
| Hidden enclosure | Concealed, tamper-resistant mount + wiring | 1 | ₹300 |
| Battery + charger | Li-ion with charge from the bike (with cutoff) | 1 | ₹400 |
Estimated total: ₹4,265, excluding tools, shipping and consumables.
Tools and consumables
- Soldering iron (temperature controlled, 350 °C) with 0.8 mm 60/40 or lead-free solder
- Digital multimeter — continuity, DC volts and current ranges
- Wire strippers, flush cutters and a small set of precision screwdrivers
- Heat-shrink tubing and a heat gun (or a lighter, carefully)
- A laptop with a USB port and the toolchain listed above
Hardware Specifications
| Part | Specification | Supply | Interface | Reference |
|---|---|---|---|---|
| ESP32 DevKit V1 (ESP-WROOM-32) | Dual-core Xtensa LX6 @ 240 MHz, 520 KB SRAM, 4 MB flash, Wi-Fi 802.11 b/g/n + BLE 4.2, 34 GPIO, 18× 12-bit ADC, 2× 8-bit DAC | 3.3 V logic / 5 V USB | UART, SPI, I²C, I²S, CAN, PWM | Datasheet |
| MPU-6050 6-axis IMU | 3-axis gyro ±250–2000 °/s, 3-axis accel ±2–16 g, 16-bit ADC, on-chip DMP | 2.375–3.46 V (module 5 V tolerant) | I²C (0x68/0x69) | Datasheet |
| u-blox NEO-6M GPS module + ceramic patch antenna | 50 channels, −161 dBm tracking, 2.5 m CEP, 1–5 Hz update, cold start 27 s | 3.3–5 V | UART NMEA 9600 | Datasheet |
| SIM800L GSM/GPRS module | Quad-band 850/900/1800/1900 MHz, GPRS class 12, SMS + TCP/IP | 3.4–4.4 V (NOT 5 V) | UART AT commands | Datasheet |
| Active piezo buzzer 5 V | 85 dB at 10 cm, 2.3 kHz resonance, 12 mm diameter | 3–5 V | Digital / PWM | Datasheet |
| 18650 Li-ion cell 3400 mAh + holder | 3.7 V nominal, 4.2 V full, 3400 mAh, ~12.6 Wh, 2 C discharge | 3.0–4.2 V | Holder / spot-welded tabs | Datasheet |
Consolidated electrical and interface specifications for every active part in the build.
Power Budget & Supply Sizing
Add up the typical active current of every part, then size the supply with at least 50 % headroom so transmit bursts and motor inrush never brown out the controller.
| Load | Supply rail | Typical current (mA) | Notes |
|---|---|---|---|
| ESP32 DevKit V1 (ESP-WROOM-32) | 3.3 V logic / 5 V USB | 160 | Wi-Fi transmit bursts peak near 500 mA — size the regulator accordingly. |
| MPU-6050 6-axis IMU | 2.375–3.46 V (module 5 V tolerant) | 3.9 | Gyro bias drifts with temperature — re-zero at boot while the device is still. |
| u-blox NEO-6M GPS module + ceramic patch antenna | 3.3–5 V | 45 | Needs clear sky view; indoors it will never get a first fix. |
| SIM800L GSM/GPRS module | 3.4–4.4 V (NOT 5 V) | 2000 | Transmit bursts hit 2 A — needs a 4.0 V supply and a 1000 µF bulk capacitor. |
| Active piezo buzzer 5 V | 3–5 V | 30 | Active buzzers make tone on DC; passive ones need a PWM carrier. |
Summed typical draw is 2238.9 mA. With a 1.5× design margin the supply should deliver at least 3400 mA continuously at the stated rail voltage.
Software Requirements & Development Environment
Reference toolchain: Arduino IDE 2.3.x with the ESP32 board package 3.x (or PlatformIO on VS Code). Anything newer normally works; anything older may lack the board definitions used here.
- Install the Arduino IDE 2.3.x (or PlatformIO if you prefer a real editor and dependency locking).
- Add
https://espressif.github.io/arduino-esp32/package_esp32_index.jsonunder File → Preferences → Additional Board Manager URLs, then install esp32 from the Boards Manager. - Set the correct port under Tools → Port. On Linux add yourself to the
dialoutgroup:sudo usermod -aG dialout $USERand log out and back in. - Open the Serial Monitor at 115200 baud — every sketch here logs its state there.
- Keep File → Preferences → Show verbose output during: compilation switched on while you are debugging build errors.
Required libraries
| Library | Why it is needed | Install |
|---|---|---|
| WiFi (ESP32 core) bundled | Station/AP connection management for the ESP32. | Bundled with the ESP32 Arduino core |
| MPU6050_light / Adafruit MPU6050 1.3.x | IMU register access, calibration and complementary-filter angles. | Library Manager → "MPU6050_light" by rfetick |
| TinyGPSPlus 1.0.3 | Streaming NMEA parser producing latitude, longitude, speed and time. | Library Manager → "TinyGPSPlus" by Mikal Hart |
| PubSubClient 2.8 | Lightweight MQTT 3.1.1 client for constrained devices. | Library Manager → "PubSubClient" by Nick O'Leary |
| Preferences (NVS) bundled | Wear-levelled key/value storage in ESP32 flash for settings. | Bundled with the ESP32 core |
| FreeRTOS (ESP-IDF) bundled | Task scheduling so networking never blocks sensor sampling. | Bundled with the ESP32 core |
Block Diagram
The block diagram shows the functional decomposition of the system — what senses, what decides, what acts, and where the data ends up.
Circuit Diagram & Wiring
Every signal line in the build is shown below, followed by a pin-by-pin connection table you can work through with a multimeter in hand.
| Peripheral | Peripheral pin | Controller pin | Signal |
|---|---|---|---|
| Accelerometer | SDA/SCL | GPIO 21/22 | Motion/tilt |
| Accel INT (wake) | INT | GPIO 33 (RTC) | Wake-on-motion |
| GPS | TX/RX | GPIO 26/25 | Location |
| Cellular modem | UART | GPIO 27/14 | Alert/track |
| Alarm/buzzer | IN | GPIO 2 | Local deterrent |
| Battery | + | BAT | Power |
| Bike charge | 12V | reg+cutoff | Trickle charge |
Wire one row at a time and tick it off — most "it does not work" reports trace back to a single swapped pair.
Wiring explanation
- Wire the accelerometer's motion interrupt to an RTC-capable GPIO so it can wake the ESP32 from deep sleep.
- Add GPS and a cellular modem for location and alerting.
- Add a loud local alarm as a deterrent.
- Charge from the bike through a regulator with a cutoff; the battery must ride through when parked/off.
- Install hidden and tamper-resistant — a thief must not be able to find and pull the unit off easily.
System Architecture
Read the stack from the bottom up: physical hardware, the firmware that drives it, the transport that moves data off the device, and the software a human actually looks at.
Working Principle
A theft is not a single instant but a timeline — the bike is approached and tampered with, then taken, then moved away — and an effective anti-theft device intervenes at every stage of it. Tamper detection deters and warns at the start; a loud alarm and an instant alert can stop the theft before it completes; and live tracking gives a chance of recovery if it does. Covering the whole timeline, rather than just one stage, is what makes the difference for a vehicle as easy to steal and as hard to recover as a two-wheeler.
The heart of it is motion-based tamper detection, and its central engineering problem is discrimination. An accelerometer on a parked bike sees the theft signatures — being lifted off the stand, tilted, wheeled, knocked, or started — but it also sees harmless motion: wind, a passer-by brushing past, a neighbouring vehicle. If the device alarms on every nudge, the owner disables it and thieves learn to ignore it; if it is too deaf, it misses the theft. So it classifies motion by pattern, magnitude and persistence — a sustained lift or a continued wheeling is theft, a single small jolt is a nudge — to alarm on real tampering while rejecting the noise. That discrimination is what keeps the alarm credible.
On a genuine event the device acts on two fronts simultaneously. It sounds a local alarm — a deterrent that often ends the attempt, since a thief wants a quiet, quick job — and it sends the owner an instant remote alert over cellular, because the owner may be nearby and able to intervene, or to call the police immediately. Then it escalates: if motion continues and the bike is actually being taken, it switches from alarming to live GPS tracking, streaming location so the bike can be followed and recovered. This escalation — nudge tolerated, tamper alarmed and alerted, removal tracked — matches the response to the threat.
Making all this work on a hidden device on a parked, engine-off vehicle imposes two hard constraints that shape the design. First, power: the device may sit armed for days, so it lives in ultra-low-power sleep, drawing almost nothing, and is woken by the accelerometer's motion interrupt only when something actually moves — this "sleep until moved" architecture is what lets a small battery last, and it means the accelerometer, not a polling loop, is the trigger. Second, tamper resistance: a tracker a thief can find and rip off in seconds is useless, so the unit is hidden and mounted to resist quick removal, ideally alerting the moment it is interfered with. The design is honest about the limits — no tracker guarantees recovery, a determined thief may locate and disable a unit or jam signals, and recovery should be pursued through the police, not by the owner confronting thieves. Within those honest bounds, it does what two-wheeler security most needs: make an easy, untraceable target into one that is noisy when touched and followable if taken.
The maths behind it
Tamper vs nudge classification
From accelerometer magnitude a and tilt θ over a window:
jolt = |a − 1g| > A_jolt (a knock)
lift/tilt = |θ − θ_park| > θ_thr (moved off stand)
motion = jolts/tilt SUSTAINED > t_persist
tamper if (lift/tilt) OR sustained motion
nudge if a single brief jolt only → ignore
Discrimination keeps the alarm credible.
Escalation
nudge → stay armed (no alarm)
tamper → LOCAL ALARM + instant owner alert
sustained/ → also LIVE GPS TRACKING (being taken)
removal
Response matched to threat stage.
Ultra-low-power arm
Armed & parked:
deep sleep (µA-scale), accel INT wired to RTC GPIO
motion interrupt → WAKE → classify
no theft → back to sleep
"Sleep until moved" makes a small battery last days.
Program Flowchart
The firmware is a single cooperative loop. Nothing blocks for long, so networking, sensing and the user interface all stay responsive.
Assembly Instructions
Build on a breadboard first and only commit to solder once the whole system has run for an hour without a fault.
Wire the wake-on-motion core
Connect the accelerometer with its motion interrupt to an RTC-capable GPIO so it wakes the ESP32 from deep sleep; add GPS, cellular and a loud alarm.
Charge from the bike via a regulator with a cutoff so the battery rides through when parked.
Tune tamper vs nudge
Calibrate the parked orientation and thresholds so a real lift/wheel/knock alarms while wind and passers-by do not.
Set escalation and alerting
Configure alarm + instant alert on tamper, and live tracking on sustained motion; verify low-power sleep and wake.
Step-by-Step Implementation Guide
Work through these in order. Each step ends in something you can observe, so a failure is always localised to the step you just finished.
Classify motion: tamper or nudge
On a motion wake, classify the event — a sustained lift/tilt/wheeling is tampering; a single brief jolt is a harmless nudge to ignore.
cpptamper.ino#define A_JOLT 0.30f // g deviation = a knock #define TILT_THR 15.0f // deg off parked orientation #define PERSIST_MS 1500 // sustained motion => real tamper float parkedTilt = 0; // learned when armed // Returns: 0 none, 1 nudge, 2 tamper int classifyMotion(){ uint32_t start = millis(); int jolts = 0; float maxTilt = 0; while (millis() - start < PERSIST_MS){ float a = accelMagnitude(); // g float tilt = fabsf(currentTilt() - parkedTilt); if (fabsf(a - 1.0f) > A_JOLT) jolts++; if (tilt > maxTilt) maxTilt = tilt; delay(50); } if (maxTilt > TILT_THR) return 2; // lifted/tilted off stand -> tamper if (jolts >= 6) return 2; // sustained knocking -> tamper if (jolts >= 1) return 1; // a single/brief jolt -> nudge return 0; }while (millis() - start < PERSIST_MS){Motion is judged over a persistence window — sustained motion is theft, a momentary blip is not — which is what rejects false alarms.if (maxTilt > TILT_THR) return 2; // lifted/tilted off stand -> tamperA change in tilt from the learned parked orientation means the bike was lifted or moved off its stand — a strong theft signature.if (jolts >= 6) return 2; // sustained knocking -> tamperRepeated jolts indicate active tampering (wheeling, forcing), escalated to a tamper event.if (jolts >= 1) return 1; // a single/brief jolt -> nudgeA single brief jolt (wind, a passer-by) is classified as a harmless nudge and does not trigger the alarm, keeping it credible.Alarm, alert and escalate to tracking
On a tamper, sound the alarm and alert the owner instantly; if motion continues (the bike is being taken), switch to live GPS tracking.
Complete Source Code
The listing below is complete and compiles as written — there are no elided sections. Read the annotations under each block before you upload it.
/* ═══════════════════════════════════════════════════════════════
Two-Wheeler Anti-Theft GPS Tracker — ESP32
Armed & parked: deep sleep, woken by the accelerometer's motion
interrupt. Classifies tamper vs nudge; on tamper sounds a local alarm
and alerts the owner instantly; if the bike is taken, tracks it live.
Hidden, tamper-resistant, ultra-low-power. Recover via the police.
══════════════════════════════════════════════════════════════════ */
#include "esp_sleep.h"
#include <TinyGPS++.h>
#define ACCEL_INT_GPIO GPIO_NUM_33 // RTC-capable: wakes from deep sleep
#define TRACK_PERSIST_MS 4000 // sustained motion => being taken
RTC_DATA_ATTR bool armed = true;
TinyGPSPlus gps; HardwareSerial gpsSer(2);
void armAndSleep(){
configureAccelWakeInterrupt(); // accel INT on motion
esp_sleep_enable_ext0_wakeup(ACCEL_INT_GPIO, 1);
esp_deep_sleep_start(); // µA sleep until MOVED
}
void alarm(bool on){ digitalWrite(2, on); } // local deterrent
void alertOwner(const char* what){
cellularSend("bike/alert", what); // instant remote alert
}
void trackLive(){
while (motionContinues()){ // being taken -> stream location
while (gpsSer.available()) gps.encode(gpsSer.read());
char m[128];
snprintf(m,sizeof m,"{\"lat\":%.6f,\"lon\":%.6f}",
gps.location.lat(), gps.location.lng());
cellularSend("bike/track", m); // owner/police can follow
delay(5000);
}
}
void setup(){
Serial.begin(115200);
gpsSer.begin(9600, SERIAL_8N1, 26, 25);
pinMode(2, OUTPUT);
accelInit(); learnParkedOrientation();
if (esp_sleep_get_wakeup_cause() == ESP_SLEEP_WAKEUP_EXT0){
int m = classifyMotion(); // 0 none, 1 nudge, 2 tamper
if (m == 2){
alarm(true);
alertOwner("TAMPER on your bike"); // alarm + instant alert
if (motionSustained(TRACK_PERSIST_MS)){ // actually being taken
alertOwner("Bike being MOVED - tracking");
trackLive(); // live GPS tracking
}
alarm(false);
}
// nudge or none -> just re-arm
}
if (armed) armAndSleep(); // back to ultra-low-power sleep
}
void loop(){} // all work is wake-driven
Configuration & Calibration
Configuration steps
- Configure the accelerometer wake interrupt and parked-orientation learning.
- Configure tamper vs nudge thresholds (jolt, tilt, persistence).
- Configure alarm, instant alert, and the sustained-motion tracking trigger.
- Configure GPS/cellular and low-power sleep behaviour.
Calibration procedure
An uncalibrated sensor produces confident, precise, wrong numbers. Do this once per physical unit and record the constants.
Tamper thresholds
Tune jolt/tilt/persistence so lifting, wheeling and knocking alarm while wind and passers-by do not.
Power
Verify deep-sleep current and reliable wake-on-motion; confirm battery life meets the parked duration.
Tracking
Confirm GPS fix time and cellular streaming once tracking starts.
Network Architecture & Connectivity
Communication protocol
The tracker sends instant tamper alerts and, if the bike is taken, streams live location; it sleeps otherwise to save battery.
| Topic / endpoint | Direction | Payload |
|---|---|---|
bike/<id>/alert | tracker → owner | tamper / being-moved |
bike/<id>/track | tracker → owner/police | live location |
bike/<id>/health | tracker → platform | battery, armed, signal |
Message contract between the device and the broker.
Cloud platform configuration
A platform delivers instant alerts and live tracking to the owner, and supports lawful, police-led recovery.
Dashboard setup
Owner app: armed status, tamper alerts, live map when taken, and device health.
Mobile app integration
Instant tamper alerts and a live recovery map; arm/disarm.
Security considerations
- Hidden, tamper-resistant install; authenticate the tracker.
- Recovery is lawful and police-led — not owner confrontation.
- Location data is sensitive — secure it and restrict access to the owner.
Testing Procedure & Expected Output
Test from the bottom up. Confirm power, then each sensor in isolation, then the integrated loop — the first failing step tells you exactly where to look.
| Test | What you should see |
|---|---|
| Nudge the parked bike lightly | Classified as nudge — no alarm (credible) |
| Lift it off the stand | Tamper: alarm + instant owner alert |
| Wheel it away | Sustained motion → live GPS tracking |
| Leave armed for a day | Deep sleep holds battery; wakes on motion |
| Try to find/remove the unit | Hidden; interference alerts |
| Recover scenario | Live location shared for police-led recovery |
Bench-test checklist. If a row fails, stop and fix it before moving on.
Expected output
Instant tamper alerts, a local alarm, and live location if the bike is taken.
{
"event": "tamper",
"escalation": "being-moved",
"alarm": true,
"lat": 19.0760,
"lon": 72.8777,
"battery": "ok"
}
A tamper that escalated to the bike being moved: the alarm sounded, the owner was alerted instantly, and live location began streaming for a police-led recovery.
Troubleshooting: Common Errors & Fixes
Performance Optimisation
- Ultra-low-power sleep with accelerometer wake for long parked life.
- Classify tamper vs nudge to keep the alarm credible.
- Escalate: alarm/alert on tamper, live-track only if taken.
- Fast, reliable location once tracking starts.
- Replace every
delay()with amillis()comparison — blocking delays are the single most common cause of dropped readings. - Sample sensors on a fixed cadence and publish on a slower one; you almost never need to transmit at the sampling rate.
- Move networking into its own FreeRTOS task so a slow DNS lookup cannot stall the control loop.
- Use
uint8_t/uint16_twhere the range allows; on an 8-bit AVR a 32-bit add costs four times as much. - Batch several samples into one MQTT publish. Radio time, not CPU time, dominates the energy budget.
- Set the MQTT keep-alive to a value that matches your reporting interval so the broker does not churn reconnections.
- For battery builds use deep sleep between samples: an ESP32 drops from ~160 mA awake to about 10 µA asleep, which is the difference between days and months of runtime.
Safety Precautions
- No tracker guarantees recovery — treat it as deterrence and a recovery aid, not a certainty.
- Recovery must be lawful and police-led; never confront thieves yourself.
- Install charging from the bike safely (regulator + cutoff); avoid fire/short risks.
- Location data is sensitive personal data — secure it and restrict it to the owner.
- Lithium cells vent and burn when abused. Only use protected cells or a proper BMS, never charge below 0 °C, and never leave a charging pack unattended on a wooden desk.
- Never power an RF module without its antenna fitted — the reflected power destroys the output stage. Check your local licence-free band and duty-cycle limits before transmitting.
- Wear eye protection when soldering or cutting, and solder in a ventilated space — rosin flux fumes are a respiratory irritant.
- Power the circuit through a bench supply with a current limit while you are testing. A 300 mA limit turns a wiring mistake into a beep instead of a dead board.
- Disconnect power before changing any wiring. Hot-plugging a sensor onto a live bus is the fastest way to lose a controller.
Maintenance
- Check battery health and deep-sleep current periodically.
- Re-verify tamper thresholds after re-mounting.
- Confirm GPS/cellular coverage in usual parking spots.
- Keep the install hidden and tamper-resistant after servicing.
- Re-check every screw terminal and header after the first week — thermal cycling loosens connections that felt tight on day one.
- Log pack voltage. When resting voltage after a full charge drops below about 4.0 V, the cell is near end of life — replace it.
- Keep the broker and dashboard containers patched, and rotate device credentials at least once a year.
- Recalibrate at the interval given in the calibration section, and keep the constants in a text file next to the firmware — not only in flash.
- Keep a short logbook of firmware versions and what changed. Six months later you will not remember why that constant is 1.083.
Future Improvements & Upgrades
A working v1 is a platform, not a finish line. These are the upgrades that add the most capability for the least rework.
- Add geofencing (alert if the bike leaves a zone).
- Add remote immobilisation (lawfully and safely engineered).
- Add BLE owner-presence auto-arm/disarm.
- Add crash/fall detection and emergency alerting.
- Design a proper PCB. Once the breadboard version has run for a month, moving to a two-layer board removes the intermittent-contact failures that dominate prototype faults.
- Add over-the-air firmware updates so you never have to physically reach a deployed node again.
- Add persistent local storage (microSD or the on-chip flash) so a network outage does not create a hole in your data.
- Move configuration out of the source: a captive-portal setup page or a JSON config file makes the build reusable without a recompile.
- Add a battery and solar option so the unit survives a power cut and can be sited away from a socket.
- Write a small test harness that feeds synthetic sensor values through the decision logic, so you can validate thresholds without physically triggering the event.
Frequently Asked Questions
References & Learning Resources
These are the primary sources worth reading in full. Manufacturer datasheets always outrank forum posts when the two disagree.
- Vehicle tracking systemReference
- Motorcycle theftReference
- AccelerometerReference
- ESP32 deep sleep / wake sourcesEspressif
- GPSReference