Table of Contents
- Vibration Sensor Types
- SW-420 Module Build
- ADXL345 3-Axis Accelerometer
- Vehicle Power Considerations
- GSM SMS Alert
- Indian Vehicle Context
- FAQ
Vibration Sensor Types
A vibration alarm sensor detects unauthorised movement of vehicles, display cases, safes, and gates. Two main types for Indian maker builds:
- SW-420: Simple spring-contact vibration switch. Digital HIGH/LOW output. No axis information. Very low cost (Rs 15-40). Triggers on any vibration above mechanical threshold set by onboard potentiometer. Prone to false alarms from nearby trucks on Indian roads.
- ADXL345: 3-axis MEMS accelerometer, I2C/SPI interface. Provides X/Y/Z acceleration data with built-in activity threshold registers. More sophisticated analysis: distinguishes brief parking bump from sustained towing tilt. Rs 80-150.
SW-420 Module Build
#define VIB_PIN 2 // interrupt pin
#define SIREN 8
volatile bool triggered=false;
void vibISR(){ triggered=true; }
void setup(){
pinMode(VIB_PIN,INPUT);
attachInterrupt(digitalPinToInterrupt(VIB_PIN),vibISR,RISING);
pinMode(SIREN,OUTPUT);
}
void loop(){
if(triggered){
digitalWrite(SIREN,HIGH); delay(30000);
digitalWrite(SIREN,LOW); triggered=false;
}
}
The SW-420 sensitivity potentiometer adjusts spring tension. Start at minimum sensitivity (fully clockwise) and reduce until road vibration does not trigger, but a firm knock on the vehicle body does. Calibrate in-place as vibration coupling varies significantly by vehicle type (motorcycle vs car vs truck).
ADXL345 3-Axis Accelerometer
#include <Wire.h>
#include <Adafruit_ADXL345_U.h>
Adafruit_ADXL345_Unified accel=Adafruit_ADXL345_Unified(12345);
void setup(){
accel.begin();
// Set activity threshold: 32 counts = 0.5g at 15.6mg/LSB
accel.writeRegister(ADXL345_REG_THRESH_ACT,32);
accel.writeRegister(ADXL345_REG_ACT_INACT_CTL,0xFF); // all axes
accel.writeRegister(ADXL345_REG_INT_ENABLE,0x10); // activity interrupt
}
// In loop: check INT1 pin (HIGH when ACTIVITY bit set)
// Read INT_SOURCE register to confirm activity event
// Check Z-axis deviation from baseline to detect tilt (towing)
Vehicle Power Considerations
Vehicle alarm must run 24/7 from car battery (12V, 40-100Ah). Target quiescent current under 10mA to avoid battery drain. Power budget:
- Arduino Nano in sleep mode: 0.1mA (use LowPower library)
- ADXL345 in standby: 0.01mA; active measurement: 0.14mA
- SIM800L in sleep: 1mA; during SMS transmission: 200-700mA peak (brief)
- Total quiescent: approximately 5mA = negligible on 60Ah car battery
Use LM2596 DC-DC buck converter (90%+ efficient) to step 12V down to 5V for Arduino. Runs cooler than 7805 linear regulator – important given Indian summer temperatures of 35-45 degrees C.
GSM SMS Alert
Add SIM800L: on vibration trigger, wake from sleep, power up GSM module, wait for network registration (5-15 seconds), send SMS to owner number. Include vehicle description and location if GPS module (NEO-6M, Rs 300-500) is added. Complete alert pipeline: 15-30 seconds from trigger to SMS delivery. Use Jio or Airtel prepaid SIM with maintained SMS balance. For parked vehicles near coverage towers, SMS delivery is near-instantaneous.
Indian Vehicle Context
- Two-wheelers (70% of Indian vehicles): Motorcycles and scooters need more sensitive vibration detection than cars but experience more false alarms from kick-start vibration and passing heavy vehicles on Indian roads. Use ADXL345 with sustained-vibration filter for best results.
- Summer heat: Electronics inside parked cars reach 60-80 degrees Celsius in Indian summer sun. Use industrial-temperature components (rated -40 to +85C) and mount under dash or under seat in shaded locations.
- Noisy parking: Indian street parking near construction sites or potholed roads generates background vibration. Use ADXL345 with 0.3-0.5g threshold and 2-second sustained filter.
Frequently Asked Questions
Will my vibration alarm trigger when a truck passes nearby?
Road vibration from heavy trucks is typically 0.05-0.1g at 5m distance. Use ADXL345 with 0.3-0.5g threshold and implement sustained-vibration filter: trigger only if vibration exceeds threshold for more than 2 seconds continuously. Truck vibration is brief; towing or window break is sustained. SW-420 mechanical switches are more susceptible to false alarms than ADXL345.
What power voltage does the Arduino need in a 12V car system?
Most Arduino modules need 5V. Use LM2596 DC-DC buck converter to step 12V to 5V efficiently. The LM2596 is 90%+ efficient versus 60% for the 7805 linear regulator and runs much cooler – important given Indian summer temperatures in parked vehicle interiors.
Can I arm and disarm the alarm from my phone?
Yes – add SIM800L with command SMS system. Send “ARM 1234” to arm, “DISARM 1234” to disarm. Module polls incoming SMS on a 30-second interval (AT+CMGR). Add ESP32 with 4G module for app-based control via MQTT when in range of mobile data, with SMS fallback when out of range.
My alarm triggered but I see no obvious tampering.
Common Indian conditions causing false alarms: nearby construction explosion, large vehicle jumping a pothole nearby, heavy monsoon hail or rain impact on bodywork, wind-driven debris impact, or vibration from a nearby railway line. Log accelerometer data to EEPROM on trigger to diagnose the event waveform after the fact.
Add comment