RC Boat With HC-06 Bluetooth Module

About: I am an Electric Electronic Engineer student . I want to share some projects with you

I will show you how can you make a RC BOAT but it just for 25 meters distance! i use bluetooth module but if you want to use Nfr it would be healty for long distance.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: PARTS

Here is a list of parts that i used to make this project:

  • DC motor and propeller
  • L298 motor driver
  • Arduino UNO
  • HC-06 Bluteth module
  • 18v battery and voltage regulatör
  • Servo Motor
  • Jumper Wires

Step 2: SCHEMA

ı use a battery which output is 18v so ı use regulator for decrease the voltage !

Step 3: CODE

The code has explanations of code functions. You will easly understand it. If you have a problem , you can contact me.

#include
// include servo library

const int in1 = 10; // dc motor in pin const int in2 = 11; const int enA = 6; //motor speed

Servo rudder; //create servo name

void setup() { pinMode(in1, OUTPUT); //all motor pins are output pinMode(in2, OUTPUT); pinMode(enA, OUTPUT); rudder.attach(9); //servo attachment Serial.begin(9600); //For Serial communication }

void loop() { if(Serial.available()>0){ //if we communicate with hc 05 char way = Serial.read(); //get the input //Serial.write(way); //if you wanna learn which word you have got //Go forward if(way=='w'){ analogWrite(enA, 255); //set left the speed(0 to 255) digitalWrite(in1, LOW); digitalWrite(in2,HIGH); rudder.write(90); } //Go Backward else if(way=='s'){ analogWrite(enA, 255); digitalWrite(in1, HIGH); digitalWrite(in2, LOW); rudder.write(90); }

//Turn RIGHT else if(way=='a'){ analogWrite(enA, 255); digitalWrite(in1, LOW); digitalWrite(in2,HIGH); rudder.write(45); }

//Turn LEFT else if(way=='d'){ analogWrite(enA, 255); digitalWrite(in1, LOW); digitalWrite(in2,HIGH); rudder.write(135); }

//Stop the ship else if(way=='n'){ digitalWrite(in1, HIGH); //if we make HIGH every pin it will stop digitalWrite(in2, HIGH); //or you can do => analogWrite(enA,0); rudder.write(180); }

//PIR PIR else if(way=='k'){ digitalWrite(in1, HIGH); //if we make HIGH every pin it will stop digitalWrite(in2, HIGH); //or you can do => analogWrite(enA,0); int pos; for(pos = 60; pos <= 120 ; pos+=10){ rudder.write(pos); delay(15); } for(pos = 120; pos >= 60 ; pos-=10){ rudder.write(pos); delay(15); } }

//BACKWARD TURN LEFT else if(way=='l'){ digitalWrite(in1, HIGH); digitalWrite(in2, LOW); analogWrite(enA, 155); rudder.write(45); }

//BACKWARD TURN RIGHT else if(way=='m'){ digitalWrite(in1, HIGH); digitalWrite(in2, LOW); analogWrite(enA, 155); rudder.write(135);7 } else{ digitalWrite(in1, HIGH); //if we make HIGH every pin it will stop digitalWrite(in2, HIGH); //or you can do => analogWrite(enA,0); } } }

Step 4: OTHER PİCTURES

Be the First to Share

    Recommendations

    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest

    Discussions