Here we will document our attempt to build a 2 wheeled robot.
Parts received and the unpacking begins!
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.
Now to make the motor shield kit. First check the instructions here and make sure you have all the parts.
Here I have soldered the resistors and ceramic capacitors.
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.
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.
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.
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.
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.
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:
I changed it to:
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!
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.
It isn’t pretty and has a bad hairdo, but it works.
The robot can detect objects and back up!
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.
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.
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.
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)
Also check out our four wheeled robot.