Project tutorial
Smartwatch Controller for Arduino Car

Smartwatch Controller for Arduino Car © Apache-2.0

Control Arduino HC-05 Car with Wear Os Smartwatch

  • 250 views
  • 0 comments
  • 2 respects

Components and supplies

Apps and online services

About this project

Ever thought to control Arduino by a smart watch. Yes it's possible. We need a smart watch which has Bluetooth and that will connect to HC-05 Bluetooth module.

Smartwatch Software This is the most challenging part for me. As my watch is base on Wear OS. I need a app to send data to Arduino. Believe me I have no java or android SDK experience. For this project I learnt java and Android SDK. I took me about a month to complete this app. I already uploaded app in Playstore.

https://play.google.com/store/apps/details?id=com.rahuldpro.hc_05joystick&hl=en

You can download it from here. Remember there are many kind of smartwatch available in market. All smartwatch may not work. My app only available for Wear OS.

Planning I have mention all equipment we needs. Either you can make your own DIY car but in this project I used toy car, which is cheap and you will get rechargeable battery also. We are using L293D motor driver, perfect for our project. we are using L293D PWM speed controller pin for speed controller. Just follow the schematic. In the smartwatch more you drag forward more you will get speed.

Here is full making of video.

Making Of full Video

Just follow the schematic and upload the code in Arduino. Paired HC-05 with your smartwatch first. Open the app, HC-05 will be listed there. Select it and you will get joystick controller. Now drag it, remember more you drag more you will get speed as we are using L293D speed controller also.

Code

Arduino Car CodeC/C++
int MSP1 = 3;
int front = 9;
int back = 10;
int left = 11;
int right = 12;
int MSP2 = 5;


String data, dataT;

void setup() {
  Serial.begin(9600);
  Serial.setTimeout(3);
  
  pinMode(front,OUTPUT);
  pinMode(back,OUTPUT);
  pinMode(left,OUTPUT);
  pinMode(right,OUTPUT);
  pinMode(MSP1,OUTPUT);
  pinMode(MSP2,OUTPUT);
}

void loop() {

  if ( Serial.available()) {
    data = Serial.readStringUntil('\r\n');

    // Convert from String Object to String.
    char buf[30];
    data.toCharArray(buf, sizeof(buf));
    char *p = buf;
    char *dataC;
    while ((dataC = strtok_r(p, ":", &p)) != NULL) // delimiter is the semicolon
    { dataT = String(dataC);
      Serial.println(dataT);
    }

  //front
    if(dataT=="y0"){
      digitalWrite(front,LOW);
      digitalWrite(back,LOW);
    }
    else if(dataT=="y1"){
      analogWrite(MSP1,75); frontM(); 
    }
    else if(dataT=="y2"){
      analogWrite(MSP1,135); frontM();
    }
    else if(dataT=="y3"){
      analogWrite(MSP1,195); frontM();
    }
    else if(dataT=="y4"){
      analogWrite(MSP1,255); frontM();
    }
    if(dataT=="y-1"){
      analogWrite(MSP1,75); backM();
    }
    else if(dataT=="y-2"){
      analogWrite(MSP1,135); backM();
    }
    else if(dataT=="y-3"){
      analogWrite(MSP1,195); backM();
    }
    else if(dataT=="y-4"){
      analogWrite(MSP1,255); backM();
    }
    if(dataT=="x0"){
      Serial.println("off");
      digitalWrite(left,LOW);digitalWrite(right,LOW);
    }
    else if(dataT=="x2"){
      leftM();
    }
    else if(dataT=="x-2"){
      rightM();
    }

  }//if ends
}//loop

void frontM(){
  digitalWrite(front,HIGH);
  digitalWrite(back,LOW);
}
void backM(){
  digitalWrite(back,HIGH);
  digitalWrite(front,LOW);
}
void leftM(){
  analogWrite(MSP2,255);
  digitalWrite(left,HIGH);
  digitalWrite(right,LOW);
}
void rightM(){
  analogWrite(MSP2,255);
  digitalWrite(right,HIGH);
  digitalWrite(left,LOW);  
}

Schematics

Custom PCB for Arduino Car
Sch1 rh8zy8xi5a
Schematics
Sch2 7rc1lf9vos

Comments

Similar projects you might like

Turn your RC Car to Bluetooth RC car

Project tutorial by Prajjwal Nag

  • 22,819 views
  • 3 comments
  • 27 respects

ARMin v2: Simple Robot Car and Arm Controller Using Python

Project tutorial by HyperChiicken

  • 3,674 views
  • 0 comments
  • 11 respects

Biometric Car Entry - True Keyless Car

Project showcase by Rajeev Velikkal

  • 10,888 views
  • 10 comments
  • 47 respects

Smartwatch car remote

Project tutorial by Mika Wee

  • 20,698 views
  • 20 comments
  • 91 respects

RC Car to BT Car Controlled with Blynk

Project tutorial by Team Daxes Hacks

  • 7,917 views
  • 2 comments
  • 8 respects

Renewing the Nikko Turbo 2 RC Car

Project tutorial by MarcoGPS

  • 4,025 views
  • 2 comments
  • 10 respects
Add projectSign up / Login