Tekko BDSimSimulatorProjects

টিল্ট ট্যাম্পার অ্যালার্ম — নাড়ালেই বাজতে থাকে, রিসেট দিলে থামেTilt Tamper Alarm with a SW-520D

SW-520D এর ভিতরে একটা বল আছে — কাত দিলে বল দুই পা জুড়ে দেয়। একবার কাতলেই সireন বেজে ওঠে আর বাজতে থাকে; রিসেট বাটন চাপলে তবেই থামে।

The SW-520D is a ball in a tube: tilt it and the ball bridges the legs. One tilt latches the siren on — a thief cannot un-tilt their way out — and only the reset button silences it.

▶ ফ্রি চালিয়ে দেখো / Run it free Parts অর্ডার করো (WhatsApp)

সার্কিট ডায়াগ্রাম · Circuit diagram

Tilt Tamper Alarm with a SW-520D circuit diagram — Arduino Uno R3, Tilt switch (SW-520D), Push button, Buzzer (5 V), Resistor 330Ω, LED (red), Jumper wires

যা যা লাগবে · Parts you need

তার লাগানো · Wiring

Tilt switch (SW-520D) 1→Arduino Uno R3 GND
Tilt switch (SW-520D) 2→Arduino Uno R3 D2
Push button 1→Arduino Uno R3 D3
Push button 2→Arduino Uno R3 GND
Buzzer (5 V) +→Arduino Uno R3 D8
Buzzer (5 V) -→Arduino Uno R3 GND.3
Arduino Uno R3 D13→Resistor a
Resistor b→LED A
LED K→Arduino Uno R3 GND.3

Code (Arduino C++)

// Tilt tamper alarm: the SW-520D is a ball in a tube — tilt it and the ball
// touches both legs, D2 reads HIGH. One tilt latches the siren on (a thief
// cannot un-tilt their way out); only the reset button silences it. The same
// idea guards guitars in shops and LPG cylinders in delivery vans.
void setup() {
  Serial.begin(9600);
  pinMode(2, INPUT_PULLUP);           // the SW-520D opens when tilted: the pull-up says "calm"
  pinMode(3, INPUT_PULLUP);
  pinMode(8, OUTPUT); pinMode(13, OUTPUT);
}

void loop() {
  bool tilted = digitalRead(2) == HIGH;
  bool ack = digitalRead(3) == LOW;
  static bool alarm = false;
  if (tilted) alarm = true;
  if (ack && !tilted) alarm = false;
  digitalWrite(8, alarm ? HIGH : LOW);
  digitalWrite(13, alarm ? HIGH : LOW);
  Serial.print("Tilted: "); Serial.print(tilted ? 1 : 0);
  Serial.print(" | Alarm: "); Serial.println(alarm ? 1 : 0);
  delay(150);
}

আরো project · More projects