Ball Collecting Robot – Arduino Robots

Ball collecting robot is a mobile controlled wheeled robot which can be used to collect balls in a playing area. This is a prototype project which will be useful to learn about mobile robots. This concept can be extended to build fully functional ball collecting robot.

Component Required

  1. Arduino Nano
  2. Bluetooth
  3. 12V DC Motors (2)
  4. Dc Motor Driver
  5. 12V battery
  6. Servo Motor
  7. Cables & Wires
  8. Robot Wheels
  9. Robot Gripper

Circuit Diagram

Steps

1 :Connect the DC Motors with DC Motor Drive

2: Connect the DC motor drive OUTPUT Pins with Arduino Nano Pins

   Drive Pins                Arduino Nano

      1A                        D3
      1B                        D4
      2A                        D5
      2B                        D6

3: Connect the Servo Motor with Arduino Nano

      wires                  Pins

       Red                    5V
       Black                  GND
       Yellow                 D10

4 : Connect the Bluetooth with Arduino Nano

  Bluetooth               Arduino Nano

   5V                          5V
   GND                         GND
   RX                          TX
   TX                          RX

5 : Check the Connection once

6 : Upload the arduino program

7 : Install the mobile application in the mobile device.

8: Test the robot with mobile application

Arduino Program

#include <AFMotor.h>
#include <Servo.h> 
// Check the motor driver datasheet for motor pin connections
AF_DCMotor rm(1, MOTOR12_64KHZ);  // Right motor
AF_DCMotor lm(4, MOTOR34_64KHZ);  // Left motor
Servo grServo; // Servo motor for gripper
byte incomingByte ;

void setup() 
{ 
   Serial.begin(9600);
  // Set motors speed
   rm.setSpeed(200);  
   lm.setSpeed(200);
   rm.run(RELEASE);
   lm.run(RELEASE);
	grServo.attach(10); // Attach gripper
} 
void loop()
{
   if (Serial.available() > 0) {
    incomingByte = Serial.read(); // Read the input character from bluetooth serial input buffer
  
    if (incomingByte == 'A') 
    {
         grServo.write(120);      // Gripper Open Position
    }
    else if (incomingByte =='B') 
    {
        grServo.write(180);      // Gripper Close Position
    }
    else if (incomingByte == 'C') 
    {
        rm.run(FORWARD);        // Run both motors in forward direction
        lm.run(FORWARD);
    }
    else if (incomingByte == 'D') 
    {
        rm.run(BACKWARD);       // Run both motors in backward direction
        lm.run(BACKWARD);
    }
    else if (incomingByte == 'E') 
    {
        rm.run(BACKWARD);       // Turning Left. Run right motor in backward direction and left motor in forward direction
        lm.run(FORWARD);
    }
    else if (incomingByte == 'G') 
    {
        rm.run(FORWARD);        // Turning Right. Run right motor in forward direction and left motor in backward direction
        lm.run(BACKWARD);
    }
    else if (incomingByte == 'F') 
    {
        rm.run(RELEASE);        // Stop both motors
        lm.run(RELEASE);
    }
   }
   delay(20);
}

Get the motor driver library from https://github.com/adafruit/Adafruit-Motor-Shield-library

Get the code from github : https://github.com/robolabz/ballcollectingrobot

For robot base and gripper design files and mobile application, contact “info at robolabz.com”

AutoPot – Automatic Water Dispensing Pot

This project is for making an automatic water dispensing pot. Arduino Uno, Ultrasonic sensor and Water pump are the major components used in this project. Two batteries are connected for Arduino and Water pump power source.

Component Requirements:

  1. Arduino Uno
  2. Ultrasonic Sensor
  3. 12V Water Motor
  4. DC Motor Driver Circuit
  5. 12V battery
  6. 9V battery
  7. Cables & Wires

Circuit Diagram:

AutoPot- Circuit Diagram

Steps

1 : Connect the Ultrasonic Sensor with Arduino Uno

   Ultrasonic Sensor           Arduino Uno
   5V                          5V
   GND                         GND
   Echo                       pin 6
   Trig                       pin 7

2 : Connect the water pump with 12V DC motor drive

3 : Connect the DC motor drive OUTPUT pin with Arduino Uno pin 3

4 : Check the Connection

5 : Upload the program

/*
 * AutoPot - Automatic Water Dispensing Pot
 *
 * http://robolabz.com/blog/?p=4
 *
 * by Robolabz (www.robolabz.com)
 */

const int motorPin = 3;  // Water Motor PIN
const int trigPin = 7; // Ultrasonic Trigger PIN 
const int echoPin = 6; // Ultrasonic Echo PIN

float duration, distance;

void setup() {
  
  pinMode(motorPin, OUTPUT);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  
}

void loop() {
  
  ReadDistance();
  
  if(distance<10){ // Check object is closer
    
    digitalWrite(motorPin,HIGH);
    
    for(int i=0;i<100;i++)
    {
      ReadDistance();
      if (distance>10) { // If object is away,stop the motor
        digitalWrite(motorPin,LOW);
        break;
      }
      delay(40);
    }
    
  }
  
  digitalWrite(motorPin,LOW);

  
  delay(100);
}

/* Read distance to the object */ 
void ReadDistance()
{
  digitalWrite(trigPin, LOW);
  delayMicroseconds(2);
  digitalWrite(trigPin, HIGH);
  delayMicroseconds(10);
  digitalWrite(trigPin, LOW);

  duration = pulseIn(echoPin, HIGH);
  distance = (duration*.0343)/2;
}

Get the code from github : https://github.com/robolabz/autopot

This project is for learning purpose only and not a ready to use product.

www.robolabz.com