Home » Building Robots » Two Wheeled Robot

Two Wheeled Robot

Building Robots

Here we will document our attempt to build a 2 wheeled robot.

8/20/2010

motor shield2 wheeled platform

Parts ordered.

We are using this 2 wheeled platform from Make, along with an Arduino and a motor shield from Adafruit.

8/23/2010

Parts received and the unpacking begins!

Bot PartsMotor Shield

As you can already see, the holes in my top shield from my Make kit are a little different than the one they have pictured.

I don’t expect this to be a problem, but won’t know until I start adding sensors and stuff.

8/24/2010

Now to make the motor shield kit.  First check the instructions here and make sure you have all the parts.

Motor Shield 1

Here I have soldered the resistors and ceramic capacitors.

Motor Shield and tape

Next I soldered the reset button and have taped the resistor network in place, making sure it is in the correct way.

I then soldered one lead on each end, then removed the tape and finished soldering the leads.

Motor Shield 2

8/26/10

ChipCapacitor

Now we have soldered the 2 L293D motor driver chip sockets and the 74HC595 chip.

The sockets are optional and you could solder the chips directly onto the board.  We chose to use the sockets in case we burn out a chip.

We then soldered all of the remaining capacitors.  Be careful you read which ones are which.

Ours were colored exactly the opposite of the ones in the tutorial.

You should have 3 three 100uF capacitors and 2 47uF capacitors and these are polarized.

8/28/10

Motor Shield Done

All done soldering the motor shield.

Good thing I had extra headers as I botched a few in cutting them.

Now to upload a sketch and test the shield.

8/29/10

Motor Test

I had an extra small motor lying around and the robotic platform came with this plastic five AA battery holder.

Wired the motor to M1 and hooked the battery pack to the external power source (make sure the positive and negative go in correctly).

Used a 9 volt battery to power the Arduino. Then I downloaded the AFmotor library from Adafruit and used the sample sketch MotorTest.

Yahoo – it works! This verifies that I made the motor shield correctly.  Also note the small green LED goes on when you hook up the AA battery five pack.

8/30/10

Robomount 1Robomount 2Robomount 3

Now we have assembled the wheels and base of the robot.

It is pretty straightforward.

Use the longs screws to mount the motors onto the base.

8/31/10

Robot SideRobot Top

I have added the 2 main parts together, using a 9 volt battery to power the Arduino and shield and the 5 AA battery pack that came with the robot kit.

I tested the robot with the Motor Test example sketch included with the AFMotor library.

Since this sketch only has one motor, I doubled it up and added a second motor.

For example, where it says:

motor.run(FORWARD);

I changed it to:

motorL.run(FORWARD);

motorR.run(FORWARD);

Where MotorL is the left motor and MotorR is the right motor.  See the entire test code here.

So far it works great except for the left motor doesn’t go backwards. This will need some investigation.

I also discovered I have a Sharp GP2Y0A21 Distance Sensor I would like to try and use, but will have to figure out how they work.

We have a working robot!

9/19/10

Did some re-soldering and adjusting.

Moved a motor from M1 to M3 and now both motors go forward as well as backwards.

Now to get the Sharp sensor to work properly so we don’t bump into things.

9/21/10

It isn’t pretty and has a bad hairdo, but it works.

The robot can detect objects and back up!

10/17/10

Using a Maxbotix EZ1 Sonar Range finder as the main front sensor.

Switched the 9 volt battery powering the Arduino to an AA 4 pack as I want to add more sensors.

Also got some cheap ($6.95) Sharp GP2Y0D805ZoF sensors from Pololu.

Working on adding them as bump sensors as they detects objects between 0.8 and 5 cm (0.2″ and 4″) away.

10/17/10

New and improved video with obligatory electronic music courtesy of Devegoo.  Of course the song is called Android Online.

Three sensors in the front and one in the back.

10/21/10

Arduino code

1/23/11

Here is a more complete parts/price list.  You may be able to find the parts elsewhere or at a better price.

1. Motor Shield from Adafruit – $19.50 Allows you to control the motors easily.

2. Arduino from Adafruit – $30.00 The brains of the operation.

3. Robot Platform from Make – $45.00 Wheels, motors and the actual platform.

4. Maxbotix Range Finder From Pololu – $24.95 You could certainly buy a cheaper sensor, like this Sharp Distance Sensor for $9.95, but we had the Range Finder.

5. 9 Volt Battery Holder from Adafruit – $4.00 This is ok for powering the Arduino to start with, but if you add a lot of sensors you will need more amps than a 9 volt battery can supply.

6. Some other miscellaneous stuff you might need – 5 AA batteries, 1  9 volt battery,  extra hookup wire, an extra on/off switch, LEDs (We used a green one for when the robot when forward and a red one for when it backs up)

