Project showcase
Big Track Rover "ENHANCED EDITION" Obstacle Avoidance Bot

Big Track Rover "ENHANCED EDITION" Obstacle Avoidance Bot © GPL3+

No longer fun for the kids, sat at the back of the toy bin, hopelessly dreaming of seeing the sunlight yet once more, the ROVER emerges...

  • 997 views
  • 1 comment
  • 3 respects

Components and supplies

Necessary tools and machines

Apps and online services

About this project

Aim

This project aims to do these following things: Be creative, cheap, and most importantly fun!

Intro

As a child I was always in awe at the Bigtrak toys of the 80's. The keypad that you had to use to program them and the design of what reminded me of a futuristic mining vehicle.

So it came about last year when I was Christmas shopping that I happened upon the Bigtrak Rover, at the time it was discounted to 7£ sterling or around 9 US dollars.

I had hoped it would be a hit with the kids, which it wasn't. especially when they realized they would have to give up their phone to use it...

And so it sat for nearly a year, hidden away in the depths, lost to the human eye...

THEN! I found it randomly as I was cleaning out a closet, defunct of its battery cover and batteries, it sat pleading for rescue...

The Build

In taking it apart I realized that it is a fairly well made toy (apart from the PCB). Durable body and seemingly robust ''tracks''. It operate on the principle of light generated from a smartphone via the Bigtrak Rover App. This light or is used to control the device.

I removed all the electronics while leaving the mechanical pieces intact, for possible future uses.

I decided to use an Arduino nano because of its small size and as I already had one available. You could also use an Arduino pro-mini, or other similar form factor micro controller. Perhaps even an STM32 breakout board...

I did solder together a breakout board for the Arduino nano and it involved a fair bit of soldering including dedicated pin traces for the servo control. If your new to soldering or prefer not to then the same can be accomplished using a half-size breadboard.

The motor controller I chose was the MX1616 2.5A Max current board, this was due to size, cost (US $0.55), and I already had one from a previous project.

The motors are also very tiny and make use of a gearbox, cleverly designed in my opinion... Although the wires can be tricky to solder.

The Bigtrak incorporates a battery holder as do most small battery powered toys, this holds 3 AA size 1.5 volt batteries. I decided to use this as a means of power for the entire system, although it does not create 5 volts or higher it seems to work fine and the arduino board seems to be tolerant of the ''raw'' voltage. Perhaps it's even a little under-powered.

Feedback & Updates

Please leave a comments, let me know what help you may need :)

I will be uploading the Arduino code and circuit schematic soon. In the mean time the wiring of the MX1616 motor driver is very similar to that of the popular L298.

In this example the pin-out is as follows:

HC-SR04 Connections:

Arduino Pin A1 to HC-SR04 ''Trig''

Arduino Pin A2 to HC-SR04 ''Echo''

HC-SR04 ''VCC'' and ''GND'' go to power and ground respectively

MX1616 Motor Driver Connections:

Arduino Pin D4 to INT2 RIGHT FORWARD ENABLE

Arduino Pin D5 to INT1 RIGHT REVERSE ENABLE

Arduino Pin D7 to INT3 LEFT FORWARD ENABLE

Arduino Pin D6 to INT4 LEFT REVERSE ENABLE

Code

Arduino Obstacle Avoidance CodeArduino
Download to the Arduino board to get started.
//Obstacle Avoidance Robot using an MX1616 motor driver and Arduino NANO
//September 2019
//Please Note Pin configuration and adjust as you need!

#include <Servo.h>          //Servo motor library. This is standard library
#include <NewPing.h>        //Ultrasonic sensor function library. You must install this library

//Motor Driver control pins
const int LeftMotorForward = 7;
const int LeftMotorBackward = 6;
const int RightMotorForward = 4;
const int RightMotorBackward = 5;

//HC-04 sensor pins
#define trig_pin A1 //analog input 1
#define echo_pin A2 //analog input 2

#define maximum_distance 200
boolean goesForward = false;
int distance = 100;

NewPing sonar(trig_pin, echo_pin, maximum_distance); //sensor function
Servo servo_motor; //Used to ''sweep'' the HC-04


