Project tutorial
ARDUINO Voice Controlled Boat | DIY PCB Project

ARDUINO Voice Controlled Boat | DIY PCB Project © GPL3+

Hey there, In this project, we are going to make an Arduino Voice-controlled boat. We have already made so many electronics and robotics pro

  • 1,034 views
  • 0 comments
  • 1 respect

Components and supplies

Necessary tools and machines

70y8518 40
Drill / Driver, Cordless
Hy gluegun
Hot glue gun (generic)

Apps and online services

About this project

Things used in this project

Hardware components

·· ARDUINO UNO

· L293D MOTOR DRIVER

· HC-05 BLUETOOTH MODULE

· DC MOTOR

· Propeller

· 18650 LI-ION BATTERY

· 18650 LI-ION BATTERY HOLDER

· CHASSIS FOR ROBOT BODY

· PCB BOARD BY JLCPCB

JUMPER WIRES

SOFTWARE COMPONENTS

· ARDUINO IDE

· EASYEDA

· JLCPCB

Hand tools

· Soldering iron

· Drill Machine

· Glue Gun

Story

Hey guys! I hope you already enjoyed my previous projects and you are ready for a new one,

as usual, I made this tutorial to guide you step by step while making this kind of super amazing low-cost electronic project which is the "Arduino Voice Controlled Boat".

During the making of this project, we tried to make sure that this instructable will be the best guide for you to help you if you want to make your own Voice controlled robot car or boat,

So we hope that this instructable contains the needed documents.

This project is so handy to make especially after getting the customized PCB that we’ve ordered from JLCPCB to improve our machine's appearance and there are enough documents and diagrams in this guide to allow you to create your Bluetooth Robot Car easily.

We've made this project in just 3 days only 2 days to get all the needed parts and the next 1 day to finish the hardware making and the assemble.

Before starting let’s see first What you will learn from this instructable:

· Making the right hardware selection for your project depending on its functionalities.

· Prepare the circuit diagram to connect all the chosen components.

· Assemble all the project parts (mechanical and electronic assembly).

· Finally designing your own ARDUINO-based Voice-controlled boat.

How Arduino Voice Controlled Boat Works?

As we have already mentioned that this is an Arduino-based project, so Arduino is working here as the brain of the robot. Everything we command to move the Boat will be processed by the Arduino Microcontroller. We have to write a suitable code that will help the Arduino to process and follow our instructions.

Next, we want to send our voice command wirelessly. So here we have decided to use HC-05 Bluetooth Module which is compatible with Arduino & our Android Phone.

In the next step, we have to install an Android App and have to connect our phone with the boat via BlueTooth. Now we will send the voice command using the android app to move the boat as we wish.

Here we have added Five voice commands for Five different instructions. They are

Move Forward – The Boat will move in the forward direction for 2 second

Move Backward – The boat will move in any backward direction for 2 second

Turn Right – The boat will make a 90 ̊rotation on its right side

Turn Left – The boat will make a 90 ̊ rotation on its left side

Run – The boat starts moving in a forwarding direction for a long time

Schematics of the Voice Control Boat/Car with L293D:

STEP 1

In this step, I have made the Robot Body using PVC Pipe & PVC Boards. I have also attached the motors with the Chassis and have soldered them with some wires.

Here is how it looks like

Then I have attached the propellers with the chassis and here is how it looks like

Now we will make the front side of the boat. We will connect one BO motor with the boat to turn it in the left and right direction. But you can connect 2 motors there on the front side if you face trouble by making using one motor.

STEP 2

I have made a PCB file to make it easy to assemble and ordered my PCB from JLCPCB. They are very professional in PCB making and the build time was short. I received my item within 7 working days.

After getting the PCB it was just a less than 2 minutes job to assemble all the components in a proper way.

STEP 3

Now I had to upload the code to the Arduino UNO.So I have attached the USB cable that comes with the Arduino UNO board and follows the steps mentioned below

· Open Arduino IDE on your PC

· Connect ARDUINO with PC via USB Cable

· Go to Tools > manage libraries > Search for AF Motor driver and download

· Go to Tools > Board > and select Arduino\Genuino UNO

· Go to Tools > Port > Select proper COM port

· Now Verify the code and then upload it

