Smart 2D Digital Spirit Level Kit using Arduino Nano & MPU6050

Smart 2D Digital Spirit Level Kit using Arduino Nano & MPU6050

Product form

مشروع الميزان الإلكتروني الذكي (Smart 2D Digital Spirit Level Kit) هو طقم إلكتروني متكامل يعتمد على متحكم الأردوينو نانو وحساس... Read more

Next day delivery

90,000 IQD Excl. VAT

    • Shipped today? Order within: Jul 29, 2026 23:59:00 +0300
    • Free shipping on all orders above 50 pcs

    Description

    مشروع الميزان الإلكتروني الذكي (Smart 2D Digital Spirit Level Kit) هو طقم إلكتروني متكامل يعتمد على متحكم الأردوينو نانو وحساس الحركة الدقيق (MPU6050) لتحديد درجة استواء الأسطح على المحورين (X و Y) فوراً وبكل سهولة.

    أبرز المميزات:

    • قياس وتحديد استواء دقيق: يعتمد على وحدة MPU6050 (حساس التسارع والدوران) لكشف أقل زوايا الميلان في الأسطح.

    • مؤشرات ملونة وصوتية: مزود بـ 6 ليدات اتجاهية ملونة مع جرس تنبيه (Buzzer) يصدر صوتاً فور وصول السطح للانتصاب والاستواء التام.

    • مثالي لمنتجات الروبوتكس والتعليم: خيار ممتاز كـ مشروع تعليمي لطلاب الهندسة والتقنية وهواة DIY وتطبيقات الروبوت.

     

    The Smart 2D Digital Spirit Level Kit using Arduino Nano & MPU6050 is an interactive, precision-sensing electronics kit designed to measure surface levelness and tilt angles across both X and Y axes in real-time.

    Key Features:

    • High Precision Tilt Detection: Powered by the MPU6050 6-axis gyro/accelerometer sensor to catch even the slightest surface inclination.

    • Visual & Audio Alert System: Features 6 directional LEDs and an integrated buzzer that alerts you when the surface is completely level.

    • Ideal for Robotics & STEM: A complete hands-on project suited for engineering students, robotics enthusiasts, and DIY makers.

    • Portable & Flexible Powering: Uses Arduino Nano (Type-C) for easy programming and battery supply options.

     

    الكود البرمجي

    #include <Adafruit_MPU6050.h>
    #include <Adafruit_Sensor.h>
    #include <Wire.h>

    Adafruit_MPU6050 mpu;

    // --- 1. مجموعة (يمين / يسار - المحور Y) ---
    const int LED_GREEN_Y = 3; // استواء Y
    const int LED_LEFT    = 2; // يسار
    const int LED_RIGHT   = 4; // يمين

    // --- 2. مجموعة (أمام / خلف - المحور X) ---
    const int LED_GREEN_X = 6; // استواء X
    const int LED_FORWARD = 5; // أمام
    const int LED_BACK    = 7; // خلف

    // --- 3. البزر ---
    const int BUZZER      = 8; // Buzzer

    void setup() {
      Serial.begin(9600);

      pinMode(LED_GREEN_Y, OUTPUT);
      pinMode(LED_LEFT, OUTPUT);
      pinMode(LED_RIGHT, OUTPUT);

      pinMode(LED_GREEN_X, OUTPUT);
      pinMode(LED_FORWARD, OUTPUT);
      pinMode(LED_BACK, OUTPUT);

      pinMode(BUZZER, OUTPUT);

      // Wire.begin() تلقائياً يستخدم A4 (SDA) و A5 (SCL) في النانو
      Wire.begin();

      if (!mpu.begin()) {
        Serial.println("❌ خطأ: لم يتم العثور على MPU6050!");
        while (1) { delay(10); }
      }

      mpu.setAccelerometerRange(MPU6050_RANGE_8_G);
      mpu.setFilterBandwidth(MPU6050_BAND_21_HZ);
    }

    void loop() {
      sensors_event_t a, g, temp;
      mpu.getEvent(&a, &g, &temp);

      // حساب زوايا الإمالة
      float angleY = atan2(a.acceleration.y, a.acceleration.z) * 180.0 / PI; // يمين / يسار
      float angleX = atan2(a.acceleration.x, a.acceleration.z) * 180.0 / PI; // أمام / خلف

      clearAll();

      bool isLevelY = false;
      bool isLevelX = false;

      // --- فحص اتجاه يمين / يسار ---
      if (angleY < -10.0) {
        digitalWrite(LED_LEFT, HIGH);
      }
      else if (angleY > 10.0) {
        digitalWrite(LED_RIGHT, HIGH);
      }
      else {
        digitalWrite(LED_GREEN_Y, HIGH);
        isLevelY = true;
      }

      // --- فحص اتجاه أمام / خلف ---
      if (angleX < -10.0) {
        digitalWrite(LED_FORWARD, HIGH);
      }
      else if (angleX > 10.0) {
        digitalWrite(LED_BACK, HIGH);
      }
      else {
        digitalWrite(LED_GREEN_X, HIGH);
        isLevelX = true;
      }

      // --- التحكم بالبزر ---
      if (isLevelY && isLevelX) {
        digitalWrite(BUZZER, LOW);  // ينطفئ عند الاستواء التام
      } else {
        digitalWrite(BUZZER, HIGH); // يشتغل عند وجود أي ميلان
      }

      delay(50);
    }

    void clearAll() {
      digitalWrite(LED_GREEN_Y, LOW);
      digitalWrite(LED_LEFT, LOW);
      digitalWrite(LED_RIGHT, LOW);

      digitalWrite(LED_GREEN_X, LOW);
      digitalWrite(LED_FORWARD, LOW);
      digitalWrite(LED_BACK, LOW);

      digitalWrite(BUZZER, LOW);
    }

    :رابط فديو الشرح
    https://youtube.com/shorts/CMzF_4Elh54?si=phLDAzu7E3N9hJ15

    Specifications

    • Weight: 200gr
    • Usage: Indoor & outdoor

    Pros and cons

    • Sustainably produced
    • Ideal for everyday use
    • May discolor in direct sunlight

    Top 10 best selling products

    You may also like these products. These products are rated as 'top 10 best of the best' by our clients

    Returns & Delivery

    When will my order be delivered?

    We ship worldwide. Your order will be packaged really carefully and delivered wherever you want. Delivery takes between 2-4 business days. You will receive an e-mail after ordering with more information about the delivery.

    Can I return my product?

    Orders can be returned or exchanged within 30 days of receiving the parcel, providing they are in original resalable condition.

    What can I do if my item (or part of it) is damaged?

    We work hard to deliver your items without damage. Orders can be returned or exchanged within 30 days of receiving the parcel, providing they are in original resalable condition.

    Recently viewed products

      Login

      Forgot your password?

      Don't have an account yet?
      Create account