Robotics can be a difficult hobby to jump into, but the Arduino and the 4WD Robot Platform make it easy for you to build an awesome robot without a struggle! By utilizing components found in the Maker Shed, this guide makes it easy for you to learn the basics of robotics, applications of the Arduino, and the process of building something awesome to show your family and friends.
Find the long strand of wire from your stash of parts. Cut five equal strands of this wire, and strip the ends of each side.
Four strands will be used for the four motors, while the fifth will be used for the switch.
Connect the two leads of the hookup wire to each of the leads on the motor. Take a soldering iron and solder the wires to the leads on the motor. Do this for each motor.
Go into your Minitronics: Survival Packs and get a 0.1uf capacitor from each. They are labeled with a 104. After some research, I discovered that having a 0.1uf capacitor soldered across each lead on the motor will make sure they do not move at random intervals. So, just insert a capacitor into each motor lead as shown in the picture.
Make sure that you are careful when soldering with the motors. The leads on the motor are fragile, so just be careful when attaching the wires to solder.
Connect the red wire from the battery holder to the middle wire on the toggle switch. Strip the black wire (if it's not already stripped) and leave it for now. The same goes for the remaining wire on the toggle switch.
I recommend twisting the wires together, soldering them, and then putting some electrical tape over the connections.
There are two black 47uF capacitors that are included in the kit. These will be inserted into C7 and C8. Make sure you insert them with the correct polarity. The negative side is noted with a gray strip, so insert that in the hole that is not noted positive on the circuit board.
There are three 100uF capacitors included in the kit. Just as with the other capacitors, note the polarity when you insert them. I only had two 100uF capacitors included in my kit, but in my Minitronics: Survival Pack there was a 100uF capacitor. It had a higher voltage rating than the others, but that is fine. Solder these in.
While you are at it, insert the LED into its spot, labeled LED1. The longer lead is the positive lead, so note this when you are inserting it into the circuit board. Solder it in.
There are three 2-terminal blocks and two 3-terminal blocks. One of the 2-terminal blocks is inserted into the EXT_PWR space.
On each side of the circuit board, there are terminals with 5 spots. So on each side, just combine a 2-terminal block and a 3-terminal block. Solder these in with the square openings facing outward. This is where the wires are connected into.
Ignore soldered in pins (headers) in on the Msheild v1.1. This can be done last, after the arduino and shield have been connected. Though, If you prefer you can do it now.
Take the wires that are coming from your motors and insert each set of the wires into the two outer terminals (in the row of 5).
Polarity does not matter at this point. When you get the motors running, if you discover that the wheel on a motor needs to rotate in the opposite direction just switch the wires that you inserted into the terminal.
All right; we have reached Checkpoint #1 and now we can test to make sure your motors and Arduino are working. We'll test these in the next step.
Start by hitting the toggle switch. If the green light goes on, that means there is power to the Motor Shield, which means power to your motors!
Now we can go ahead and test the Motor Shield. Assuming that your computer has the Arduino program installed, we can move on.
Connect the Arduino to your computer, and upload the Motor_Test.pdf sketch found at the beginning of the project. This is just a simple loop to make sure your motors are working.
Make sure your Arduino is not touching the metal surface of the chassis. I didn't realize this at the beginning, so my motors were just twitching randomly! So place a piece of cardboard underneath the Arduino to make sure nothing is being shorted out. You can paint the cardboard black so that it matches the chassis color.
You are going to be connecting the Ping sensor to the Motor Shield. On the Motor Shield you will see 3 rows, each with 6 holes. They are marked GND, +5, and A0-5.
Go into your Minitronics Survival Pack and take out the replacement hookup wires. Cut off three pieces (I used different colors), each of a length that can go from the front carriage to the top level. If you are in doubt, just cut it longer than you think you need.
Strip both ends of each wire. Now, take one end of the first wire and insert it from the bottom up into one of the holes in A0-5. Solder this wire in from the top.
The A0-5 holes go to the analog inputs on the Arduino, but these can also be used as digital inputs if specified in the program (which it will be).
Take the second piece of wire and insert it (from the bottom up) into one hole in the GND row. Solder it in from the top.
Finally, take your last piece of wire and insert it (from the bottom up) into a hole in the 5+ row. Solder this in.
Now poke the three wires through the narrow slit that is at the front of the robot. They connect to the PING sensor itself.
Solder each wire, being careful that the GND from the shield is soldered to the GND on the sensor. The 5+ on the shield connects to the 5+ pin on the sensor, and the A0-5 on the shield connects to the SIG pin on the sensor.
Wrap your hookup wire around each sensor lead carefully, and solder them.
Find your 9V Battery holder, the battery holder plug, and the screw that holds it all together.
Unscrew the plastic piece from the plug and slide it up the two wires towards the case. It will be screwed on top of the plug once the wires are soldered.
The red wire from the holder is to be connected to the shorter lead on the plug while the black wire is soldered to the longer lead.
Crimp the two wires in the strain relief making sure that they do not short together. Then take the plastic housing and screw it over the metal plug.
Install a battery into the holder. Screw in the screw to hold the case together, and we are ready to go.
Step #33: Programming
I have provided a program that you can load onto your Arduino. It is in a file called Arduino_Robot_Code.pdf found under the "Files" section on the first page of this guide. This program makes the robot move forward until an object is located. The robot then moves backward and turns right. Then it goes forward again, repeating this process.
Plug the Arduino into the USB port on your computer. The 9V battery plug connects to the black female connector on the Arduino.
Compile the code, and then upload the code to the Arduino.
Hit the switch on the back of your robot, hit the switch on the battery supply, and you have an object-avoiding Arduino-powered robot!