পড়ে যাওয়া ধরার এলার্ম (MPU6050)Elderly Fall Detection with Arduino and MPU6050
স্থির দাঁড়িয়ে থাকলে Z axis পড়ে ৯.৮ m/s² — মাধ্যাকর্ষণের পুরো টান। ফ্রি-ফল অবস্থায় এক মুহূর্তের জন্য তিনটা axis-ই প্রায় শূন্য। মোট ত্বরণ সীমার নিচে নামলেই buzzer আর লাল LED চিৎকার করে ওঠে — smartwatch-এর ভেতরের পদার্থবিজ্ঞান এটাই।
Standing still, the Z axis reads the full 9.8 m/s^2 of gravity. In free fall, every axis reads almost zero for a moment. When the total drops below a threshold, the buzzer and the red LED call for help — the physics inside the smart watches.
সার্কিট ডায়াগ্রাম · Circuit diagram
যা যা লাগবে · Parts you need
- 1 × Arduino Uno Arduino Uno
- 1 × Motion sensor MPU6050 (GY-521) মোশন সেন্সর MPU6050 (GY-521)
- 1 × Buzzer Buzzer (বাঁশি)
- 1 × Resistor 220Ω Resistor
- 1 × LED (red) LED বাতি
- 9 × Jumper wires জাম্পার তার
তার লাগানো · Wiring
| Motion sensor MPU6050 (GY-521) VCC | → | Arduino Uno 5V |
| Motion sensor MPU6050 (GY-521) GND | → | Arduino Uno GND |
| Motion sensor MPU6050 (GY-521) SDA | → | Arduino Uno A4 |
| Motion sensor MPU6050 (GY-521) SCL | → | Arduino Uno A5 |
| Arduino Uno D8 | → | Buzzer + |
| Buzzer - | → | Arduino Uno GND.3 |
| Arduino Uno D7 | → | Resistor a |
| Resistor b | → | LED A |
| LED K | → | Arduino Uno GND.3 |
Code (Arduino C++)
#include <Wire.h>
#include <Adafruit_MPU6050.h>
#include <Adafruit_Sensor.h>
// Elderly-fall alarm: standing still, the Z axis carries the full 9.8 m/s^2 of
// gravity. In free fall every axis reads almost zero for a moment — a short
// window of near-zero total acceleration means the device (and its wearer) is
// dropping. That is the cheap trick wearables use before the fancy algorithms.
Adafruit_MPU6050 mpu;
const int buzzer = 8, alarmLed = 7;
void setup() {
pinMode(buzzer, OUTPUT);
pinMode(alarmLed, OUTPUT);
Serial.begin(9600);
if (!mpu.begin()) { Serial.println("MPU6050 not found"); while (1) delay(10); }
mpu.setAccelerometerRange(MPU6050_RANGE_8_G);
}
void loop() {
sensors_event_t a, g, temp;
mpu.getEvent(&a, &g, &temp);
float x = a.acceleration.x, y = a.acceleration.y, z = a.acceleration.z;
float total = sqrt(x * x + y * y + z * z);
if (total < 1.5) {
digitalWrite(buzzer, HIGH);
digitalWrite(alarmLed, HIGH);
Serial.print("FALL! total="); Serial.println(total, 1);
} else {
digitalWrite(buzzer, LOW);
digitalWrite(alarmLed, LOW);
}
delay(150);
}
আরো project · More projects
- নয়েজ মিটার: শব্দের মাত্রা ৩টা LED তেNoise meter: classroom loudness on 3 LEDs
- ডট ম্যাট্রিক্সে মিউজিক ভিজ্যুয়ালাইজারMusic visualizer on a dot-matrix display
- পানি ছাড়া ট্যাংকের লেভেল (ultrasonic + অটো ফিল)Contactless water tank level (ultrasonic + auto refill)
- ঘনত্ব অনুযায়ী ট্রাফিক সিগন্যাল (কার অনুযায়ী সবুজ)Density-based traffic signal (green time follows the queue)