loading

For a class project we are turning a RC car into a car that is controlled by an arduino the main objective is to make this car do a figure 8 using the arduino.

Step 1: Getting Started

Take the top of the car off so you can see the circuit board and unscrew it from its holder.

Step 3: Finding the Right Pins

once it is unscrewed and moving freely, have a piece of wire coming off a battery to find out witch parts of the board make the car drive forwards, reverse, left and right

Step 4: Soldering in Wires

Once you have figured out which parts of the circuit board make the car go forward, reverse, left and right solder "rainbow wire" to each one of these parts and also solder a resister to the end of each of these wires.Then solder the pins onto each of these that you will use to plug into your arduino. Then plug each into these pins

- Left signal - pin9;

- Right signal - pin 10;

- Reverse signal - pin 11;

- Forward signal - pin 12;

Step 5: Adding Figure 8 Ping and Making Your Car Do an 8

once this is all completed add in the figure 8 ping and it should work.

Step 6: Have Fun

Once you have got this to work you can add to your car with sensors and get your car to do other cool things!!!!!

Just like my car shown above

Step 7: My Car Now

Hi Guys!!

So now i have added a sensor and have aded in the pin to get it to work with the car

now the car will drive up to and object (like a wall) and stop about 20cm away then reverse away from the object and keep on driving

This is the code I put in for the car to do this

#include
#define TRIGGER_PIN 7 // Arduino pin tied to trigger pin on the ultrasonic sensor. #define ECHO_PIN 6 // Arduino pin tied to echo pin on the ultrasonic sensor. #define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.

int forward = 12; // forward pin int reverse = 11; // reverse pin int left = 10; // left pin int right = 9; // right pin

// The setup() method runs once, when the sketch starts

void setup() { // initialize the digital pins as an outputs: pinMode(forward, OUTPUT); pinMode(reverse, OUTPUT); pinMode(left, OUTPUT); pinMode(right, OUTPUT); Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results.

}

void go_forward() { digitalWrite(forward,HIGH); // turn forward motor on digitalWrite(reverse,LOW); // turn revers motor off }

void go_reverse() { digitalWrite(reverse,HIGH); // turn reverse motor on digitalWrite(forward,LOW); // turn forward notor off }

void stop_car() { digitalWrite(reverse,LOW); // turn revers motor off digitalWrite(forward,LOW); // turn forward motor off digitalWrite(left,LOW); digitalWrite(right,LOW); }

void go_left() { digitalWrite(left,HIGH); // turn left motor on digitalWrite(right,LOW); // turn right motor off }

void go_right() { digitalWrite(right,HIGH); // turn right motor on digitalWrite(left,LOW); // tune left motor off }

// the loop() method runs over and over again, // as long as the Arduino has power

void loop() { delay(50); // Wait 50ms between pings (about 20 pings/sec). 29ms should be the shortest delay between pings. unsigned int uS = sonar.ping(); unsigned int distance = uS / US_ROUNDTRIP_CM; // Send ping, get ping time in microseconds (uS). Serial.println(distance); // Convert ping time to distance in cm and print result (0 = outside set distance range) if (distance < 1 || distance > 25) { Serial.println("forwards"); go_forward(); delay(500); } else { Serial.println("backwards"); go_reverse(); delay(500); } }

This is also a video of it doing its thing:

http://youtu.be/Cu3RqLXkCc8

<p>Looks like fun! Sure would be cool to see it do a figure 8 on video...</p>

About This Instructable

5,111views

29favorites

License:

More by Joe Kingham:arduino RC car 
Add instructable to: