Project tutorial
The Ultimate Offroad RC Rover

The Ultimate Offroad RC Rover © CC BY

A great starter project for hobbyists - In this tutorial I am showing how to make an all terrain remote controlled rover bot.

  • 2,876 views
  • 0 comments
  • 9 respects

Components and supplies

Necessary tools and machines

Screwdriver
Wire cutter
09507 01
Soldering iron (generic)
Drilling machine(not important)

Apps and online services

About this project

Let's make an all terrain remote controlled rover bot. This is a great starter project for hobbyists. In this tutorial, I am showing how to make an all terrain robot using Arduino. It has two modes of controlling, using smartphone controlling and the other, using our own designed RF remote. It is more easy and flexible to use, and also low cost. The total cost for making this robot is less than 60$.

Areas or fields of it's application (with the updated version 2.0)

  • Disaster management
  • Spying agent for military purpose
  • Rainwater drainage system cleaning robot
  • Repairing of pipelines that humans can't access
  • In nuclear plant disasters

Controlling methods.

The RF controller "Click here to visit the tutorial of remote".

The Bluetooth controlling.

In this option we can use our smartphone for controlling the robot.

Watch this video to see the robot in action. (Using wireless remote)

Watch this video to see the working of V2.0 of this Robot. (Using smartphone)

It's tutorial will upload soon! Stay connected!

Materials & tools required.

Electronic parts

Mechanical parts

  • Switch
  • Aluminium sheet 2 mm (from local store)

Tools

  • Screwdriver
  • Wire cutter
  • Cutter tool
  • Soldering iron
  • Drilling machine (not important)

Making the chassis of the rover.

Let's make the chassis of this rover. I am using two '3mm thick' & 20x15 cm aluminium sheets to make the chassis.

First, drill the holes for placing the 'L' shaped clamp for connecting the motors. Here I used two 200 rpm metal gear motor (for the back side of the rover) and two 200 rpm plastic gear motor (in the front side). Then connect the 4 motors and take out wires from the motors.

Circuit diagram.

Wiring instruction' NRF2401' >> 'ARDUINO'.

  • VCC >> VCC
  • GND >> GND
  • MISO >> PIN 12
  • MOSI >> PIN 11
  • SCN >> PIN10
  • SCK >> PIN 13
  • CE >> PIN 9
  • IRQ (not in use)

If you are using the Bluetooth controlling option then, Wiring instruction of HC-05 Bluetooth module >> Arduino

  • TX of HC-05 >> RX of Arduino
  • RX of HC-05 >> TX of Arduino
  • VCC of HC-05 >> 5volt of Arduino
  • GND of HC-05 >> GND of Arduino

Read about the motor controller in the next step.

Connecting all parts together and testing.

Then connect all the parts together as shown in the circuit diagram, before attaching this items to the chassis make sure everything is working fine. You can find the codes needed for the rover in the next step of this tutorial.

The motor controller.

The motor driver used here was purchased from the robotkits.co.in. We can control it either by analog input or by PWM input, which is a low cost and 6V - 18V compatible 20A capable Dual DC motor driver. It is ideal for this application where two motors (I am using 4 motors, by the parallel connection of two motors on the same side) are required for up to 20 Amperes of current during startup and during normal operations. Read more about this motor driver in this PDF here. The battery instructions is in the next step.

Final step adding a switch and finishing.

In this last step we are connecting the battery and an on/off switch for the rover. After connecting the switch and battery as shown in the figure. Close the upper side using another 20x15 cm size aluminium sheet and at last connect the wheels also. Now we have finished the making of the rover bot.

Battery used.

In this robot I use a LiPo 11.1 volt 2800mah 30 C battery. For choosing your own battery read this article. This is my first LiPo battery therefore I don't know much about it.

Updates in the rover.

I have updated this robot later by adding a 3 DOF robotic arm and an ultrasonic sensor. To see it's working watch video below. And the tutorial of that will be posted soon in my blog.

