Bobot

Robots I have known (or made)
  • ~MANUALS~
  • STORE BOUGHT
    • Femisapien
    • i-Cybie
    • i-SOBOT
    • Joebot
    • Mr Personality
    • Ottobot
    • R2D2
    • Robopet
    • Roboquad
    • Roboraptor
    • Roboreptile
    • Roborover
    • Robosapien
    • Spykee
    • Tekno Cat
    • Hexbug
    • Roomba
    • Anarduino
    • AnaFTDI
  • KIT ROBOTS
    • 3pi
    • EDGE Arm
    • Rhino Beetle
    • Yellow Thing
    • Sumovore
    • JeeNode
  • SENSORS AND DRIVERS
    • Arduino, et al
    • PIR Motion Sensor
    • Adafruit Mshield
    • Solarbotics Driver
    • SRF05 Ultrasound
    • LDR Sensor
    • Infrared Sensor
  • SELF MADE
    • MyBot
    • Barbie
    • Tank
    • Dune Buggy
    • Armed Patrol
    • MeterBot
    • MyMote
    • Robosapien Hack
    • BlackBox
    • Robautonomous
    • Eew Shield
    • Buttercup
    • Little Blue Tank
    • 4 Motor Controller
    • New 4 Motor Controller
  • EXPERIENCES
    • 0 Defects Desired
    • A New Robot
    • Sparkfun
    • Adafruit
    • NKC Electronics
    • Hobbytron
    • Modern Device
  • HOME PAGE

Solarbotics Driver

A lot of the robots I build are pretty simplistic. They have a couple of motors and a sensor to see with, and that about covers it. As a result, I don’t need the capabilities of a motor controller like the Adafruit Mshield.

Enter the Solarbotics Compact L298 Motor Driver. In spite of the rather long name, this postage-stamp sized controller is big in function. Capable of providing a couple of amps of output power to each motor, it will drive a pair of DC motors forwards and backwards together or separately. It also has the convenience of a regulated 5 volt output for driving things –like the Arduino I operate it with. The motor controller itself will accept from 6 to 26 volts –it will pretty much accept any voltage you need to drive the typical DC motors used in robotics. Of course, I suppose you could use it for something other than robots, but why?

Seeeduino Mega and Solarbotics Controller

The motor driver comes as a kit. As anyone who has ever seen a Solarbotics kit will verify, their kits are magnificent. The instructions are clear and the board itself is marked legibly enough the directions are almost unnecessary. The company also has the most stellar support I’ve experienced in any field, never mind robots. If you botch the assembly, you can send the device to Solarbotics and they will figure out what went wrong, fix it and return it for little or no money, depending on the assembly error.

It took me about 20 minutes to assemble my kit and it worked on the first test. It can be used in a number of different ways. You can control it with a switch or with a microcontroller like the Arduino. I happened to be using mine with a Seeeduino Mega for testing. When I finally put it in a robot, the idea is to use a tiny Arduino clone and go for a miniature creation. In order to use it to its fullest capacity, it will take up 5 digital pins. One is the chip enable pin and setting it low will shut down the L298. There are actually enable pins for both sides of the controller, but unless you’re doing something pretty exotic you can connect both to the same pin. Then there are pins for each direction of each motor. It isn’t a good idea to have both directions set high at the same time.  The controller doesn’t support speed control, but it really isn’t necessary for my purposes.

Below is the sketch I wrote to test out the motor driver.

// Example sketch for the
// Solarbotics Compact L298 Motor Controller
// Bob Kirkpatrick 5/2010

#define lforward 2                // declare the motor pins for
#define lbackward 3            // forward and reverse (eft)

#define rforward 5               // declare the motor pins for
#define rbackward 6           // forward and reverse (right)

#define motors 8                // declare motor enable pin
#define led 13                      // declare LED pin

void setup() {
Serial.begin(9600);          // start serial at 9600 baud
pinMode(lforward, OUTPUT);   // declare type of pin for
pinMode(lbackward, OUTPUT);  // the motors and LED
pinMode(rforward, OUTPUT);   //
pinMode(rbackward, OUTPUT);  //
pinMode(led, OUTPUT);        //
}

void disable() {               // turn off L298 chip
digitalWrite(motors, LOW);   // by setting enabe pin low
digitalWrite(led, HIGH);     // turn on “dead LED”
}

void enable() {                // turn on L298 chip
digitalWrite(motors, HIGH);  // by setting enable pin high
digitalWrite(led, LOW);      // turn off “dead LED”
}

void ahead() {                 // both motors forward
digitalWrite(lbackward, LOW);// NOTE always set the other
digitalWrite(rbackward, LOW);// pins low before setting
digitalWrite(lforward, HIGH);// any of them high
digitalWrite(rforward, HIGH);// no two-ways at the same time
}

void backup() {                // both motors backward
digitalWrite(lforward, LOW);
digitalWrite(rforward, LOW);
digitalWrite(lbackward, HIGH);
digitalWrite(rbackward, HIGH);
}

void left() {                  // turn left by running right motor
digitalWrite(lforward, LOW);
digitalWrite(lbackward, LOW);
digitalWrite(rbackward, LOW);
digitalWrite(rforward, HIGH);
}

void right() {                  // turn right by running left motor
digitalWrite(rforward, LOW);
digitalWrite(lbackward, LOW);
digitalWrite(rbackward, LOW);
digitalWrite(lforward, HIGH);
}

void loop() {                   // let’s try the functions!
disable();
Serial.println(“disabled”);
delay(500);
enable();
Serial.println(“enabled”);
delay(500);
ahead();
Serial.println(“ahead”);
delay(2000);
left();
Serial.println(“left”);
delay(2000);
right();
Serial.println(“right”);
delay(2000);
backup();
Serial.println(“back”);
delay(2000);
}

Comment ¬
Cancel reply

  • Pages

    • EXPERIENCES
      • 0 Defects Desired
      • A New Robot
      • Adafruit
      • Hobbytron
      • Modern Device
      • NKC Electronics
      • Sparkfun
    • HOME PAGE
    • KIT ROBOTS
      • 3pi
      • EDGE Arm
      • JeeNode
      • Rhino Beetle
      • Sumovore
      • Yellow Thing
    • SELF MADE
      • 4 Motor Controller
      • Armed Patrol
      • Barbie
      • BlackBox
      • Buttercup
      • Dune Buggy
      • Eew Shield
      • Little Blue Tank
      • MeterBot
      • MyBot
      • MyMote
      • New 4 Motor Controller
      • Robautonomous
      • Robosapien Hack
      • Tank
    • SENSORS AND DRIVERS
      • Adafruit Mshield
      • Arduino, et al
      • Infrared Sensor
      • LDR Sensor
      • PIR Motion Sensor
      • Solarbotics Driver
      • SRF05 Ultrasound
    • STORE BOUGHT
      • AnaFTDI
      • Anarduino
      • Femisapien
      • Hexbug
      • i-Cybie
      • i-SOBOT
      • Joebot
      • Mr Personality
      • Ottobot
      • R2D2
      • Robopet
      • Roboquad
      • Roboraptor
      • Roboreptile
      • Roborover
      • Robosapien
      • Roomba
      • Spykee
      • Tekno Cat
    • ~MANUALS~
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org

Powered by WordPress with CommPress - Subscribe: RSS - Back to Top ↑