***Please don’t forget to remove/detach the HC-05 Bluetooth Module before uploading the code. Connect it after the code has been uploaded successfully.

STEP 4

Here in this step, I have attached the PCB board with the robot body / Chassis and connected the motor terminal with the output terminal of the L293D Motor Driver.I have also attached the 18650 Li-ion battery holder with the chassis and connected the output wires of the battery holder with the input power terminal of the L293D motor driver.

STEP 5

Here in this step, I have attached the 18650 Li-ion batteries with the battery holder and finally, the motor turns on.

Here is how it finally looks like

STEP 6

Now you will need the “AMR_Voice” app for controlling the Boat. I have given the Application link in the code you can directly download from there and install it to your Android device.

About JLCPCB

JLCPCB (Shenzhen JIALICHUANG Electronic Technology Development Co., Ltd.), is the largest PCB prototype enterprise in China and a high-tech manufacturer specializing

in quick PCB prototype and small-batch PCB production. With over 10 years of experience in PCB manufacturing, JLCPCB has more than 200, 000 customers at home and abroad,

with over 8, 000 online orders of PCB prototyping and small quantity PCB production per day. The annual production capacity is 200, 000 sq.m. for various of 1-layer,

2-layer or multi-layer PCBs. JLCPCBis a professional PCB manufacturer featured of large scale, well equipment, strict management, and superior quality.

Troubleshoot:

1. The programmer is not responding: If you face this error then it may be because of the Bluetooth Module. Always Disconnect the RX and the TX pins before uploading the code to the Arduino.

2. The motor is not rotating in the right direction: If you face this issue then you don’t need to modify any code. You just have to Interchange the motor wires. In a simple way, I can say just connect the Motor to the Motor driver

Code

ARDUINO VOICE CONTROLLED BOATC#
// Arduino Voice Controlled Car
// Before uploading the code you have to install the necessary library//
//AFMotor Library https://learn.adafruit.com/adafruit-motor-shield/library-install //
//Servo Library https://github.com/arduino-libraries/Servo.git //

#include <AFMotor.h> //Adafruit Motor Shield Library. First you must download and install AFMotor library
#include <Servo.h>   //Servo library. This is standard library. (Sketch -> Include Library -> Servo)
String voice;

AF_DCMotor motor1 (1, MOTOR12_1KHZ); //create motor #1 using M1 output on Motor Drive Shield, set to 1kHz PWM frequency
AF_DCMotor motor2 (2, MOTOR12_1KHZ); //create motor #2 using M2 output on Motor Drive Shield, set to 1kHz PWM frequency
AF_DCMotor motor3 (3, MOTOR34_1KHZ); //create motor #3 ysing M3 output on Motor Driver Shield,set to 1kHz PWM frequency
AF_DCMotor motor4 (4, MOTOR34_1KHZ); //create motor #4 ysing M4 output on Motor Driver Shield,set to 1kHz PWM frequency

Servo myServo; //define servo name


void setup()
{
  Serial.begin(9600); //start serial communication
  myServo.attach(10); //define our servo pin (the motor shield servo1 input = digital pin 10)
  myServo.write(90);  //servo position is 90 degrees
  
}

void loop() 
{
  while (Serial.available()){ //Check if there is an available byte to read
     delay(10); //Delay added to make thing stable 
    char c = Serial.read(); //Conduct a serial read
    if (c == '#') {break;} //Exit the loop when the # is detected after the word
    voice += c; //Shorthand for voice = voice + c
  }
  if (voice.length() > 0){
    if(voice == "*move forward"){
      forward_car();
      }
    else if(voice =="*move backward"){
      back_car();
      }
    else if(voice == "*turn right") {
      right_car();
    }
    else if(voice == "*turn left") {
      left_car();
    }
    else if(voice == "*stop") {
      stop_car();
    }
    
  voice=""; //Reset the variable after initiating
  }
}

void forward_car()
{
  motor1.setSpeed(255); //Define maximum velocity
  motor1.run(FORWARD); //rotate the motor clockwise
  motor2.setSpeed(255); //Define maximum velocity
  motor2.run(FORWARD); //rotate the motor clockwise
  motor3.setSpeed(255);//Define maximum velocity
  motor3.run(FORWARD); //rotate the motor clockwise
  motor4.setSpeed(255);//Define maximum velocity
  motor4.run(FORWARD); //rotate the motor clockwise
  delay(1500);
  motor1.run(RELEASE); //Stop the motor
  motor2.run(RELEASE); //Stop the motor
  motor3.run(RELEASE); //Stop the motor
  motor4.run(RELEASE); //Stop the motor
}
  
