Project in progress

# Probability | Autonomous Rover © GPL3+

Meet the little black rover that can do many things in your house without bumping into a single thing!

• 8,218 views
• 50 respects

## Components and supplies

 Arduino UNO & Genuino UNO
×1
×2
 Jumper wires (generic)
×1
 DC motor (generic)
×6
 SparkFun Dual H-Bridge motor drivers L298
×1
 Ultrasonic Sensor - HC-SR04 (Generic)
×1
 Arduino Nano R3
×1
 LED (generic)
×1
 Buzzer
×1
 TTP223B Touch Sensor
×1

## Necessary tools and machines

 Soldering iron (generic)
 Hot glue gun (generic)

## Apps and online services

 Arduino IDE

Hello everyone!

My goal in this project is to make a autonomous rover that is capable of doing many activities around your house.

The idea came from me learning about Mars rovers like Curiosity and how they operate. And I decided that it would be fun and helpful to make a little rover of my own. I started this project to make a robot that could not crash into obstacles while I was away. It started back in 2017 and now our goal has shifted to more of making a autonomous rover.

``````Visit my Youtube channel!!!!!!
UniverseRobotics
``````

First Part : Chassis and Motors

Chassis

The chassis of the Probability rover is made from the Bogie Runt Rover from Servo City and I followed a tutorial to put in together. The set comes with the complete set of motors and chassis but doesn't come with the electronics.

Motors

The rover uses 6 DC motors to power the wheels. All of the motors have the wires that come up to the top through a hole in the chassis. They then connect to a L298N motor driver. Because of these powerful motors Probability can reach speeds up to 4 mph!

Second Part: Electronics

Motor Driver

All of the six motors are powered by a L298N dual bridge motor driver chip. All of the motor wires are connected to the right and left sides of the chip. To give power to the arduino it is connected to the 5V and GND on the chip. Then the 5V goes to 5V and the GND goes to GND. For all of the motors to work the L298N motor drive chip needs to be connected to the arduino using the ENA, IN1, IN2, IN3, IN4, and ENB. These wires are then connected to any six of the digital pins on the arduino.

Ultra Long distance sensor

The HC-SR04 or (Ultra long distance sensor) is the electronic that senses objects in front of it and avoids the object. It works by making a high pitched sound out of the echo pin and receiving the sound through the trig pin. I mounted the sensor by cutting a paperclip in half then getting it red how and burning a small hole in the ABS plastic. Then I put the sensor on and curled the paperclips around the small screw holes in it. The VCC pin connects to the arduino's 5V pin and the GND pin connects to GND on the arduino. The Trig and Echo pins then connect to any of the digital pins in the arduino. Make sure when you right the code to include what pins you are using for the Trig and Echo pins.

Servo

The servo on Probability is made for turning its head to use the ultra long distance sensor. The red wire goes to 5v pin on the Arduino and the black or brown wire goes to the GND pin on the Arduino. The other wire goes to any digital I/O pin. If you are going to use the servo don’t put the paper clips into the chassis. If you don’t understand read the paragraph that shows the ultra long distance sensor. When you right the code for it always remember to put in the right digital pin that you used.

Buzzer

The buzzer is on Probability so it can make sound. If you don’t want your rover to make sound dont put the buzzer on. On the top of the buzzer one side have a plus symbol. The wire underneath it is the wire that goes to any digital pin on the Arduino. The other wire goes to the GND pin on the Arduino. Remember to declare what digital pin you are using. To make it play sound you have to write a piece of code that says the tone. In the Probability soft 1.9 it shows you the tone code you need to have.

## Code

