Pololu Zumo Robot

I recently ordered a Zumo robot shield manufactured by Pololu and found it to be a great little robot.

It comes preassembled and has various integrated sensors and actuators, including a 3-axis accelerometer, a 3-axis magnetometer, a Buzzer, a motor driver, an IR reflective sensor array, amongst others.

It comes with 2 75:1 HP micro metal gear motors, so it has a fair amount of power for such a small robot. The robot is within the 10cm x 10cm size limit of most robot sumo competitions, and with its very low centre of gravity combined with its speed and power it would be a serious competitor.

sideFront

An Arduino Uno R3 acts as the robots’ brain and simply slots onto the top of the robot, exactly like any other shield. All programs are then loaded onto the Arduino Uno as per normal and Pololu provides various example programs, including line following, maze solving and robot sumo programs.

  

The robot has an expansion area through which some pins are exposed that can be used to integrate some additional sensors and actuators.

I am looking forward to customising this robot and seeing how much more I can expand it.

I will write more about what I am doing with this robot in a future post and I will also be posting a video of the robot in action on my Youtube Channel in the near future.

Pololu Zumo Robot

Roaming Robot

Robot4

Today we will take a detailed look at my Roaming Robot.

Part List:

  • Sparkfun Magician Chassis (this includes 2 DC motors)
  • 1 x Capacitors 100uF
  • 4 x Resistors 220 Ohm
  • 1 x Micro Servo
  • Seeed Ultrasonic Sensor
  • Sharp IR Sensor
  • 2 x Long Arm Trigger Switches
  • 1 x LED (ultra bright white)
  • 1 x Photo-resistor
  • 1 x Arduino Uno R3 
  • 1 x Pololu Dual MC33926 Motor Driver Shield

Power supply:

  • 1 x 9V Battery (used to power the 2 DC motors through the motor shield)
  • 4 x AA Batteries in a battery holder (used to power Arduino and PCB\Breadboard)

The Pololu Dual MC33926 Motor Driver Shield plugs into the Arduino female headers and all connectors shown in below diagrams actually plug into the Motor shield and not directly into the Arduino as shown.

Arduino  ArduinoArduino

The first diagram shows the wiring for the LED, photo-resistor, trigger switches, and the servo:

robot part 1_bb

The two switches shown are actually the 2 long arm trigger switches.

switch

The circuit shown above is very straightforward. However note the capacitor across the servo power terminals. This is to prevent a voltage drop in the circuit caused by the servo starting to move, which draws more current to start moving than when it is already moving.

The below diagram shows how the Seeed Ultrasonic and Sharp IR sensors are wired:

robot part 2_bb

So the Arduino is wired as follows (through the motor driver female headers):

Analog Pins:

  • A0 – this pin is used by the MC33926 Motor shield
  • A1 – this pin is used by the MC33926 Motor shield
  • A2 – Servo 
  • A3
  • A4 – IR Sensor
  • A5 – Photo-resistor

Digital Pins:

  • 0
  • 1
  • 2
  • 3 – LED
  • 4 – this pin is used by the MC33926 Motor shield
  • 5 – Ultrasonic Sensor
  • 6 – Right Trigger Switch
  • 7 – this pin is used by the MC33926 Motor shield
  • 8 – this pin is used by the MC33926 Motor shield
  • 9 – this pin is used by the MC33926 Motor shield
  • 10 – this pin is used by the MC33926 Motor shield
  • 11 – Left Trigger Switch
  • 12 – this pin is used by the MC33926 Motor shield
  • 13

The Arduino VDD (5V) and GND pins are used to power the PCB\Breadboard.

robot4 robot1robot2

The Servo acts as the robots’ neck, it can turn the Ultrasonic Sensor in various directions. The Ultrasonic Sensor is used to detect obstructions, which the robot will then avoid, for obstructions too low for the Ultrasonic Sensor to detect the trigger switches will be pressed and the object can then be avoided. The Photo-resistor is used to detect light level and if it is deemed too dark the LED will turn on. The IR sensor is used to detect drops, so that the robot does not fall down a vertical drop, such as a step.

The two DC motors of the Magician Chassis are connected to the Motor shield, the left motor to the two most left screw terminals on the shield and the right motor to the two most right screw terminals on the shield. The 2 middle screw terminals on the shield are used to power the motors; the 9V battery should be connected to them. (Just note that if one or both of the robots’ motors move in the opposite direction than expected, this can be rectified by switching the 2 motor wires around between the screw terminals they are connected to on the motor shield.)

Here is the code used with the Robot (it is written in C and must be deployed on the Arduino):

#include "DualMC33926MotorShield.h"
#include "Servo.h"

#define IR_PIN A4
#define SERVO_PIN A2
#define PING_PIN 5
#define BUMPER_LEFT_PIN 11
#define BUMPER_RIGHT_PIN 6
#define LDR_PIN A5
#define LED_PIN 3
#define IR_DROP 450 //Distance considered a potential drop
#define MIN_LIGHT 300 //Level of light to turn on LED for light

