Introduction: Turtle 2WD Robot
In this how to we will show you how to make a Turtle Robot from DFRobot. The robot is programmable through the Arduino IDE or it can be controlled via Bluetooth. You will need the complete Turtle Kit , small phillips & flathead screwdrivers, 5 AA batteries. Optional are extra batteries and holder for servo, a smartphone for Bluetooth control and the bluetooth app GoBLE.
Step 1: Software Setup
To start, you should get your software setup first. You will need the Arduino IDE and the Metro library. The Servo library is already included in the Arduino IDE. The Metro library link has the examples Platform and URM37andServo included. URM37andServo will test only the servo, where as the Platform example will test the whole robot. We also suggest using a file called MotorTest that just tests the motors.
Make sure you put the Metro library in your Arduino/libraries folder. Then take all three files, MotorTest, URM37andServo and Platform and put them in a folder called something like Turtle Bot. Then put the Turtle Bot folder inside your Arduino folder. Now open the Arduino IDE and make sure you can access the example files and compile them. Once this is set up and working, you can go on to building the robot base.
Step 2: Platform Setup
Now we can start setting up the robot base. First we will take the bottom plate and add the two motors. Use the longer A4 screws along with the regular washer, the locking washer and the nut . Attach the first motor as shown in the photos. Now attach the second motor in the same manner.
Next add the caster to the front of the platform with the A5 screws and nuts. Then go ahead and push the wheels on to the nubs sticking out from the motors.
Now let's add the sensor mounting grill with the A6 screws and nuts.
Next we will add the battery holder with only the A7 flat head screws.
Set this aside and we will now work on the top plate.
Step 3: Top Plate
In the kit they give you an on/off switch and a power plug. We attached them as we may want them for future use but you do not need them to make the robot work.
Screw a nut and special locking washer onto the switch top. Insert the switch from the bottom of the top plate and attach it with another nut on top. Use a washer and nut to attach the power plug.
You also get 3 sensor brackets with the kit but they are also not needed now. You can attach them later if you add more sensors. You can see them in one of the images.
Now we need to attach the stand offs to the top plate. This will keep the main ROMEO BLE board from touching the top plate. Attach the standoffs with a screw on the bottom as shown in the third photo. Test fit the ROMEO BLE board to make sure it fits onto the standoffs. Don't attach the board just yet though.
First, attach the top plate to the bottom chassis by using 4 screws as in photo 5. Now attach the board to the standoffs.
Step 4: Motor Hookup
Now feed the motor and battery holder wires up through the middle hole closest to the power plug. Using the flathead screwdriver, connect motor the wires to the green plugs labeled M1, M2 and the battery holder wires the the third plug next to the on/off switch. Make sure the switch is off.
Also make sure you have the motor selection pins on the correct positions. For mine I put the selection jumpers on E1 and E2 to get it to work. See corner of the board below the DFRobot logo.
At this point you can plug the board into your computer and upload the motor test code. Remember to select Uno as the board under Tools / Board. You should see the wheels spin slowly forward. The caster side of the robot is the front. Now unplug the board from your computer. Illustration from the DFRobot Turtle Wiki.
Next we will work on the servo motor and sensor.
Step 5: Servo & Sensor
First we want to insert the rubber rings onto the servo bracket.
Then take the long rectangular servo horn and screw the sensor bracket onto it. On the sensor bracket, use the longer holes on either side of the large center hole and the small self starting screws.
One extra note is that we used a Dremel tool to file down the ends of the screws to make sure they had enough clearance over the servo. This is most likely not need, just an extra precaution.
Now insert the sensor from the backside. Don't be afraid to push a little hard to get it into the rubber rings. You should now have something like the fourth image.
Mount Servo
Insert the servo motor into the rectangular hole above the battery holder. Screw it into place using the A6 screws. There are 4 screw holes but we only used the 2 in front as the back ones were too hard to reach.
Then thread your servo wires up through the same hole you used for the motor wires. Attach the wires to the column 4th from the left. Brown goes to ground, red goes to power and yellow goes to green.
Sensor
Now you will need 4 hookup wires. Get a blue wire and attach it to the COMP/TRIG pin on the sensor. Attach a green wire to PWM, a black wire to ground or GND and a red wire to power or +5V.
Push the sensor onto the plastic nub sticking up from the servo with the sensor facing forward. Connect the blue wire to pin 10 and the green wire to green pin 3. Then connect GND to black pin GND and +5V to red pin PWR.
Your robot should now look like the last photo. If have a twist tie you could tidy up the wires a bit.
Now go back to your computer and open the servo test sketch. Now plug the robot into your computer but be careful. You will need to pick up the robot as you should still have the motor test sketch installed. You could also place the robot on a book or piece of tupperware to get the wheels off of your table or desk. Upload the servo sketch and test it. If it is not moving, double check your wiring. Also see the DFRobot Turtle Wiki.
You may also need to adjust the mounting of the sensor on the servo so that it is sweeping the same amount on the right and left sides.
Step 6: Extras
DFRobot suggest adding an extra power supply for just the servo motor, so I did that as I had one. I wired up the switch they gave us to a 5 AA battery pack. Keep in mind they servo needs 4.8 – 6 V power. I tested my battery pack and since they were not fully charged I was at 5.5 volts, so good to go.
The GND wire goes directly from the battery pack to GND on the green servo terminal. The red positive wire goes to one end pole on the switch . Another red wire goes from the middle pole on the switch the the positive servo terminal. I soldered the wires on and added heat shrink for protection.
Bluetooth / Smartphone Control
Get the code and libraries needed on Github. Make sure to put the libraries in your Arduino library folder. Download the GoBLE app for your iPhone. Open the code called GoBLE_APP in Arduino and upload it to your board. Unplug the board from your computer and turn it on. Open the GoBLE app on your and it should pair automatically. If it doesn’t, look for a Bluetooth connection called Bluno. Once connected use the circle on the left like a joystick.
Also see the 3 videos. The first one is Turtle Bot in autonomous mode, the second is using Bluetooth and an iPhone and the third video is Chef Bot ready to help in the kitchen.
See more diy, soldering tips at The Soldering Station