New Project

CONNECT

Alarm System DC Motor Speed Control Project

  • Page Views 655
  • Spread the love
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  

    In this project I’ll make the Alarm System DC Motor Speed Control with the accelerometer.But we will add the warning system according to which in addition to speed. So what this system can help us? For example, according to the slope by placing accelerometer on the robot can adjust the speed of the autonomous robot of the motor. Tilt the engine to provide more power than is giving rise slope. In addition, the next project will control the system via Bluetooth wireless.

    Materials:

    • Arduino
    • Mpu6050 gyro sensor
    • DC Motors
    • Buzzer
    • Jumper Cables

    I did not need to use motor drives our project.For we will only make the engine speed control with analog edeğer change in voltage. Just go if we would have to use two-way drive.

     

    Electronic circuit diagram:

     

    A digital pin to 9 pin the engine to the GND pin on the other, plus the buzzer digital pin end of the 12’s put the negative end of the GND I eat.If you use the Arduino UNO SCL pins analog accelerometer sensor 5, let’s put the sd to 4 analog pins. If you are using pins on the Arduino Mega writing already available.

    Arduino Code:

    //Yazılım Geliştirme By Robimek - 2015
    //Yazılım Lisans By Robimek
    //www.robimek.com
    #include "Wire.h"
    #include "I2Cdev.h"
    #include "MPU6050.h"
    MPU6050 mpu;
    int16_t ax, ay, az;
    int16_t gx, gy, gz;
    int speed_value = 9;
    int gyro_value;
    int buzzerpin = 12;
    int motor_value;
    void setup()
    {
    Wire.begin();
    Serial.begin(38400);
    pinMode(buzzerpin, OUTPUT);
    digitalWrite(buzzerpin,HIGH);
    Serial.println("Initialize MPU");
    mpu.initialize();
    Serial.println(mpu.testConnection() ? "Bağlandi" : "Bağlanmadi");
    
    }
    
    void loop()
    {
    mpu.getMotion6(&ax, &ay, &az, &gx, &gy, &gz);
    gyro_value = map(ax, 0, 17000, 0,255);
    motor_value=abs(gyro_value);
    Serial.println(motor_value);
    analogWrite(speed_value,motor_value);
    if(motor_value <75) { digitalWrite(buzzerpin, HIGH); }
    
    if(motor_value >=75 && motor_value <100) { digitalWrite(buzzerpin, LOW); beep(200); }
    
    if(motor_value >=100 && motor_value <150) { digitalWrite(buzzerpin, LOW); beep(150); }
    
    if(motor_value >=150 && motor_value <200) { digitalWrite(buzzerpin, LOW); beep(75); }
    
    if(motor_value >=200)
    {
    digitalWrite(buzzerpin, LOW);
    beep(10);
    }
    delay(100);
    }
    void beep(unsigned char delayms)
    
    {
    analogWrite(12, 255);
    delay(delayms);
    analogWrite(12, 0);
    delay(delayms);
    }

     

    Share

    One Comment For "Alarm System DC Motor Speed Control Project"

    Leave a comment

    Your email address will not be published. Required fields are marked *

    BE A FACEBOOK FAN

    Instagram