DualMC33926MotorShield md;
const int M1Speed = 300;
const int M2Speed = 300;
int IRDist = 0;
int bpLeft = 0;
int bpRight = 0;
int LDRValue = 0;
const int dangerThresh = 12;// (in cm) used for obstacle avoidance
int leftDistance, rightDistance; //distances on either side
Servo panMotor; //'neck' servo
long duration; //time it takes to receive PING signal

void setup()
{
pinMode(BUMPER_LEFT_PIN,INPUT);
pinMode(BUMPER_RIGHT_PIN,INPUT);
pinMode(LED_PIN, OUTPUT);
}

void moveStop()
{
md.init();
md.setSpeeds(0,0);
}

void moveForward()
{
md.init();
moveStop();
md.setSpeeds(M1Speed,M2Speed);
delay(250);
}

void turnLeft()
{
md.init();
moveStop();
md.setSpeeds(M1Speed,-M2Speed);
delay(250);
}

void turnRight()
{
md.init();
moveStop();
md.setSpeeds(-M1Speed,M2Speed);
delay(250);
}

void moveBack()
{
md.init();
moveStop();
md.setSpeeds(-M1Speed,-M2Speed);
delay(250);
}

int checkDrop()
{
pinMode(IR_PIN,INPUT);
IRDist = analogRead(IR_PIN);
if(IRDist < IR_DROP)
{
return 1; //Drop present (determined with IR distance sensor)
}
else
{
return 0;
}
}

void lightDarkness()
{
LDRValue = analogRead(LDR_PIN);
if(LDRValue < MIN_LIGHT)
{
digitalWrite(LED_PIN,HIGH); //It is dark, turn on the light
}
else
{
digitalWrite(LED_PIN,LOW);
}
}

int checkLeftBumper()
{
bpLeft = digitalRead(BUMPER_LEFT_PIN);
if(bpLeft == HIGH)
{
//HIT!
return 1;
}
else
{
return 0;
}
}

int checkRightBumper()
{
bpRight = digitalRead(BUMPER_RIGHT_PIN);
if(bpRight == HIGH)
{
//HIT!
return 1;
}
else
{
return 0;
}
}

void compareDistance() {
if (leftDistance>rightDistance) //if left is less obstructed
{
turnLeft();
}
else if (rightDistance>leftDistance) //if right is less obstructed
{
turnRight();
}
else //if they are equally obstructed
{
moveBack();
}
}

long ping()
{
// Send Ping pulse
pinMode(PING_PIN, OUTPUT);
digitalWrite(PING_PIN, LOW);
delayMicroseconds(2);
digitalWrite(PING_PIN, HIGH);
delayMicroseconds(5);
digitalWrite(PING_PIN, LOW);

//Get duration it takes to receive echo of Ping sent
pinMode(PING_PIN, INPUT);
duration = pulseIn(PING_PIN, HIGH);

//Convert duration into distance (cm)
return duration / 29 / 2;
}

void loop()
{
lightDarkness();
if(checkDrop() == 1)
{
moveBack();
compareDistance();
}
else
if(checkLeftBumper() == 1)
{
moveBack();
compareDistance();
}
else if(checkRightBumper() == 1)
{
moveBack();
compareDistance();
}
else
{
moveStop();
int distanceFwd = ping();

if (distanceFwd>dangerThresh) //if path is clear
{
moveForward();
}
else //if path is blocked
{
moveStop();

panMotor.attach(SERVO_PIN);
panMotor.write(20); //look right

delay(250);

rightDistance = ping(); //scan to the right
panMotor.write(160); //look left

delay(600);

leftDistance = ping(); //scan to the left
panMotor.write(90); //look to centre

delay(300);

panMotor.detach();
compareDistance();
}
}
}
Roaming Robot

The Killer Robotics Family So Far!

This Killer Robotics Family currently consists of 2 complete robots and 1 work in progress.

First we have the Autonomous Roaming Robot:

Autonomous Roaming Robot

This robot was built on a Sparkfun Magician Chassis and uses a Arduino Uno R3 with a Pololu MC33926 dual motor controller, a HC-SR04 Ultra Sound Distance Sensor (On a micro servo for neck movement), a Sharp IR distance sensor to detect drops, and 2 trigger switches to detect direct contacts with objects. This robot autonomously roams avoiding objects and drops. I will provide a full breakdown on how this robot was constructed as well as the source code running on the Arduino in a future post.

Secondly we have the Insect bot:

Insectbot

This Robot was based on an Instructable article posted by Lumi3005 (http://www.instructables.com/id/Insect-Bot-mini/). It is based on a Beetle board (basically a shrunk down Arduino Leonardo) with 2 micro servos and a IR distance sensor. This robot walks around avoiding obstacles. I will be posting a review and build step-by-step guide for the DFRobot kit of this robot in the near future.

box

And Lastly we have The Geek:

robot7

This robot is still a work in progress and is by far the most ambitious robot that I have under taken. It utilises 16 Servos, will utilise 3 ultrasound distance sensors and 2 infrared distance sensors, 2 cameras (a Arduino Camera and a Logitech web cam) and will be powered by a combination of an Arduino Mega R3 and a Raspberry Pi 2. Many posts revolving around this robot, such as progress, lessons learnt and build instructions will follow in the future.

The Killer Robotics Family So Far!