Aws_Alkarmi
Published © GPL3+

RC Boat by Arduino

How to make A big remote controlled Boat. high speed. Build your own RC Car Better than the Market

AdvancedWork in progress4,504
RC Boat by Arduino

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Jumper wires (generic)
Jumper wires (generic)
×1
General Purpose Transistor NPN
General Purpose Transistor NPN
×2
Signal Relay, 5 VDC
Signal Relay, 5 VDC
×2
Geared DC Motor, 12 V
Geared DC Motor, 12 V
×2

Story

Read more

Code

RC Boat Code By Aws Alkarmi

Arduino
int ForwordSignal=A1;
int BackwordSignal=A4;
int LEDs=3;
int ForwordMotor=4;
int BackwordMotor=12;
int code1;
int cod2;
int FM=0;
int BM=0;
int state=0;
int testRelay=8;



void setup() {
 
      Serial.begin(9600);
      pinMode(ForwordSignal,INPUT);
      pinMode(BackwordSignal,INPUT);
      pinMode(ForwordMotor,OUTPUT);
      pinMode(BackwordMotor,OUTPUT);
      pinMode(LEDs,OUTPUT);
      pinMode(testRelay,OUTPUT);


}

void loop() {
     FM=analogRead(ForwordSignal);
     BM=analogRead(BackwordSignal);

     Serial.println("B");
     Serial.println("----");
     Serial.println("F");

     if(FM>200) //  3.3volts ---675 bit
     {
      digitalWrite(ForwordMotor,HIGH);// LOW to start the relay 
      digitalWrite(BackwordMotor,LOW); // HIGH to stop the relay 
      digitalWrite(testRelay,LOW);
      
      state=1;
                   Serial.print("FM is");
                   Serial.println(FM);

     }else if(BM>200)
      {
        digitalWrite(BackwordMotor,HIGH);//very good
        digitalWrite(ForwordMotor,LOW);
        ; // HIGH to stop the relay 

                Serial.print("BM is");
                Serial.println(BM);

        state=2;
      }else{digitalWrite(ForwordMotor,HIGH);
        digitalWrite(BackwordMotor,HIGH);
        digitalWrite(testRelay,HIGH); // HIGH to stop the relay 

      };
     

Credits

Aws_Alkarmi
5 projects • 3 followers
Contact

Comments

Please log in or sign up to comment.