Building a robot - part 1: The planning

Posted on January 12, 2012

I’m writing a se­ries of ar­ti­cles on how to build a robot using a mi­cro­con­troller and a robot kit. This is part 1 in which I will dis­cuss the plan­ning part of the pro­ject.

The first step is to de­ter­mine what kind of robot you want to build and how you will build it. The key to suc­cess is plan­ning. Make a list of every­thing be­fore you order the parts too hastily. Double check that all volt­ages and parts fit to­gether. Get a gen­eral pic­ture of what kind of robot you want to build: Do you want a line-sensing ro­bot? A mo­tion/ob­stacle de­tec­tion ro­bot? Do you wand to con­trol it re­motely? Blue­tooth? Zig­bee? Or maybe wifi? Then you have to de­ter­mine how you want the robot to move. For a first project i sug­gest a robot with two wheels (like this one). But one with four wheels should be al­most as easy (only dif­fer­ence is that it is harder to turn with 4 wheels).

The starting point of your project would be to set a budget for the pro­ject. About 100€ should be enough to build one with many sen­sors (and per­haps some cheap re­mote con­trol). You could al­ways get away cheaper (I will men­tion it later) but then you have to do some more work. For about ~100€ you should get a robot plat­form, sen­sors that can de­tect ob­sta­cles, and wheel en­coders. My rec­om­mended list of parts is as fol­lows (most parts are from Seeed­stu­dio.­com, be­cause they have cheap prices and free in­ter­na­tional ship­ping on or­ders > 50$):

Robot Kit

This is a robot kit with 4 wheel­s-­drive. It is ro­bust and comes with most parts. You could also choose to go with the 2WD (I haven’t tried that one, but a sim­ilar one). These robot kits can hold many sen­sors and have spe­cial place­ment for the Ar­duino (which I will be using as the mi­cro­con­troller).

4WD robot kit

As an ad­d-on for this you should buy wheel-en­coders, i.e sen­sors that count how many ro­ta­tions your wheels have spun. Ex­ample usage for these are to keep track of the lo­ca­tion of the robot or to mea­sure the ve­loc­i­ty/ac­cel­er­a­tion. I used these. They don’t re­ally fit well within the 4WD robot plat­form base, but I was able to squeeze them in with some force (al­ter­na­tively you could build some holder for them). These wheel en­coders work re­ally well for me, they send a dig­ital signal HIGH for each de­tected hole on the disk, which is fas­tened to the mo­tors.


seeeduino mega

This ar­ticle will use an Ar­duino, but you could as well use a pi­caxe, Leaf maple or Beagle Bone. I used a Seee­duino Mega (Ar­duino Mega based), mainly be­cause it is avail­able from the same shop as the robot kit, is cheaper than of­fi­cial Ar­duinos, and has some nifty fea­tures. You could also use an Ar­duino UNO/ Duemi­lanove, but i dis­cov­ered that they have too few con­nec­tions if you want to use many sen­sors. The Seee­duino mega has 70 IO pins and 14 analog in­puts, com­pared to the UNO’s 14 pins and 7 in­puts. It also has 2 ded­i­cated se­rial con­nec­tions (TX1/2 RX1/2) which is re­ally useful if you want to re­mote con­trol your robot via blue­tooth or RF. If your com­pare the Seee­duino against the of­fi­cial Ar­duino Mega, you can see that the Seee­duino is a lot smaller (which is re­ally great when you build ro­bots, you don’t wan’t the mi­cro­con­troller to take all room that should be used for sen­sors).
So the reason for buying the Seee­duino Mega are:

You could also buy the Romeo al­l-in-one con­troller which ac­tu­ally can be bought as part of a robot kit at DFRo­bot­.­com. The reason why I chose the Seeed­studio Mega over this one is that i al­ready had a motor shield (I will come to that part later) and be­cause i found that it was better to have more IO ports if I wanted to add more sen­sors.

Rome all-in-one

The cheapest op­tion of these is ab­solutely the romeo. You can get it as a kit with the 4WD robot plat­form at DFRobot for 98$

If you want to build a simple line-­fol­lowing robot or a simple ob­sta­cle-avoiding robot you can get away with using an AT­Tiny85 or sim­ilar and use a L298N to drive the mo­tors, how­ever I will not cover that in this post (I will prob­ably make a post about that lat­er).

The motor con­troller

Adafruit motor controller