2/14/11

Also check out our four wheeled robot.

6/10/11

Robot Living reader Daniel G has made a robot as well. Nice Job Daniel.
 
Daniel’s robot onYouTube
See Daniel’s code here.

Share

13 Comments

  1. Comment by yuveer:

    thanks dude. got my motors running at a higher voltage and they seem to be going well. cheers

  2. Comment by Chief Robot:

    No, I did not use PWM directly. The shield from Adafruit uses a motor library.
    See the link to the rest of my code up above.
    Here is where I set up the motors

    #include
    //AF_DCMotor motor(2, MOTOR12_64KHZ); // create motor #2
    //frequency is how fast the speed controlling signal is.
    //For motors 1 and 2 you can choose MOTOR12_64KHZ, MOTOR12_8KHZ, MOTOR12_2KHZ, or MOTOR12_1KHZ.
    //A high speed like 64KHz wont be audible but a low speed like 1KHz will use less power.

    AF_DCMotor motorL(1, MOTOR12_1KHZ);
    AF_DCMotor motorR(2, MOTOR12_1KHZ);

  3. Comment by yuveer:

    Ok thanks
    I am using the same motors as you – they with the 2WD Arduino Platform so the specs are the same as yours. Unless my motors are damaged somehow.
    I have managed to get my motors to spin but the problem is that they give “weird errors” when i try to control the speed via PWM.
    Does PWM work fine with your motors? My goal is to get the PWM speed control right.

    Yuveer

  4. Comment by Chief Robot:

    I’m using the motor shield from Adafruit which appears to use the L293D motor driver chip.
    http://www.adafruit.com/products/81.

    4 H-Bridges: L293D chipset provides 0.6A per bridge (1.2A peak) with thermal shutdown protection, internal kickback protection diodes. Can run motors on 4.5VDC to 36VDC.

    Probably powered between 7 -8 volts (whatever the 6 AA batteries supply).
    I don’t know what regulators I’m using. All I’m doing is placing the motor shield onto the Arduino. The motor shield handles all of those requirements and is very easy to use.
    The most important factor here is what motors are you using and what are the specs and or do you have the datasheet?

  5. Comment by yuveer:

    Hi Chief Robot
    I am using 5 rechargeable batteries (2700 mAh) which produce a voltage of 6.5V. I am using one battery pack to power both the microcontroller and the motors. I guess this is a bad idea, and i will try to use 2 separate power supplies and see if that works.

    I use an L293E motor driver and when I tell my motors to spin clockwise, all they do is “whistle”, even though i measure 3V accross the motor terminals. I think its the single power supply causing the problem.

    Was hoping you could answer the following questions:
    What is the your total battery output voltage?
    What voltage are you running your motors at: 3V or 6V?
    Are you using linear regulators or switching regulators?
    Are you using any particular motor driver? (like an L293E perhaps?)

    I’d REALLY appreciate it if i you could provide me with some kind of schematic of your power supply and motors. I have been struggling to get this to work on my 2WD arduino platform for the last 2 weeks and its driving me crazy.

    Best Regards,
    Yuveer

  6. Comment by Chief Robot:

    The motors should use their own power supply.
    I am using a separate power supply of 6 AA batteries just for the motors.
    Hope that helps.

  7. Comment by yuveer:

    Hi
    The motors which come with the robot platform are giving me some problems. They keep “whistling” when i power them via a motor controller.
    Please could you provide a schematic of your power supply for this robot.

    Regards,
    Yuveer

  8. Comment by Alex B:

    Looks like the Maker Shed robot is a DFRobot platform, I found these assembly pictures helpful http://www.dfrobot.com/wiki/index.php?title=3_Powered_Arduino_(3PA)_Assembly_Guide_(SKU:ROB0005)

  9. Comment by keerthi:

    hello,
    could we get those parts required for this bot??????? the cost of it?

  10. Comment by Chief Robot:

    I’m not sure what size 340 is. Here are the motor specs:
    2WD Mobile platform Motors: 3-6V DC
    Speed: 70cm/S
    Dimensions: 170mm (diameter)

    Gear Ratio 1:120
    No-load speed(3V):100RPM
    No-load speed(6V):200RPM
    No-load current(3V):60mA
    No-load current(6V):71mA
    Stall current(3V):260mA
    Stall current(6V):470mA
    Torgue (3V): 1.2Kgcm
    Torque (6V): 1.92Kgcm
    Size: 55mm x 48.3mm x 23mm
    Weight:45g

  11. Comment by Felix Just Hawk:

    Hi I got one question, is the motors 340 size?? I realy need to know, so i ask PLEASE respond fast. Thx Felix

Leave a Reply