Tutorial Arduino Toy Car Bluetooth App Inventor Wear Os

by pierfra71 in Circuits > Arduino

537 Views, 0 Favorites, 0 Comments

Tutorial Arduino Toy Car Bluetooth App Inventor Wear Os

Tutorial Arduino bluetooth app inventor toy car remake

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

IMG_20201116_192303.jpg

IMG_20201116_192651XXXX.jpg

Arduino Pro Mini 5v

arduino mini pro 5v.jpg

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

IMG_20201116_193107XXXX.jpg

HC-05 Bluetooth

HC-05 bluetooth.jpg

TX --> D10

RX --> D11

BLUETOOTH MODULE

IMG_20201116_193333.jpg
IMG_20201116_193401.jpg

​HG7881

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

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

IMG_20201116_194257.jpg
IMG_20201116_194257XXXXX.jpg

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

BATTERY

IMG_20201116_194458.jpg
IMG_20201116_194458XXXX.jpg

2 X 18650 BATTERY

(TWO BATTERIES)

Sources

Downloads