If you de­cided to buy the romeo you can just skip this part, as it has a built in motor con­troller. I per­son­ally chose to use the Adafruit motor shield be­cause I al­ready owned one. It is quite ex­pen­sive, but it has a lot of fea­tures, such as screw ter­minal con­nec­tors, con­nec­tions for 4 mo­tors, and for 2 ser­vos. You could also use the of­fi­cial Ar­duino motor shield. I find that Adafruit has a sweeter deal, be­cause it has con­nec­tions for Servos and has a Ar­duino Li­brary to con­trol the mo­tors eas­ily.


You can add any sensor you like to this ro­bot. You could add a Geiger counter to de­tect ra­di­a­tion or you could add a mi­cro­phone to use voice com­mands, or you could add GPS and a com­pass to get your lo­ca­tion. The pos­si­bil­i­ties are end­less. Most people would at least like some kind of ob­stacle de­tec­tion. You can use cheap ones like these, but they are only able to sense things at a dis­tance of 80 cm. Luckily Seeed­studio has these quite cheaply. They can sense at a better range, and look cooler. You can get sim­ilar sen­sors at spark­fun, but they are 3x more ex­pen­sive. I would get 2 of those, so you can de­tect at an angle of about 160 de­grees (the 4WD kit has nice mounts for two of the­se).
An­other sensor that can be es­sen­tial is a line fol­lowing sensor (ac­tu­ally an IR-sen­sor). You could build one your­self on the cheap or you can buy one for $6.50. Other cool sen­sors that can be useful for nav­i­gating are a com­pass or if you want to use your robot out­doors a GPS (although it is re­ally ex­pen­sive). Of course you can add sen­sors that aren’t used for nav­i­ga­tion. For ex­ample you could use a tem­per­a­ture sen­sor, or a light de­tec­tor.
Al­though a data logger isn’t tech­ni­cally a sensor I will add it here. You can use this if the in­ternal memory on your Ar­duino isn’t enough (if you for ex­ample want to build a map of your room using the ro­bot, or save other sensor data).

RF / Com­mu­ni­ca­tion


It is a good idea to have re­mote ac­cess to your ro­bot. You could con­trol it man­u­ally with your com­puter or you could just send the sensor data to your com­puter and make cool graphs of it. You could also use your smart­phone/iPad to con­trol your robot over blue­tooth. Most people use the Xbee/Zigbee so­lu­tion, al­though it can be­come quite ex­pen­sive (you need two of those, and two con­nector boards, one for your com­puter, one for the mi­cro­con­troller). To­tally this will cost at least 50€. I opted to go a cheaper road. I used blue­tooth. For the price of one Xbee you get a se­rial blue­tooth chip, and be­cause most people al­ready have blue­tooth avail­able on their com­put­ers, you have no more costs than that. The neg­a­tive as­pects of blue­tooth is that it is harder to get to work, and doesn’t have as large a range as other so­lu­tions. You could also use RF which ranges from cheap (you can get one-way mod­ules for about 5€) to ex­pen­sive (over 100€, but have in­cred­ible range of a few kilo­me­ters).

Other com­po­nents

Other com­po­nents that you may need are bat­ter­ies. You can use normal AA-­bat­teries (the 4WD kit comes with bat­tery hold­er), but you can also use fancier recharge­able bat­ter­ies, like Li-Po bat­ter­ies. Re­member that you need a way to recharge the Li-Po bat­ter­ies, and that they are pow­erful enough to drive the mo­tors. I opted to use AA-­bat­teries for the mo­tors, but used a Li-Po bat­tery for my Seee­duino mega (as it has a JST con­nec­tor). It is pos­sible to use the same en­ergy source for both the mo­tors and the mi­cro­con­troller, but I rec­om­mend using sep­a­rate as many prob­lems (e.g Ar­duino re­set­ting) can arise from using the same source. Other things to think of is that you should have jumper ca­bles. Get some Fe­male-­to-Fe­male and Male-­to-­Male, to be sure that you can con­nect every­thing. Most Seeed­studio sen­sors use the Grove con­nec­tor, so you could ei­ther buy a grove shield or use these.
Other cool things to have is a RTC (Re­al-­Time Clock). You also need a Sol­dering iron and some solder (for sol­dering on the wires to the mo­tors).


This should get you started with plan­ning your Ro­bot. I will con­tinue on this se­ries of ar­ti­cles when I have time for it. Get some paper out and start draw­ing, cre­ating lists, and pre­pare to pur­chase the parts. I still want to stress you that reading about the parts is the best way to suc­cess. Know what you pur­chase.

blog comments powered by Disqus