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

Robautonomous

Yeah, it’s a play on words. Autonomous. Robosapien. If you think that’s bad, this hack isn’t even an original idea. I swiped a large part of it from Robosapien IR posted on the Arduino Playground. But I took the liberty of updating the hack.

I used an Arduino Pro Micro instead of a full sized version. I didn’t want to backpack the Robosapien, instead keeping it’s look as stock as I could. Next, I added in a Sharp IR range sensor which I incorporated into the chest of the robot. To the code, I used the double-stop sequence to engage autonomous mode. It goes into a loop where it takes an IR scan of what’s in front of it. If something is as close as 20 cm from the robot, it will stop and

Arduino Pro mini

burp. If it is only 40 or more cm away from the robot, then it backs up and turns about 100 degrees to a new course and loops around to scan again. There are delays in between commands and loop interations; the delay helps prevent command overrun (next command starts before first finishes).

Be aware that this routine will go until the batteries wear out, possibly overheating the motors in your Robosapien. It’s best to let it wander a while then give it a break. Or, you can modify the code to make it act entirely differently and this caution may not matter. But I figured I’d mention it because of something Mark Tilden said. In an interview he spoke of ways to get a lot of commands (88 I think) out of the robot through programming, and some of those could loop and keep the robot engaged for some time. He cautioned against constant activity for more than ten or fifteen minutes. That’s what I remember anyway.

Stripped for action....

He's stripped and ready, Doctor.

  • Open the robot by placing it face down on a clear workspace and removing the four top body shell screws. They are located at the shoulders and hips.
  • Disconnect the power switch and speaker connector from the brain board and move the back plate away. Make sure to carefully disconnect the arm wires. (Note how they were installed).
  • Turn the robot over and locate the wire bundle wrapped with black plastic insulation. Using an X-acto or similar hobby knife, slit the black plastic from the top down about an inch or so. This is to get access to the wires we will use for the modification.
  • Locate the black wire. It is ground. Cut it and strip a quarter inch of insulation from each end. Get a short, 4 inch piece of similar wire and strip it a quarter inch from the end. Wrap the three bare wire ends together and carefully solder them all together. Clip excess soldered wire to make a small, neat connection. Slide a piece of heat shrink tubing up the wire you added and center it over the solder joint and shrink it. You now have a black ground wire available for the hack.
  • Locate the red wire. This is the 6v from the Robosapien batteries. Cut it and splice it into a 4 inch piece of wire you provide just as you did with the black wire. You will then have a red power wire.
  • I use a 7805 5v regulator to make sure not to give the Arduino mini more than 5 volts. I bent the input pin  90 degrees about mid leg. Then I inserted the ground and regulated 5v pins into the GND and RAW pins on the Arduino.
  • I soldered the red wire from the Sharp IR sensor (V+) to the regulated 5v leg of the 7805 down close to the board. This provides power for the sensor.
  • I soldered the black wire from the Sharp sensor to the GND (center) leg of the 7805 to give the sensor a ground.
  • I soldered the red wire I added to the (bent) raw input leg of the 7805. This caused the Robosapien to power up the Arduino as the robot booted up, making it automatic.
  • Last, I severed the white wire that goes through the bundle up to the head, and stripped it’s ends. I soldered standard stranded hookup wire to attach the head end of the wire to pin 2 on the Arduino. This is the inbound pin.
  • I soldered the other end of the white wire to pin 3 of the Arduino. This is the outbound pin. Yes, I had to add about 3 inches of wire to each end of the white wire to reach the Arduino properly.
  • Next step was that I soldered the yellow wire (sig) from the Sharp IR sensor to analog pin zero on the Arduino mini.
  • I gave thought to carving the body shell so that I could put the IR sensor inside the chest cavity, but I relented to mounting it outside on the chest. I used double sided sticky tape to affix the sensor in place and drilled a 1/16 inch hole to feed the sensor wires inside the shell.
  • I drilled holes in which to install LEDs in the black pads on each side of the upper chest. One will tell me what mode the unit is in and the other will tell me its current avoidance status.
  • I again used double sided tape to stick the soldered side of the Arduino to the inside of the Robosapien chest shell.
  • I replaced the body shell, paying attention to the arm wires again, and how they plug into the arms properly.

Basically the robot looks like it did except for the rack on its chest that is the infrared sensor, and the colorful glimmers of the new LEDs.

The Arduino mini comes as a pretty basic board. It assumes that you know a bit about Arduinos in general and are comfortable with using FDTI cables and serial terminals. To program the Arduino I took a 6-gang of pin headers and plugged it into my USB FTDI cable. Then I just tell the Arduino IDE that I am programming a standard Arduino Duimilanove or Decemilia or Nano (option 1) and tell it the serial port it assigned to the USB FTDI cable. Load up the program, press the upload button and wait for it to finish.

Then I pull the unsoldered pins and the FTDI cable and close up the robot. The shell halves will make a satisfying click noise when they are positioned properly. Screw away and lock it up, you should be ready to go unless you (or I) made a terrible mistake.

Power the robot on using its power switch on the back shell half. Issue RC commands to it and have it do a few things. Then hit the stop command two times consecutively. It’s a little fussy, so you might have to generate a feel for the timing of the double-stop command.

