টিল্ট ট্যাম্পার অ্যালার্ম — নাড়ালেই বাজতে থাকে, রিসেট দিলে থামে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.
সার্কিট ডায়াগ্রাম · Circuit diagram
যা যা লাগবে · Parts you need
- 1 × Arduino Uno R3 Arduino Uno
- 1 × Tilt switch (SW-520D) টিল্ট সুইচ (SW-520D)
- 1 × Push button চাপ-বাটন
- 1 × Buzzer (5 V) Buzzer (বাঁশি, 5 V)
- 1 × Resistor 330Ω Resistor
- 1 × LED (red) LED বাতি
- 9 × Jumper wires জাম্পার তার
তার লাগানো · 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
- 18650 ব্যাটারি হেলথ চেকার — তিনটা বাতি দিয়ে রায়18650 battery health checker (traffic-light verdict)
- চুম্বকীয় দরজার গার্ড — রিড সুইচ আর সireন দিয়েMagnetic door guard (reed switch + grace siren)
- এলপিজি লিক অটো-কাটঅফ — গ্যাস ধরলেই ভালভ বন্ধLPG leak auto-cutoff (gas detector closes the valve)
- অটোমেটিক পেট ফিডার — এক চাপে এক পোরশনAutomatic pet feeder (one button, one portion)