Watch this video to see the working of V2.0 of this rover with robotic arm (control using smartphone).

Arduino codes.

Here you can download the codes. The first code is for controlling the robot using the custom made remote. For the code used in the transmitter (remote) visit the tutorial of making remote - Click here to visit that tutorial. In this Arduino code there is a library called 'print.h'. For using that library in the Arduino code you need to add the print.h file and Arduino code in a same folder that I have provided here. The second code is for Bluetooth controlling option, using this application - Click here to download the application.

RC_rover_code_for_RF_function.ino

printf.h

RC_rover_code_for_bluetooth_controling.ino

Code

RC_rover_code_for_RF_function.inoC/C++
This code is for controlling the robot using the custom made remote. For the code used in the transmitter(Remote) visit the tutorial of making remote -Click here to visit that tutorial. In this arduino code there is a library called print.h
/*
 Written by: Mujahed Altahle
 
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ 
or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.

 */
/* A simple Project for Remote Controlling with nRF24L01+ radios. 
 We have 2 nodes, the transmitter (this one) and the receiver which is attached to the Car.
 The idea is to transmit  2 parameters , one is Direction (Backward, or Forward with the speed) the other is the Steering (Left, or Right with the degree of rotation).
 The nRF24L01 transmit values in type of "uint8_t" with maximum of 256 for each packet, so the values of direction is divided by (10) at the Tx side,
 then it is multiplied by 10 again at the Rx side.
 The Rx rules is to output the received parameters to port 3 and 6 where the Servo and the ESC are are attached
 a condition is required to prevent the controller from transmitting values that is not useful (like 1480-1530 for ESC and 88-92 for Servo) to save more power as much as we can
 */
 
#include <Servo.h> 
#include <SPI.h>
#include "nRF24L01.h"
#include "RF24.h"
#include "printf.h"
//
// Hardware configuration
//

// Set up nRF24L01 radio on SPI bus plus pins 9 & 10
RF24 radio(9,10);
int stop1=2;
int stop2=4;
int back1=5;
int back2=7;

int pwm1=6;
int pwm2=3;



// Single radio pipe address for the 2 nodes to communicate.
const uint64_t pipe = 0xE8E8F0F0E1LL;

//
// Payload
//

uint8_t received_data[2];
uint8_t num_received_data =sizeof(received_data);

//
// Setup
//

void setup(void)
{
  delay(2000); //wait until the esc starts in case of Arduino got power first
  pinMode(6, OUTPUT);
  pinMode(3, OUTPUT);
  
  pinMode(stop1, OUTPUT); 
  pinMode(stop2, OUTPUT); 
  pinMode(back1, OUTPUT); 
  pinMode(back2, OUTPUT); 


  //
  // Print preamble
  //

  Serial.begin(57600);
  printf_begin();

  //
  // Setup and configure rf radio
  //

  radio.begin(); //Begin operation of the chip.
  // This simple sketch opens a single pipes for these two nodes to communicate
  // back and forth.  One listens on it, the other talks to it.
  radio.openReadingPipe(1,pipe);
  radio.startListening();
  //
  // Dump the configuration of the rf unit for debugging
  //
  radio.printDetails(); 
}


void Stop(void)
{
  analogWrite(pwm1, 0);
  analogWrite(pwm2, 0);
}
void Forward1(void)
{
  analogWrite(pwm1, 255);
  digitalWrite(back1, LOW);
  digitalWrite(back2, LOW); 
}
void Forward2(void){
  analogWrite(pwm2, 255);
  digitalWrite(back1, LOW);
  digitalWrite(back2, LOW); 
}
void Backward1(void){
  analogWrite(pwm1, 255);
  digitalWrite(back1, HIGH);

}
void Backward2(void){
  analogWrite(pwm2, 255);

  digitalWrite(back2, HIGH); 
}


