Building a robot - part 1: The planning

Posted on January 12, 2012

I’m writing a series of articles on how to build a robot using a microcontroller and a robot kit. This is part 1 in which I will discuss the planning part of the project.

The first step is to determine what kind of robot you want to build and how you will build it. The key to success is planning. Make a list of everything before you order the parts too hastily. Double check that all voltages and parts fit together. Get a general picture of what kind of robot you want to build: Do you want a line-sensing robot? A motion/obstacle detection robot? Do you wand to control it remotely? Bluetooth? Zigbee? Or maybe wifi? Then you have to determine how you want the robot to move. For a first project i suggest a robot with two wheels (like this one). But one with four wheels should be almost as easy (only difference is that it is harder to turn with 4 wheels).

The starting point of your project would be to set a budget for the project. About 100€ should be enough to build one with many sensors (and perhaps some cheap remote control). You could always get away cheaper (I will mention it later) but then you have to do some more work. For about ~100€ you should get a robot platform, sensors that can detect obstacles, and wheel encoders. My recommended list of parts is as follows (most parts are from Seeedstudio.com, because they have cheap prices and free international shipping on orders > 50$):

Robot Kit

This is a robot kit with 4 wheels-drive. It is robust and comes with most parts. You could also choose to go with the 2WD (I haven’t tried that one, but a similar one). These robot kits can hold many sensors and have special placement for the Arduino (which I will be using as the microcontroller).

4WD robot kit

As an add-on for this you should buy wheel-encoders, i.e sensors that count how many rotations your wheels have spun. Example usage for these are to keep track of the location of the robot or to measure the velocity/acceleration. I used these. They don’t really fit well within the 4WD robot platform base, but I was able to squeeze them in with some force (alternatively you could build some holder for them). These wheel encoders work really well for me, they send a digital signal HIGH for each detected hole on the disk, which is fastened to the motors.

Microcontroller

seeeduino mega

This article will use an Arduino, but you could as well use a picaxe, Leaf maple or Beagle Bone. I used a Seeeduino Mega (Arduino Mega based), mainly because it is available from the same shop as the robot kit, is cheaper than official Arduinos, and has some nifty features. You could also use an Arduino UNO/ Duemilanove, but i discovered that they have too few connections if you want to use many sensors. The Seeeduino mega has 70 IO pins and 14 analog inputs, compared to the UNO’s 14 pins and 7 inputs. It also has 2 dedicated serial connections (TX1/2 RX1/2) which is really useful if you want to remote control your robot via bluetooth or RF. If your compare the Seeeduino against the official Arduino Mega, you can see that the Seeeduino is a lot smaller (which is really great when you build robots, you don’t wan’t the microcontroller to take all room that should be used for sensors).
So the reason for buying the Seeeduino Mega are:

You could also buy the Romeo all-in-one controller which actually can be bought as part of a robot kit at DFRobot.com. The reason why I chose the Seeedstudio Mega over this one is that i already had a motor shield (I will come to that part later) and because i found that it was better to have more IO ports if I wanted to add more sensors.

Rome all-in-one

The cheapest option of these is absolutely the romeo. You can get it as a kit with the 4WD robot platform at DFRobot for 98$

If you want to build a simple line-following robot or a simple obstacle-avoiding robot you can get away with using an ATTiny85 or similar and use a L298N to drive the motors, however I will not cover that in this post (I will probably make a post about that later).

The motor controller

Adafruit motor controller

If you decided to buy the romeo you can just skip this part, as it has a built in motor controller. I personally chose to use the Adafruit motor shield because I already owned one. It is quite expensive, but it has a lot of features, such as screw terminal connectors, connections for 4 motors, and for 2 servos. You could also use the official Arduino motor shield. I find that Adafruit has a sweeter deal, because it has connections for Servos and has a Arduino Library to control the motors easily.

Sensors

You can add any sensor you like to this robot. You could add a Geiger counter to detect radiation or you could add a microphone to use voice commands, or you could add GPS and a compass to get your location. The possibilities are endless. Most people would at least like some kind of obstacle detection. You can use cheap ones like these, but they are only able to sense things at a distance of 80 cm. Luckily Seeedstudio has these quite cheaply. They can sense at a better range, and look cooler. You can get similar sensors at sparkfun, but they are 3x more expensive. I would get 2 of those, so you can detect at an angle of about 160 degrees (the 4WD kit has nice mounts for two of these).
Another sensor that can be essential is a line following sensor (actually an IR-sensor). You could build one yourself on the cheap or you can buy one for $6.50. Other cool sensors that can be useful for navigating are a compass or if you want to use your robot outdoors a GPS (although it is really expensive). Of course you can add sensors that aren’t used for navigation. For example you could use a temperature sensor, or a light detector.
Although a data logger isn’t technically a sensor I will add it here. You can use this if the internal memory on your Arduino isn’t enough (if you for example want to build a map of your room using the robot, or save other sensor data).

RF / Communication

Xbee

It is a good idea to have remote access to your robot. You could control it manually with your computer or you could just send the sensor data to your computer and make cool graphs of it. You could also use your smartphone/iPad to control your robot over bluetooth. Most people use the Xbee/Zigbee solution, although it can become quite expensive (you need two of those, and two connector boards, one for your computer, one for the microcontroller). Totally this will cost at least 50€. I opted to go a cheaper road. I used bluetooth. For the price of one Xbee you get a serial bluetooth chip, and because most people already have bluetooth available on their computers, you have no more costs than that. The negative aspects of bluetooth is that it is harder to get to work, and doesn’t have as large a range as other solutions. You could also use RF which ranges from cheap (you can get one-way modules for about 5€) to expensive (over 100€, but have incredible range of a few kilometers).

Other components

Other components that you may need are batteries. You can use normal AA-batteries (the 4WD kit comes with battery holder), but you can also use fancier rechargeable batteries, like Li-Po batteries. Remember that you need a way to recharge the Li-Po batteries, and that they are powerful enough to drive the motors. I opted to use AA-batteries for the motors, but used a Li-Po battery for my Seeeduino mega (as it has a JST connector). It is possible to use the same energy source for both the motors and the microcontroller, but I recommend using separate as many problems (e.g Arduino resetting) can arise from using the same source. Other things to think of is that you should have jumper cables. Get some Female-to-Female and Male-to-Male, to be sure that you can connect everything. Most Seeedstudio sensors use the Grove connector, so you could either buy a grove shield or use these.
Other cool things to have is a RTC (Real-Time Clock). You also need a Soldering iron and some solder (for soldering on the wires to the motors).

Conclusion

This should get you started with planning your Robot. I will continue on this series of articles when I have time for it. Get some paper out and start drawing, creating lists, and prepare to purchase the parts. I still want to stress you that reading about the parts is the best way to success. Know what you purchase.

blog comments powered by Disqus