##### ProbablitySoft.19.inoC/C++
New code will be uploaded each week with bug fixes and new features
```//RocketryUniverse 2018

// connect motor controller pins to Arduino digital pins
// motor one
int enA = 10;
int in1 = 9;
int in2 = 8;
// motor two
int enB = 5;
int in3 = 7;
int in4 = 6;

#include <Servo.h>

#define TRIG_PIN 13
#define ECHO_PIN 12
#define MAX_DISTANCE 200
#define ctsPin 11
Servo servo;

// defines pins numbers
const int trigPin = 13;
const int echoPin = 12;

// defines variables
long duration;
int distance;

void setup() {
pinMode(2, OUTPUT);
analogWrite(enA, 90);
analogWrite(enB, 90);
// set all the motor control pins to outputs
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
Serial.begin(9600); // Starts the serial communication
pinMode(enA, OUTPUT);
pinMode(enB, OUTPUT);
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
pinMode(in3, OUTPUT);
pinMode(in4, OUTPUT);
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
digitalWrite(in3, HIGH);
digitalWrite(in4, LOW);
delay(1200);
}

void loop() {

if(ctsValue==HIGH) {
digitalWrite(in1, LOW);
digitalWrite(in2, HIGH);
digitalWrite(in3, LOW);
digitalWrite(in4, HIGH);
delay(800);
//forward
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
digitalWrite(in3, HIGH);
digitalWrite(in4, LOW);
delay(800);
digitalWrite(in1, HIGH);//Turn Back
digitalWrite(in2, LOW);
digitalWrite(in3, LOW);
digitalWrite(in4, HIGH);
delay(800);
digitalWrite(in1, LOW);//Turn Back
digitalWrite(in2, HIGH);
digitalWrite(in3, HIGH);
digitalWrite(in4, LOW);
delay(800);
tone(2, 250); //A
delay(15);
tone(2, 280); //A
delay(15);
tone(2, 310); //A
delay(15);
tone(2, 340); //A
delay(15);
tone(2, 380); //A
delay(15);
tone(2, 420); //A
delay(15);
tone(2, 460); //A
delay(15);
tone(2, 500); //A
delay(75);

tone(2, 420); //A
delay(100);
tone(2, 380); //A
delay(90);
tone(2, 340); //A
delay(80);
tone(2, 300); //A
delay(70);
tone(2, 260); //A
delay(60);

tone(2, 240); //A
delay(60);
tone(2, 220); //A
delay(60);

tone(2, 180, 100); //A
}
while(ctsValue==LOW) {
//forward
digitalWrite(in1, LOW);
digitalWrite(in2, HIGH);
digitalWrite(in3, LOW);
digitalWrite(in4, HIGH);

// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(8);

// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);

digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);

// Calculating the distance
distance= duration*0.034/2;

// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance);

if (distance < 27.5){

digitalWrite(in1, LOW);//Motor off for 2 sec
digitalWrite(in2, LOW);
digitalWrite(in3, LOW);
digitalWrite(in4, LOW);
delay(800);
tone(2, 250); //A
delay(15);
tone(2, 280); //A
delay(15);
tone(2, 310); //A
delay(15);
tone(2, 340); //A
delay(15);
tone(2, 380); //A
delay(15);
tone(2, 420); //A
delay(15);
tone(2, 460); //A
delay(15);
tone(2, 500); //A
delay(75);

tone(2, 420); //A
delay(100);
tone(2, 380); //A
delay(90);
tone(2, 340); //A
delay(80);
tone(2, 300); //A
delay(70);
tone(2, 260); //A
delay(60);

tone(2, 240); //A
delay(60);
tone(2, 220); //A
delay(60);

tone(2, 180, 100); //A
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
digitalWrite(in3, HIGH);
digitalWrite(in4, LOW);
delay(400);
digitalWrite(in1, HIGH);//Turn Back
digitalWrite(in2, LOW);
digitalWrite(in3, LOW);
digitalWrite(in4, HIGH);
delay(800);

digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);
// Calculating the distance
distance= duration*0.034/2;
// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance);

while(distance < 60){
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);
// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);
// Calculating the distance
distance= duration*0.034/2;
// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance);
}
if(ctsValue==HIGH) {
//forward
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
digitalWrite(in3, HIGH);
digitalWrite(in4, LOW);
}

}

}
}

```

## Schematics

It didn't work with UNO but mine does

• 1 project
• 8 followers

October 10, 2018

#### Members who respect this project

and 42 others

See similar projects
you might like

#### Arduino101 BLE Autonomous Rover

Project tutorial by 4 developers

• 14,625 views
• 32 respects

#### Little Rover

Project tutorial by Jeremie

• 3,862 views
• 16 respects

#### Autonomous Yard Scooping Entity

Project in progress by Mitomon

• 2,808 views
• 17 respects

#### RC Rover Controlled by Gest

Project showcase by Salim Khazem

• 993 views
• 1 comment
• 12 respects

#### M1 Rover

Project tutorial by AhmedAzouz

• 6,232 views