void loop(void)
{
  // if there is data ready
  if ( radio.available() )
  {
    bool done = false;
    int value1;
    int value2;
    while (!done)
    {
      // Fetch the payload, and see if this was the last one.
      done = radio.read( received_data, num_received_data );
      value1=received_data[0]; //Multiplication by 10 because the ESC operates for vlues around 1500 and the nRF24L01 can transmit maximum of 255 per packet 
      value2=received_data[1]; //Multiplication by 10 because the ESC operates for vlues around 1500 and the nRF24L01 can transmit maximum of 255 per packet 
    //analogWrite(pwm2,value2);
    Serial.println("value2=");
    Serial.println(value2);
    Serial.println("value1=");
    Serial.println(value1);   
       if(value1<170 && value1>140 || value2>70 && value2<100){
       Stop();
       }
       if(value1>170 && value1!=0){
       Forward1();
       }
       if(value2<70 && value2!=0){
       Forward2();
       }
       if(value1<140 && value1!=0){
       Backward1();
       }
       if(value2>100 && value2!=0){
       Backward2();
       }

    }
  }
}
printf.hC/C++
This is the print.h library for above code. You need to add the print.h file and arduino code in a same folder that I have provided here.
/*
 Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
 version 2 as published by the Free Software Foundation.
 */
 
/**
 * @file printf.h
 *
 * Setup necessary to direct stdout to the Arduino Serial library, which
 * enables 'printf'
 */

#ifndef __PRINTF_H__
#define __PRINTF_H__

#ifdef ARDUINO

int serial_putc( char c, FILE * ) 
{
  Serial.write( c );

  return c;
} 

void printf_begin(void)
{
  fdevopen( &serial_putc, 0 );
}

#else
#error This example is only for use on Arduino.
#endif // ARDUINO

#endif // __PRINTF_H__
RC_rover_code_for_bluetooth_controling.inoC/C++
This code is for bluetooth controlling option, using this application.
#include <Servo.h> 
//Constants and variable
int stop1=2;
int stop2=4;
int back1=5;
int back2=7;

int pwm1=6;
int pwm2=3;

char dataIn = 'S';
char determinant;
char det;
int vel = 255; //Bluetooth Stuff


void setup() {
  Serial.begin(9600); // set up Serial library at 9600 bps

  pinMode(6, OUTPUT);
  pinMode(3, OUTPUT);
  
  pinMode(stop1, OUTPUT); 
  pinMode(stop2, OUTPUT); 
  pinMode(back1, OUTPUT); 
  pinMode(back2, OUTPUT); 
  
  //Initalization messages
  Serial.println("ArduinoBymyself - ROVERBot");
  Serial.println("     AF Motor test!");
 
}

void loop() {

  det = check(); //call check() subrotine to get the serial code
  
  //serial code analysis
  switch (det){
    case 'F': // F, move forward
  analogWrite(pwm1,vel);
  digitalWrite(back1, LOW);
  digitalWrite(back2, LOW); 

  analogWrite(pwm2, vel);
  digitalWrite(back1, LOW);
  digitalWrite(back2, LOW); 
    det = check();
    break;
   //------- 

    case 'B': // B, move back
  analogWrite(pwm1, vel);
  digitalWrite(back1, HIGH);
   
  analogWrite(pwm2, vel);
  digitalWrite(back2, HIGH); 
    det = check();
    break;
    
//-----    
    case 'L':// L, move wheels left
    analogWrite(pwm1,vel);
    digitalWrite(back1, LOW);
    analogWrite(pwm2, vel);
    digitalWrite(back2, HIGH); 
    det = check();
    break;
//----------
    
    case 'R': // R, move wheels right
    analogWrite(pwm2, vel);
    digitalWrite(back2, LOW); 
    analogWrite(pwm1, vel);
    digitalWrite(back1, HIGH); 
    det = check();
    break;
  //-----


   case 'I': // I, turn right forward
    analogWrite(pwm1,0);
    digitalWrite(back1, LOW);
    digitalWrite(back2, LOW); 

    analogWrite(pwm2, vel);
    digitalWrite(back1, LOW);
    digitalWrite(back2, LOW); 
    det = check();
    break;
    
    case 'J': // J, turn right back
  analogWrite(pwm1,vel);
  digitalWrite(back1, HIGH);

  analogWrite(pwm2,0);
  digitalWrite(back2, HIGH); 
    det = check();
    break;
    
    case 'G': // G, turn left forward
  analogWrite(pwm1,vel);
  digitalWrite(back1, LOW);
  digitalWrite(back2, LOW); 

  analogWrite(pwm2,0);
  digitalWrite(back1, LOW);
  digitalWrite(back2, LOW); 
    det = check();
    break;
    
    case 'H': // H, turn left back
  analogWrite(pwm1,0);
  digitalWrite(back1, HIGH);

  analogWrite(pwm2, vel);
  digitalWrite(back2, HIGH);
    det = check();
    break;


  case 'S': // R, move wheels right
    analogWrite(pwm1, 0);
    analogWrite(pwm2, 0);
    digitalWrite(back1, LOW);
    digitalWrite(back2, LOW); 
    det = check();
    break;
    
  }
}
    

