Tutorial Arduino Toy Car Bluetooth App Inventor Wear Os

Introduction: Tutorial Arduino Toy Car Bluetooth App Inventor Wear Os

This is a simply Arduino project using an old toy car.

With app inventor you can move the toy car using a smartphone or a wear os watch using "Minimal ADB and Fastboot" to install the apk file.

sources:

Supplies

  • arduino mini pro 5v
  • HC-05 bluetooth module
  • HG7881-(L9110)-Dual-Channel-Motor-Driver-Module
  • 18650 box battery
  • 2 x 18650 battery
  • wires

Step 1:

Step 2:

Step 3: Arduino Pro Mini 5v

arduino sketch

if (Genotronex.available()){
BluetoothData=Genotronex.read(); Serial.println(BluetoothData);}

if ( BluetoothData == 50) motorB('L');// Turn motor B to LEFT; if ( BluetoothData == 51) motorB('R');// Turn motor B to RIGHT; if ( BluetoothData == 49) motorB('O');// Turn motor B to OFF; if ( BluetoothData == 52) motorA('O');// Turn motor A to OFF; if ( BluetoothData == 53) motorA('S');// Turn motor A to SLOW; if ( BluetoothData == 54) motorA('R');// Turn motor A to FAST; if ( BluetoothData == 55) {if (A1A == 3) {A1A = 5; A1B = 3;} else {A1A = 3; A1B = 5;}} // Reverse motor A; delay(5); }

void motorA(char d) { if(d =='R'){ PW = 180; digitalWrite(A1A,LOW); analogWrite(A1B,PW); }else if (d =='S') { PW = 120; digitalWrite(A1A,LOW); analogWrite(A1B,PW); }else{ analogWrite(A1A,0); analogWrite(A1B,0); } }// motorA end

void motorB(char d) { if(d =='R'){ digitalWrite(B1A,LOW); digitalWrite(B1B,HIGH); analogWrite(A1B,PW+10); //more power }else if(d =='L'){ digitalWrite(B1A,HIGH); digitalWrite(B1B,LOW); analogWrite(A1B,PW+10); //more power }else{ // Turn motor OFF digitalWrite(B1A,LOW); digitalWrite(B1B,LOW); }

}// motorB end

Step 4:

Step 5: HC-05 Bluetooth

TX --> D10

RX --> D11

BLUETOOTH MODULE

Step 6:

Step 7: ​HG7881

HG7881-(L9110)-Dual-Channel-Motor-Driver-Module

Step 8:

A1A = 3;//define pin 3 for A1A
A1B = 5;//define pin 5 for A1B

B1A = 4;//define pin 4 for B1A

B1B = 6;//define pin 6 for B1B

Step 9: BATTERY

2 X 18650 BATTERY

(TWO BATTERIES)

Step 10: Sources

Be the First to Share

    Recommendations

    • Anything Goes Contest 2021

      Anything Goes Contest 2021
    • Jewelry Challenge

      Jewelry Challenge
    • Fix It Speed Challenge

      Fix It Speed Challenge

    Comments