Anyway, if you succeed, the ultra bright white headlight LED will light up, and the blue LED will be on or off depending on whether it is just strolling or reacting to an obstacle.  When you double tap the stop the robot should enter autonomous mode and explore his environment. I do keep the finger and toe sensors programmed. That happens via RC input in programming mode and executes as an interrupt when triggered. So this will add a layer of redundant safety for the robots navigation.

A double tap of the stop key should return the robot into his factory assigned, grovelling, subservient role as an RC device.

The parts used in this project were:

1) A volunteer Robosapien V1

2) an Arduino Pro Mini

3) 7805 5v Voltage Regulator

4) a few inches of light duty stranded hookup wire

5) Sharp IR detector/Range finder

You will need a hand drill and selection of tiny bits, an X-acto or similar hobby knife, soldering iron, solder, heat shrink tubing, medium phillips screwdriver, and a pair of small diagonal wire cutters. The total time to make the modification was about 2 1/2 hours. A Dremel tool might have sped that by half an hour.

Binary sketch size: 2968 bytes (of a 30720 available)

// based on Robosapien IR as posted by
// Karl http://www.mesastate.edu/~kcastlet
// posted on the Arduino Playground at
// http://www.arduino.cc/playground/Main/RoboSapienIR
// additions by BobK bk@deludia.com

#define RSTurnRight       0×80
#define RSRightArmUp      0×81
#define RSRightArmOut     0×82
#define RSTiltBodyRight   0×83
#define RSRightArmDown    0×84
#define RSRightArmIn      0×85
#define RSWalkForward     0×86
#define RSWalkBackward    0×87
#define RSTurnLeft        0×88
#define RSLeftArmUp       0×89
#define RSLeftArmOut      0x8A
#define RSTiltBodyLeft    0x8B
#define RSLeftArmDown     0x8C
#define RSLeftArmIn       0x8D
#define RSStop            0x8E
#define RSWakeUp          0xB1
#define RSBurp            0xC2
#define RSRightHandStrike 0xC0
#define RSNoOp            0xEF
boolean RSEcho=true;      // Should Arduino Echo RS commands
boolean RSUsed=true;      // Has the last command been used
volatile int RSBit=9;     // Total bits of data
volatile int RSCommand;   // Single byte command from IR
int bitTime=516;          // Bit time (Theoretically 833 but 516)
// works for transmission and is faster
int last;                 // Previous command from IR
int irPin = 0;           // assign pin for sharp ir sensor
int IRIn = 2;            // We will use an interrupt
int IROut= 3;            // Where the echoed command will be sent from
unsigned long distance;  // cm adjusted sensor return value variable
float volts = 0;         // IR sensor voltage reading

void setup()     {
Serial.begin(9600);
pinMode(IRIn, INPUT);
pinMode(IROut, OUTPUT);
pinMode(10,OUTPUT);
digitalWrite(IROut,HIGH);
attachInterrupt(0,RSReadCommand,RISING);
last=RSNoOp;
}

// Receive a bit at a time.
void RSReadCommand() {
delayMicroseconds(833+208);  // about 1 1/4 bit times
int bit=digitalRead(IRIn);
if (RSBit==9) { // Must be start of new command
RSCommand=0;
RSBit=0;
RSUsed=true;
}
if (RSBit<8) {
RSCommand<<=1;
RSCommand|=bit;
}
RSBit++;
if (RSBit==9) RSUsed=false;
}

// send the whole 8 bits
void RSSendCommand(int command) {
digitalWrite(IROut,LOW);
delayMicroseconds(8*bitTime);
for (int i=0;i<8;i++) {
digitalWrite(IROut,HIGH);
delayMicroseconds(bitTime);
if ((command & 128) !=0) delayMicroseconds(3*bitTime);
digitalWrite(IROut,LOW);
delayMicroseconds(bitTime);
command <<= 1;
}
digitalWrite(IROut,HIGH);
delay(250); // Give a 1/4 sec before next
}

void loop()
{
if (!RSUsed) {
if (RSCommand==RSStop && last==RSStop) RSEcho=!RSEcho;
last=RSCommand;
if (!RSEcho){
digitalWrite(10,HIGH);  // Turn on LED
RSSendCommand(RSWakeUp);
while(0) {
irScan();
if (distance < 20) {  // if obstacle closer than 20 cm
RSSendCommand(RSStop);
delay(20);
RSSendCommand(RSBurp);
} else
if (distance < 40) {    // if obstacle closer than 40 cm
RSSendCommand(RSRightHandStrike);
delay(20);
RSSendCommand(RSWalkBackward);
delay(20);
RSSendCommand(RSWalkBackward);
delay(20);
RSSendCommand(RSTurnRight);
delay(20);
RSSendCommand(RSTurnRight);
delay(20);
}
RSSendCommand(RSWalkForward);
delay(500);        // wait a half second
}  // end while
} else {
digitalWrite(10,LOW);   // No longer in control
RSSendCommand(RSCommand);
}
RSUsed=true;
}
}

unsigned long irScan() {
volts = analogRead(irPin)*0.0048828125;   // value from sensor
distance = 65*pow(volts, -1.10);       // luckylarry.co.uk
return(distance);
}

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 ↑