What is the library?
The library will make controlling your Carduino a little easier. This project is intended for those with little programming experience, and just want to get started with simple robotics. You don't even need to know how to use a motor shield to use it. It's as simple as saying "turn right for 1 second" or "go forward for 3 seconds, and then speed up." The library also contains example code to help you get started.
What exactly is in the library?
Step 13 contains all the important information regarding the library, and all example projects.
Why would you ever want a wooden chassis, and is it fine if I build mine differently?
Of course you can build yours differently! The library will work almost no matter what you do, so you can change the design to whatever you'd like. The only reason why I used a wooden chassis was because it was the only material for this I had, so you can feel free to use whatever else you'd like.
What can this robot do?
It can do just about anything. Even just with the parts on the standard model, there is infinite possibilities. With Arduino and the Carduino library, programming it is incredibly easy, and it can do anything you can imagine. The extra breadboard space allows you to add a variety of sensors, to make it do just what you want.
How much does it cost?
Roughly one hundred dollars, if you're starting out with nothing. I had almost all the parts before I started, so the price was only about thirty dollars for me. Most all of the parts are very common, and you should have many of them.
Here is a terrible video of it in action:
(due to some issues with the distance sensor, I could not get object-avoidance in the video, but, I assure you, it works)
Step 1: Supplies
1 Breadboard http://www.sparkfun.com/products/9567
1 Arduino and breadboard holder http://www.sparkfun.com/products/10059
1 Sharp long range proximity sensor http://www.sparkfun.com/products/8958
2 Micro metal gear motors http://www.sparkfun.com/products/8910
1 Pair of 49x19mm wheels http://www.sparkfun.com/products/8899
1 Pair of motor mounting brackets http://www.sparkfun.com/products/8896
1 Pair of omni-wheels http://www.sparkfun.com/products/320
1 Arduino motor shield http://www.amazon.com/gp/product/B007BHKRVW/ref=oh_details_o00_s00_i00
1 15x10.75cm piece of wood (check size with the Arduino and breadboard holder)
12 #4 x 3/4" Wood screws
1 9v battery
Step 2: Set Up Various Things
Cut wood to correct size
Make Omni-wheels (instructions came with them)
Attach wheels to motors
Insert Arduino and breadboard into the holder.
Step 3: Mount Omni-wheels
Step 4: Mount Motors
Step 5: Mount Arduino & Breadboard
Step 6: Mount Proximity Sensor
Insert your JST wires into the sensor.
Now, put the red wire in the positive thingy in your breadboard, the black wire in the negative, and the yellow can go anywhere in the breadboard.
Step 7: Attach Motor Shield
Step 8: Solder to Motors
Step 9: Wire Motors to Motor Shield
Wire positive on the right motor to the negative terminal for motor A.
Wire negative on the right motor to the positive terminal for motor A.
Wire positive on the left motor to the positive terminal for motor B.
Wire negative on the left motor to the negative terminal for motor B.
If anyone believes these are wrong, please notify me. I am quite sure that I'm correct, but there is a chance that I lost track of which wire is which.
Step 10: Wire Breadboard and Sensor
Step 11: Attach Battery
Step 12: You're Done Building!
Step 13: The Library
Download Carduino.zip at the bottom of the step. Find /arduino-1.0/libraries. Extract the library to that location. Now, to use it, open up the Arduino IDE, go to sketch -> import library -> Carduino.
Here are the functions in the library:
void mycarduino.begin ()
Starts up the Carduino. Call in setup ().
void mycarduino.goforward(float seconds, int speed)
This function moves the Carduino forward for the specified time and speed. The speed should be any number from 1 to 1023, with 1023 being the fastest.
void mycarduino.goback(float seconds, int speed)
The same as the function above, only backward.
void mycarduino.turnright(int time)
Turns the Carduino right for the specified time, in milliseconds.
void mycarduino.turnleft(int time)
Turns the Carduino left for the specified time, in milliseconds.
Returns the reading of the proximity sensor, in centimeters.
Go to File -> Examples -> Carduino -> [name of your choice]
Blink- Drives the Carduino forward for a second, stops for a second, and repeats. This should be your first "hello world" program.
Object Avoid- Drives forward constantly, until an object comes within 25 centimeters. Then, it chooses a direction (left or right, chosen randomly) and it turns that distance for a random amount of time, between 800 and 2300 milliseconds.
Cautious Driving- Works like object avoid, but if it notices something within 40 centimeters, it slows down.
Spiral- Drives in an outward spiral.