Introduction: Obstacle Avoiding Car
Robots may have seemed like a fantasy as a kid, but we are on the break of making them a reality. Robots are different from regular machines because they can make their own decisions. The first step to this is them knowing where they can move without running into a wall. This is the reason I built my obstacle avoiding car. It is to get a step closer to everyone's childhood fantasy.
What You Need
-4 AA battery's
- Arduino Uno
- Motor Shield
- Ping sensor
- Metal holder
- 2 motors
- 9 wires
- Rotating wheel
- 2 big wheels
Step 1: Adding the Motor and Wheels
The first step is to put the motor and wheels on the chassis. The chassis is the base of your car and where you will attach all of the parts together. Then add 2 motors to the bottom of the chassis. Connect the wheels to the motor. Solder 2 wires to each motor. These wires will be used to be plugged in to the motor shield over an Arduino.
Step 2: Adding the Balance Wheel and Battery Pack
After adding the Motor and wheels to the chassis it will need a way to stand up straight. This is where the balance wheel comes in. It will be attached to the tip of the back of the chassis. Its only purpose is to keep the chassis from dragging on the ground. Also add the battery pack. It should be behind the 2 motors and towards the back to the chassis. The battery pack I used fit 4 AA batteries in it. If you don't want to buy a battery pack the alternative is to then tape a 9v battery to the bottom of the chassis. If you do this then you will have to attach the wires onto the battery yourself.
Step 3: Adding the Ping Sensor and Arduino
Step 3 is to attach the ping sensor and the Arduino Uno with a motor shield. The ping sensor is what allows the car to know how far away objects are and turn. Because the ping sensor can't be attached to the chassis directly you will have to get a metal holder of some sort. The ping sensor should be attached oppositely above the wheel in the front. The Arduino Uno and the motor shield should be attached above the battery holder in the back of the chassis.
Step 4: Connect the Wires
Now that everything is set up the only thing left to do is to hook up all of the wires. When hooking up the ping sensor take a 3 wire connector and attach it to the 3 prongs on the ping sensor. Take the other end of those 3 wires and plug it into servo 1 on the motor shield. To the left of the servo 1 prong, there will be 5 adjacent places to plug in wires. This is where you will plug in the motor wires. plug in the 2 wires from the motor on the outer to towards where the motors are placed and leave the middle plugin open(If the motor is on the right plug the 2 wires to the 2 plugins on the right. If the motor is on the left plug in the 2 wires to the 2 on the left.). Now to plug in the battery look to the opposite side in the back from the servo 1 plugin. There will be 2 spots to plug in the negative and positive wire of the battery. And that is it for the wiring.
Step 5: The Code
The code is what you will use to program the Arduino Uno. Go to this URL to get the code.