Lib4U

‎"Behind every stack of books there is a flood of knowledge."

RC Car to Robot

RC-Car-to-Robot

In this Instructable I will go over the bare minimum you need to get started. Think of it as a template for making a basic robot that can be expanded with sensors, code, and additional hardware to do some really amazing things. You can now impress your family, make new friends, and scare your pets with the power of robot magic

 

http://www.youtube.com/watch?feature=player_embedded&v=kCvJcIG_INY

 

STEP 1GO GET STUFF

Go Get Stuff

You will need:

(x1) New Bright R/C Monster Truck (Radioshack #6000658)
(x1) Arduino Uno REV 3 (Radioshack #276-128)
(x1) Arduino Motor Shield (Radioshack #276-131)
(x1) Parallax Ping Sensor (Radioshack #276-136)
(x1) Heavy-Duty 9V Snap Connectors (Radioshack #270-324)
(x1) Size M Coaxial DC Power Plug (Radioshack #274-1569)
(x1) Multipurpose PC Board with 417 Holes (Radioshack #276-150)
(x1) 90-Ft. UL-Recognized Hookup Wire (Radioshack #278-1221)
(x1) Enercell® Alkaline 9 Volt Battery (Radioshack #25-853)
(x1) 6″ Heat-Shrink Tubing (Radioshack #278-1627)
(x1) 5-1/2″ Zip Ties (Radioshack #278-1631)

STEP 2REMOVE THE COVER

Remove the Cover
  • 2A.jpg
  • 2B.jpg
  • 2C.jpg
  • 2D.jpg
Flip the RC car over and remove the two screws holding the cover in place.

Put these screws aside somewhere safe for later reassembly.

STEP 3UNPLUG

Unplug
  • 3A.jpg
  • 3B.jpg
Unplug the motors from the connectors on the main board.

If your remote control car is hard wired to the motherboard, cut the motor wires loose.

STEP 4REMOVE THE CONTROLLER

Remove the Controller
  • 4A.jpg
  • 4B.jpg
  • 4C.jpg
  • 4D.jpg
  • 4E.jpg
Remove the screws holding the controller board to the RC car and pull it free.

STEP 5POWER

Power
  • 5A.jpg
  • 5B.jpg
  • 5C.jpg
  • 5D.jpg
  • 5E.jpg
Remove the cover from the M-type power plug and slide it onto the wires for the 9V connector (such that you can twist it back on after you solder the wires).

Solder the red wire to the middle connection tab. Solder the black wire to the outer connection tab.

Twist the cover back onto the plug.

STEP 6MARK AND DRILL

Mark and Drill
  • 6A.jpg
  • 6B.jpg
  • 6C.jpg
  • 6D.jpg
  • 6E.jpg
  • 6F.jpg
Place the Arduino atop the bed of the cargo RC car.

Make marks where the mounting holes are in such a way that it will later be easy to zip tie the Arduino down.

Drill through each of these marks with a 1/8″ drill bit.

STEP 7MORE MARKING AND DRILLING

More Marking and Drilling
  • 7A.jpg
  • 7B.jpg
  • 7C.jpg
  • 7D.jpg
  • 7E.jpg
Place the 9V battery on the underside of the cargo bed. Make two marks on each side of the battery and drill them with a 1/8″ drill bit.

STEP 8ATTACH

Attach
  • 8A.jpg
  • 8B.jpg
  • 8C.jpg
Plug the 9V clip to the 9V battery and zip tie it to the underside of the RC car.

Trim away the excess bits of zip tie.

STEP 9SHIELD

Shield
  • 9A.jpg
  • 9B.jpg
  • 9C.jpg
Plug the Arduino Motor Shield into the sockets of the Arduino Uno.

STEP 10ATTACH

Attach
  • 10A.jpg
  • 10B.jpg
  • 10C.jpg
  • 10D.jpg
  • 10E.jpg
  • 10F.jpg
Now that the Motor Shield is attached zip tie the Arduino to the back side of the RC Car.

STEP 11TRIM

Trim
  • 11A.jpg
  • 11B.jpg
  • 11C.jpg
  • 11D.jpg
Using scissors or a paper cutter, trim the PC Board until is skinny enough that it slides neatly between the RC car’s front grill.

Once made skinnier, shorten it such that it is just long enough to stick out the front.

STEP 12SOLDER

Solder
  • 12A.jpg
  • 12B.jpg
  • 12C.jpg
  • 12D.jpg
  • 12E.jpg
  • 12F.jpg
Solder the PING sensor centered on the front of the trimmed PC Board.

Connect 8″ of green wire to the Signal pin, 8″ of red wire to the 5V pin, and 8″ of black wire to the Ground pin.

STEP 13INSERT

Insert
  • 13A.jpg
  • 13B.jpg
  • 13C.jpg
Slide the circuit board into the front grill of the car and make sure the sensor is sitting level.

If it is not level, adjust it until it is.

STEP 14DRILL AND FASTEN

Drill and Fasten
  • 14A.jpg
  • 14B.jpg
  • 14C.jpg
Drill an 1/8″ hole on each side of the circuit board and firmly secure it to the body of the RC car with zip ties.

STEP 15EXTEND

Extend
Trim away the connector for one of the motors. Connect an 8″ red wire to one and an 8″ black wire to the other.

Repeat this process with the second motor.

Finally, slide heat shrink tubing over each of the four exposed solder connections and shrink them into place with a heat gun.

STEP 16CLEAN UP

Clean Up
  • 16A.jpg
  • 16B.jpg
  • 16C.jpg
Zip tie each set of wires together to keep everything tidy.

You may even want to consider zip tying the sets together into a single bundle for the length of wire that passes over the body of the RC car.

STEP 17PUT IT TOGETHER

Put it together
  • 17A.jpg
  • 17B.jpg
  • 17C.jpg
Put the body back onto the frame of the RC car and screw it back into place with the screws you set aside earlier.

STEP 18PROGRAM

Program
Program the car with the following Arduino code:

*
RC Car to Robot Conversion
by Randy Sarafan

Used to convert an RC car into a robot that uses a PING sensor to avoid obstacles,
and an Arduino motor shield for motor control.

For more information see:
http://www.instructables.com/id/RC-Car-to-Robot/

Built atop Ping example code by Tom Igoe
*/

// this constant won't change.  It's the pin number
// of the sensor's output:
const int pingPin = 7;

void setup() {

  //establish motor direction toggle pins
  pinMode(12, OUTPUT); //drive motor -- HIGH = forwards and LOW = backwards
  pinMode(13, OUTPUT); //turn motor -- HIGH = left and LOW = right

  //establish motor brake pins
  pinMode(9, OUTPUT); //brake (disable) the drive motor
  pinMode(8, OUTPUT); //brake (disable) the turn motor

  //Turns brake off for drive motor
  digitalWrite(9, LOW); 

  //Turns brake on for turn motor
  digitalWrite(8, HIGH); 

  //Sets initial speed of drive motor
  analogWrite(3, 200);

  //Sets initial direction of drive motor
  digitalWrite(12, HIGH);
}

void loop()
{
  // establish variables for duration of the ping, 
  // and the distance result in inches and centimeters:
  long duration, inches, cm;

  // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
  // Give a short LOW pulse beforehand to ensure a clean HIGH pulse:
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin, LOW);

  // The same pin is used to read the signal from the PING))): a HIGH
  // pulse whose duration is the time (in microseconds) from the sending
  // of the ping to the reception of its echo off of an object.
  pinMode(pingPin, INPUT);
  duration = pulseIn(pingPin, HIGH);

  // convert the time into a distance
  inches = microsecondsToInches(duration);

  //
  //if objects are less than 12 inches away
  //the robot reverses and turns to the right
  //for 2 seconds
  //

  if (inches < 12){

    //brake drive motor and pause 1/10 second
    digitalWrite(9, HIGH);
    delay(100);

    //
    //setting turn motor
    //

    //turn off brake for turn motor 
    digitalWrite(8, LOW);

    //set turn motor direction
    digitalWrite(13, HIGH);

    //activate turn motor
    analogWrite(11, 255);

    //
    //setting drive motor
    //

    //turn off brake of drive motor
    digitalWrite(9, LOW); 

    //set drive motor backwards direction
    digitalWrite(12, LOW);

    //activate the drive motor
    analogWrite(3, 200);

    //backup for 2 seconds
    delay(2000);

    //
    //stopping
    //

    //brake both motors
    digitalWrite(8, HIGH);
    digitalWrite(9, HIGH);

  }

  //
  //when nothing is within 12" 
  //the robot simply drives forwards
  //

  else{

    //
    //Setting drive motor
    //

    //set drive motor forward direction
    digitalWrite(12, HIGH);

    //turn off brake of drive motor
    digitalWrite(9, LOW);    

    //activate drive motor
    analogWrite(3, 200);

  }

  delay(100);
}

long microsecondsToInches(long microseconds)
{
  // According to Parallax's datasheet for the PING))), there are
  // 73.746 microseconds per inch (i.e. sound travels at 1130 feet per
  // second).  This gives the distance travelled by the ping, outbound
  // and return, so we divide by 2 to get the distance of the obstacle.
  // See: http://www.parallax.com/dl/docs/prod/acc/28015-PING-v1.3.pdf
  return microseconds / 74 / 2;
}

-------------------------------------------------------------------------------------------
For help getting started with the Arduino, check out the Intro to Arduino Instructable.

STEP 19WIRE IT UP

Wire it up
  • 19A.jpg
  • 19B.jpg
  • 19C.jpg
  • 19D.jpg
  • 19E.jpg
The ping sensor:

  • Connect the green wire from the Ping sensor to digital pin 7.
  • Connect the black wire from the Ping sensor to ground.
  • Connect the red wire to the power input screw socket on the motor shield.

The front turn motor:

  • Connect the red wire from the front motor to+ port on channel B of the motor shield.
  • Connect the black wire from the front motor to – port on channel B of the motor shield.

The rear drive motor:

  • Connect the red wire from the rear motor to the + port on channel A of the motor shield.
  • Connect the black wire from the rear motor to – port on channel A of the motor shield.

The motor shield:

  • Connect the 5V socket to the power input power screw socket on the motor shield (in addition to the Ping power wire already connected).
  • Connect the ground socket on the shield to the input ground screw socket on the motor shield

STEP 20GO!

Go!
  • 20A.jpg
  • 20B.jpg
Insert the 9V plug into the power socket on the Arduino to power up your robot.

Note: If you decide that you want to reprogram your Arduino, before you plug in the USB cable, disconnect both the 9V battery and the power connection between the Arduino power socket and the motor shield.

Source:

One comment on “RC Car to Robot

  1. gratis sexdating
    February 13, 2013

    Thanks for posting this awesome information. Keep up the good work. I’ll subscribe to your website also. Thnx!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Information

This entry was posted on January 15, 2013 by in Automatic & Robotic, Electronic & Computer Engineering, Science & Technology.
Virtual Fashion Technology

Virtual Fashion Education

toitocuaanhem

"chúng tôi chỉ là tôi tớ của anh em, vì Đức Kitô" (2Cr 4,5b)

VentureBeat

News About Tech, Money and Innovation

digitalerr0r

Modern art using the GPU

Theme Showcase

Find the perfect theme for your blog.

lsuvietnam

Learn to Learn

Gocomay's Blog

Con tằm đến thác vẫn còn vương tơ

Toán cho Vật lý

Khoa Vật lý, Đại học Sư phạm Tp.HCM - ĐT :(08)-38352020 - 109

Maths 4 Physics & more...

Blog Toán Cao Cấp (M4Ps)

Bucket List Publications

Indulge- Travel, Adventure, & New Experiences

Lib4U

‎"Behind every stack of books there is a flood of knowledge."

The WordPress.com Blog

The latest news on WordPress.com and the WordPress community.

%d bloggers like this: