EZ-CD Robot

I wanted to build a 'quick and easy' little chassis to try out software and sensors with my $50 robot board.

I wanted to create as small a chassis as I could. So I got the inspiration by putting 2 servos side by side and thought - 'I wonder if I could Velcro all of this together?'. Being a total anarchist: I wanted to do this without any 'heavy design' - ie no Google SketchUp, Eagle etc and just using every day tools - and as few screws as possible. Not that there is anything wrong with more advanced principles- I just wanted to build something 'quick and dirty'.  Velcro is very cool for this kind of proto-typing. Maybe we should call it 'plug-play-and-rip' !!


For now we will concentrate on building the chassis and then talk about software later.

1 - The chassis

We will build the chassis out of HDPE as it is easy to cut and put self-tapping screws into. We will make the base as a circle with the wheels inside the circumference - as this makes a shape that is hard to get snagged on chair legs etc.


Here are the basic materials we will need:-

  1. Small screwdriver set (often called 'watch makers' screwdrivers)
  2. A jigsaw
  3. Small pliers
  4. CD marker pen (is good on HDPE)
  5. An old CD disc
  6. A set square and ruler




First we will use our set square to make sure that we have a good 90 degree corner:-


Then take an old CD (you no longer need - as the pen may corrupt the CD. Use one of those free CDs you get in the post!) and a CD marker pen. These pens make a better marking on the board compared with pencil, biro or felt tip:-



Trace around the outer edge of the CD to make a circle. Then use the set-square to draw a box around the circle. Then draw the diagonals from each corner - the intersection is the center of the circle.



Then we need to cut some holes for the wheels to go through. By placing the servos flush with the base we can measure the distance from the base to the axle of the servo. Knowing the diameter of the wheels we are using, and Pythagoras' theorem then we can calculate the requried hole size in the chassis to accomodate the wheel. Obviously you need to increase these dimensions slightly to leave a gap around the wheel. I calculated mine, using Solarbotics wheels, as about a 6cm hole. The width of the hole should be wider than the wheel. So mark-up the wheel slot for the base:-


Use the jigsaw to cut around the circle and then to cut out the slots for the wheels. I have then mounted my Hitec servos using Universal Servo Mounting Brackets so that the wheels fit snuggly into the slots we have cut. The last step was to add some Velcro to the top of the servo housings (the big white squares on top of the servos show below).


Next: cut out a rough rectangle (no need to be at all accurate) whose width will go across the velcro on the two servos (to add a bit of strength) and goes to the back of the chassis and stick it on:-


I have then velcro'd a small ball caster unit to the top of this board. You could probably also use a Tamiya Ball Caster Unit or any other unit you prefer. The only caveat is that the net result is that the robot should stand upright.


The wheels and ball caster are available here (UK prices)


This additional 'shelf' also acts as somewhere to store the 9v battery to supply the $50 robot board. So let's add some velcro to the 9v battery:-

By adding some Velcro to the shelf we can now attach the 9v battery:-


So much for the bottom of the robot. Now let's see it from the top:-


Here you can see how the 9v battery is on the 'bottom shelf'. Above it, on top of the base, we have got the 4xAA battery box for driving the servos. This box has also been Velocro'd to the base.This battery box, and the 9v battery, are purposely placed towards the back of the robot so that the center of gravity rests upon the ball caster. Otherwise - when your robot goes from forward to backwards movement then the chassis will do a nose dive at the front.

Resting, just above it, is a $50 robot board. Yours may well look different to mine - but mine still uses the matrix board described in the tutuorial so the dimensions will be the same. The $50 board has not been mounted using the usual spacers. Instead: I have found some plastic alternatives (at my local hardware store) which means I can cut them to whatever length I need - which is cool.


You will also see that I have screwed on some micro-switches to the front of the robot. These are just to act as 'bumpers'. These are just on-off switches with a long arm on top. These need to be attached very close to the diameter of the chassis.


Here's another photo from the front:-


This shows the micro-switches as well as another HS311 servo (unmodified) upon which we can mount a sonar, etc, which could swing left/right. This servo has also been mounted using Velcro so that we can remove it or re-position it as needed.



2 - Other useful bits

Of course you can also attach other inputs - such as the light dependent resistor describer in the $50 robot.


But here is my own output device which I find really useful for testing:-

Its a 3 pin plug - that plugs into your $50 robot headers - and has an LED and resistor wrapped up in insulator tape. You can then plug it into your board to check for high/low outputs or as a power on indicator which could then be removed from your final design. So its a kind of 'visual' continuity tester?

3 - Software

Here is a load of software the EZ-CD. For each example I have included, wherever possible, various attachments. These will take the form:

nnnnn-c-src.zip      For the C source code

nnnnn-cpp-src.zip.  For the C++ source code to use with my C++ tutorial


nnnnn-ATxxx-yy.hex         Pre-compiled hex files that you can just upload straight to your controller without any compiler stage



nnnnn - The name of the project

xxx     - The AVR processor eg Mega8, Mega168

yy      - The processor speed where 01=1MHz, 08=8MHz.


If you are having trouble with the servos then it may that your servos aren't quite centered in the same way as mine. For the C++ source code you change the wat the servos are centered as follows:-

1. Locate the line that creates the servo. e.g. something like: SERVO  g_servoLeft( &g_servoLeftOut , true , 1500, 300);

2. The last 2 parameters specify the 'center point' and the amount of 'swing' either side of 'center'. So if you change the last value to zero as follows: SERVO  g_servoLeft( &g_servoLeftOut , true , 1500, 0) then the servo will always try to center itself. Change the '1500' value until the servo stops spinning - this parameter is now correct. Now play with the last value to get the maximum amount of swing out of your servo - this should be somewhere in the range 300 to 700.



So here are the examples:-


1 - Bumper

Very simple robot. Just drives forward until one of the microswitch closes. It will then reverse, then spin, then go forward again.

The robot is not very good when it runs straight into something as there is no bumper switch at the front. Trying adding one yourself and changing the code.




Connect the left drive servo to  D2

Connect the right drive servo to D3

These should be powered from the unregulated supply


Connect the left microswitch to C2, and the right one to C3.

These should be powered from the regulated 5V supply


The C++ source code can be downloaded here. You may need to change the makefile so that 'MCU_TARGET' is for your cpu, and 'F_CPU' is the speed of your cpu. You will also need to rebuild the C++ library by changing the makefile in the root folder of the library to have the same settings.




2 - BumperIR

Builds on the previous example by mounting Sharp IR detectors at the front of the robot to try to steer away from objects. If it hits something then it works like before.



Sharp IR detectors send out a narrow beam and so aren't good at seeing small objects like chair legs.


As a result - I quickly came to the conclusion that this wasn't much better than the BumperBot. If anyone is interested I could be up the code.


The next example gives a far superior solution.

3 - SRF05

Here we abandon all the infra red sensors in favour of a single Devantech SRF-05 sonar mounted on the front servo so that it can pan left and right. Much better result !!



Connect the sonar to pin C0 - using the +5v regulated supply


The servos should be connected to the un-regulated supply as follows:-

Connect the servo that moves the sonar to D4

Connect the left drive servo to  D2

Connect the right drive servo to D3


If you want to use the micro-switches then connect the left one to C2, and the right one to C3.


The C++ source code can be downloaded here. You may need to change the makefile so that 'MCU_TARGET' is for your cpu, and 'F_CPU' is the speed of your cpu. You will also need to rebuild the C++ library by changing the makefile in the root folder of the library to have the same settings.