Halil TEKE
Published

Remote Control Olive Collector Robot-Arduino/Bluetooth/Car

Building a remote-controlled robot for harvesting olives

BeginnerShowcase (no instructions)Over 1 day603
Remote Control Olive Collector Robot-Arduino/Bluetooth/Car

Things used in this project

Hardware components

Arduino Uno
×1
Motor Driver
×1
Bluetooth Module
×1
11.1 V 3S Lipo Battery 450mAh 25 C
×1
4 WD Robot kit
×1

Software apps and online services

Arduino IDE
Arduino IDE
Remote Contol RC Car

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
Hot glue gun (generic)
Hot glue gun (generic)
Multitool, Screwdriver
Multitool, Screwdriver
Tape, Electrical
Tape, Electrical

Story

Read more

Custom parts and enclosures

Photo-1

Photo-2

Schematics

Circuit Diagram

Code

CAR CODE

Arduino
  const int motorA1  = 5;  // L298N'in IN3 Girişi
  const int motorA2  = 6;  // L298N'in IN1 Girişi
  const int motorB1  = 10; // L298N'in IN2 Girişi
  const int motorB2  = 9;  // L298N'in IN4 Girişi




  int i=0; 
  int j=0; 
  int state; 
  int vSpeed=255;     




void setup() {
    pinMode(motorA1, OUTPUT);
    pinMode(motorA2, OUTPUT);
    pinMode(motorB1, OUTPUT);
    pinMode(motorB2, OUTPUT);    
    Serial.begin(9600);
}
 
void loop() {
    if(Serial.available() > 0){     
      state = Serial.read();   
    }
  
  
    if (state == '0'){
      vSpeed=0;}
    else if (state == '1'){
      vSpeed=100;}
    else if (state == '2'){
      vSpeed=180;}
    else if (state == '3'){
      vSpeed=200;}
    else if (state == '4'){
      vSpeed=255;}
     

    if (state == 'F') {
      analogWrite(motorA1, vSpeed); analogWrite(motorA2, 0);
        analogWrite(motorB1, vSpeed);      analogWrite(motorB2, 0); 
    }

    else if (state == 'G') {
      analogWrite(motorA1,vSpeed ); analogWrite(motorA2, 0);  
        analogWrite(motorB1, 100);    analogWrite(motorB2, 0); 
    }

    else if (state == 'I') {
        analogWrite(motorA1, 100); analogWrite(motorA2, 0); 
        analogWrite(motorB1, vSpeed);      analogWrite(motorB2, 0); 
    }
  



    else if (state == 'B') {
      analogWrite(motorA1, 0);   analogWrite(motorA2, vSpeed); 
        analogWrite(motorB1, 0);   analogWrite(motorB2, vSpeed); 
    }
 

    else if (state == 'H') {
      analogWrite(motorA1, 0);   analogWrite(motorA2, 100); 
        analogWrite(motorB1, 0); analogWrite(motorB2, vSpeed); 
    }

    else if (state == 'J') {
      analogWrite(motorA1, 0);   analogWrite(motorA2, vSpeed); 
        analogWrite(motorB1, 0);   analogWrite(motorB2, 100); 
    }

    else if (state == 'L') {
      analogWrite(motorA1, vSpeed);   analogWrite(motorA2, 150); 
        analogWrite(motorB1, 0); analogWrite(motorB2, 0); 
    }

    else if (state == 'R') {
      analogWrite(motorA1, 0);   analogWrite(motorA2, 0); 
        analogWrite(motorB1, vSpeed);   analogWrite(motorB2, 150);     
    }
  

    else if (state == 'S'){
        analogWrite(motorA1, 0);  analogWrite(motorA2, 0); 
        analogWrite(motorB1, 0);  analogWrite(motorB2, 0);
    }  
}

Credits

Halil TEKE

Halil TEKE

1 project • 1 follower

Comments