Bike Automation using Arduino UNO and Android App

Bike Automation using Arduino UNO and Android App


The aim of this project is to control a bike using a mobile host (Smartphone).

Components required 

Hardware

  • Arduino UNO

  • HC – 05 Bluetooth Module 

  • 5 V Relay two channel

  • Jumper/Connecting Wires

  • Smart phone

  • 7805 Voltage Regulator


Software
  • Arduino IDE

  • Android App




Circuit and Working

The bike automation circuit is built using Arduino Uno, Bluetooth Module and a 4-channel relay or as per the requirements. Using a 4-channel relay we can control four equipments.

The step-wise working is as follows:

      Step1: Upload the sketch in Arduino Uno. A Sample sketch is shown below: 
    
int relay1 = 8;
int relay2 = 9;
int relay3 = 10;
int relay4 = 11;

String readString;

void setup() {
  Serial.begin(9600);
  pinMode(relay1, OUTPUT);
  pinMode(relay2, OUTPUT);
  pinMode(relay3, OUTPUT);
  pinMode(relay4, OUTPUT);
 }

void loop() {
  while (Serial.available()) {
    delay(3);
    char c = Serial.read();
    readString += c;
  }
  if (readString.length() >0) {
    Serial.println(readString);
   
 //relay1
    if (readString == "1 ON")
    {
      digitalWrite(relay1, HIGH);
    }
    if (readString == "1 OFF")
    {
      digitalWrite(relay1, LOW);
    }
   
 //relay2
    if (readString == "2 ON")
    {
      digitalWrite(relay2, HIGH);
    }
    if (readString == "2 OFF")
    {
      digitalWrite(relay2, LOW);
    }

  //relay3
    if (readString == "3 ON")
    {
      digitalWrite(relay3, HIGH);
    }
    if (readString == "3 OFF")
    {
      digitalWrite(relay3, LOW);

    }
  
 //relay4
    if (readString == "4 ON")
    {
      digitalWrite(relay4, HIGH);
    }
    if (readString == "4 OFF")
    {
      digitalWrite(relay4, LOW);

    }

  //All on 
    if (readString == "ALL ON")
    {
      digitalWrite(relay1, HIGH);
      digitalWrite(relay2, HIGH);
      digitalWrite(relay3, HIGH);
      digitalWrite(relay4, HIGH);
     }

  //All off
    if (readString == "ALL OFF")
    {
      digitalWrite(relay1, LOW);
      digitalWrite(relay2, LOW);
      digitalWrite(relay3, LOW);
      digitalWrite(relay4, LOW);
    }
    //next
    readString="";
}
}


Step 2: Connect Relay with Arduino Uno
Relay      Adruino Uno
IN1      >   Pin 8
IN2      >   Pin 9
IN3      >   Pin 10
IN4      >   Pin 11
GND   >    GND
VCC   >     5V

Step 3: Connect Bluetooth Module with Arduino Uno 
Bluetooth  Module               Adruino Uno
RX                                   >        TX
TX                                   >        RX
GND                                >        GND
+5V                                >         3.3V

Step 4: Connect Relay and ignition wire, indicator switches as shown below


Step 5: Install the Android App to control the appliances.

Comments

Post a Comment

Popular posts from this blog

PIR Motion Sensor Using Arduino Uno