void back_car()
{
  motor1.setSpeed(255); //Define maximum velocity
  motor1.run(BACKWARD); //rotate the motor anti-clockwise
  motor2.setSpeed(255); //Define maximum velocity
  motor2.run(BACKWARD); //rotate the motor anti-clockwise
  motor3.setSpeed(255); //Define maximum velocity
  motor3.run(BACKWARD); //rotate the motor anti-clockwise
  motor4.setSpeed(255); //Define maximum velocity
  motor4.run(BACKWARD); //rotate the motor anti-clockwise]
   delay(1500);
  motor1.run(RELEASE); //Stop the motor
  motor2.run(RELEASE); //Stop the motor
  motor3.run(RELEASE); //Stop the motor
  motor4.run(RELEASE); //Stop the motor
}
  
void right_car()
{
  myServo.write(0);
  delay(500);
  myServo.write(90);
  delay(500);
   motor1.setSpeed(255); //Define maximum velocity
  motor1.run(FORWARD); //rotate the motor clockwise
  motor2.setSpeed(255); //Define maximum velocity
  motor2.run(FORWARD); //rotate the motor clockwise
  motor3.setSpeed(255); //Define maximum velocity
  motor3.run(BACKWARD); //rotate the motor anti-clockwise
  motor4.setSpeed(255); //Define maximum velocity
  motor4.run(BACKWARD); //rotate the motor anti-clockwise
  delay(700);
  motor1.run(RELEASE); //Stop the motor
  motor2.run(RELEASE); //Stop the motor
  motor3.run(RELEASE); //Stop the motor
  motor4.run(RELEASE); //Stop the motor
}
void left_car()
{
  myServo.write(180);
  delay(500);
  myServo.write(90);
  delay(500);
  motor1.setSpeed(255); //Define maximum velocity
  motor1.run(BACKWARD); //rotate the motor anti-clockwise
  motor2.setSpeed(255); //Define maximum velocity
  motor2.run(BACKWARD); //rotate the motor anti-clockwise
  motor3.setSpeed(255); //Define maximum velocity
  motor3.run(FORWARD);  //rotate the motor clockwise
  motor4.setSpeed(255); //Define maximum velocity
  motor4.run(FORWARD);  //rotate the motor clockwise
  delay(700);
  motor1.run(RELEASE); //Stop the motor
  motor2.run(RELEASE); //Stop the motor
  motor3.run(RELEASE); //Stop the motor
  motor4.run(RELEASE); //Stop the motor
}

void stop_car ()
{
  motor1.run(RELEASE); //Stop the motor
  motor2.run(RELEASE); //Stop the motor
  motor3.run(RELEASE); //Stop the motor
  motor4.run(RELEASE); //Stop the motor
}

Custom parts and enclosures

PCB FILE
gerber_bluetuuth_car_20190822140524_z983CMiXkH.zip

Schematics

CIRCUIT DIAGRAM FOR VOICE CONTROLLED BOAT
Bluetooth car circuit2 rrspd8k4no c38l0szsmg

Comments

Similar projects you might like

Voice Controlled Scooter Lights and Garage Door

Project tutorial by Sahil Parikh

  • 3,188 views
  • 0 comments
  • 15 respects

Voice Controlled K'nex Car

Project tutorial by Austin Wilson

  • 12,758 views
  • 4 comments
  • 54 respects

DIY Auto Voice Record and Playback

Project tutorial by Team gadgetprogrammers

  • 29,646 views
  • 7 comments
  • 27 respects

Voice Controlled Rover

Project tutorial by Team Brink.IO

  • 3,311 views
  • 1 comment
  • 16 respects

Voice Controlled Car

Project tutorial by Yug_Ajmera

  • 57,572 views
  • 13 comments
  • 39 respects

2WD Voice Controlled Robot with Arduino and BitVoicer Server

Project tutorial by Marcio Tamagushi

  • 18,914 views
  • 13 comments
  • 50 respects
Add projectSign up / Login