void setup(){

  pinMode(RightMotorForward, OUTPUT);
  pinMode(LeftMotorForward, OUTPUT);
  pinMode(LeftMotorBackward, OUTPUT);
  pinMode(RightMotorBackward, OUTPUT);
  
  servo_motor.attach(2); //Attached on D2

  servo_motor.write(115);
  delay(2000);
  distance = readPing();
  delay(100);
  distance = readPing();
  delay(100);
  distance = readPing();
  delay(100);
  distance = readPing();
  delay(100);
}

void loop(){

  int distanceRight = 0;
  int distanceLeft = 0;
  delay(50);

  if (distance <= 30){
    moveStop();
    delay(300);
    moveBackward();
    delay(400);
    moveStop();
    delay(300);
    distanceRight = lookRight();
    delay(300);
    distanceLeft = lookLeft();
    delay(300);

    if (distance >= distanceLeft){
      turnRight();
      moveStop();
    }
    else{
      turnLeft();
      moveStop();
    }
  }
  else{
    moveForward(); 
  }
    distance = readPing();
}

int lookRight(){  
  servo_motor.write(50);
  delay(500);
  int distance = readPing();
  delay(100);
  servo_motor.write(115);
  return distance;
}

int lookLeft(){
  servo_motor.write(170);
  delay(500);
  int distance = readPing();
  delay(100);
  servo_motor.write(115);
  return distance;
  delay(100);
}

int readPing(){
  delay(70);
  int cm = sonar.ping_cm();
  if (cm==0){
    cm=250;
  }
  return cm;
}

void moveStop(){
  
  digitalWrite(RightMotorForward, LOW);
  digitalWrite(LeftMotorForward, LOW);
  digitalWrite(RightMotorBackward, LOW);
  digitalWrite(LeftMotorBackward, LOW);
}

void moveForward(){

  if(!goesForward){

    goesForward=true;
    
    digitalWrite(LeftMotorForward, HIGH);
    digitalWrite(RightMotorForward, HIGH);
  
    digitalWrite(LeftMotorBackward, LOW);
    digitalWrite(RightMotorBackward, LOW); 
  }
}

void moveBackward(){

  goesForward=false;

  digitalWrite(LeftMotorBackward, HIGH);
  digitalWrite(RightMotorBackward, HIGH);
  
  digitalWrite(LeftMotorForward, LOW);
  digitalWrite(RightMotorForward, LOW);
  
}

void turnRight(){

  digitalWrite(LeftMotorForward, HIGH);
  digitalWrite(RightMotorBackward, HIGH);
  
  digitalWrite(LeftMotorBackward, LOW);
  digitalWrite(RightMotorForward, LOW);
  
  delay(500);
  
  digitalWrite(LeftMotorForward, HIGH);
  digitalWrite(RightMotorForward, HIGH);
  
  digitalWrite(LeftMotorBackward, LOW);
  digitalWrite(RightMotorBackward, LOW);
 
  
  
}

void turnLeft(){

  digitalWrite(LeftMotorBackward, HIGH);
  digitalWrite(RightMotorForward, HIGH);
  
  digitalWrite(LeftMotorForward, LOW);
  digitalWrite(RightMotorBackward, LOW);

  delay(500);
  
  digitalWrite(LeftMotorForward, HIGH);
  digitalWrite(RightMotorForward, HIGH);
  
  digitalWrite(LeftMotorBackward, LOW);
  digitalWrite(RightMotorBackward, LOW);
}

 

Comments

Similar projects you might like

Trash Built BT Line Drawing Bot - My Bot

Project tutorial by jegatheesan

  • 603 views
  • 0 comments
  • 5 respects

Arduino Obstacle Avoidance Robot with Ultrasonic HC-SR04

Project showcase by Jorge Rancé

  • 20,175 views
  • 9 comments
  • 43 respects

Ground-Based Obstacle Avoiding Robot

Project showcase by Xavier Tan

  • 8,759 views
  • 2 comments
  • 29 respects

Obstacle Avoidance Bot Using IR Sensors

Project tutorial by Chandran N

  • 2,190 views
  • 0 comments
  • 10 respects

Project 1: 2WD Obstacle Avoiding Robot

Project showcase by HDA Robotics

  • 24,035 views
  • 11 comments
  • 32 respects

LEGO Wall-E with Arduino

Project tutorial by monsterbacke

  • 21,084 views
  • 14 comments
  • 96 respects
Add projectSign up / Login