//get bluetooth code received from serial port
int check(){
  if (Serial.available() > 0){// if there is valid data in the serial port
    dataIn = Serial.read();// stores data into a varialbe

    //check the code
    if (dataIn == 'F'){//Forward
      determinant = 'F';
    }
    else if (dataIn == 'B'){//Backward
      determinant = 'B';
    }
    else if (dataIn == 'L'){//Left
      determinant = 'L';
    }
    else if (dataIn == 'R'){//Right
      determinant = 'R';
    }
    else if (dataIn == 'I'){//Froward Right
      determinant = 'I';
    }
    else if (dataIn == 'J'){//Backward Right
      determinant = 'J';
    }
    else if (dataIn == 'G'){//Forward Left
      determinant = 'G';
    }    
    else if (dataIn == 'H'){//Backward Left
      determinant = 'H';
    }
    else if (dataIn == 'S'){//Stop
      determinant = 'S';
    }
    else if (dataIn == '0'){//Speed 0
      vel = 0;
    }
    else if (dataIn == '1'){//Speed 25
      vel = 25;
    }
    else if (dataIn == '2'){//Speed 50
      vel = 50;
    }
    else if (dataIn == '3'){//Speed 75
      vel = 75;
    }
    else if (dataIn == '4'){//Speed 100
      vel = 100;
    }
    else if (dataIn == '5'){//Speed 125
      vel = 125;
    }
    else if (dataIn == '6'){//Speed 150
      vel = 150;
    }
    else if (dataIn == '7'){//Speed 175
      vel = 175;
    }
    else if (dataIn == '8'){//Speed 200
      vel = 200;
    }
    else if (dataIn == '9'){//Speed 225
      vel = 225;
    }
    else if (dataIn == 'A'){//Speed 255
      vel = 255;
    }
    else if (dataIn == 'X'){//Extra On
      determinant = 'X';
    }
    }
  return determinant;
}

Schematics

Circuit diagram
Ultimate offroad rc rover robot circuit diagram fyb5wz1ft6

Comments

Similar projects you might like

RC Rover Controlled by Gest

Project showcase by Salim Khazem

  • 993 views
  • 1 comment
  • 12 respects

Arduino 4WD RC Car

Project tutorial by Andriy Baranov

  • 13,136 views
  • 3 comments
  • 43 respects

Turn your RC Car to Bluetooth RC car

Project tutorial by Prajjwal Nag

  • 11,968 views
  • 1 comment
  • 11 respects

RC Servo Planter

Project tutorial by 4D Makers

  • 1,016 views
  • 1 comment
  • 2 respects

Simple multi-mode 4wd Rover JR-001

Project tutorial by Scott Beasley

  • 14,492 views
  • 3 comments
  • 38 respects

Android Arduino RC Car

Project tutorial by RAFI RASHEED T C

  • 15,342 views
  • 2 comments
  • 38 respects
Add projectSign up / Login