Instructables
Picture of TurtleDuino Object Avoidance Robot
DSCF0349.JPG
Hello, in this instructable I'll be showing you step by step how to build the TurtleDuino, an object avoidance robot, with an Arduino UNO microcrontroller on board. I designed the TurtleDuino using material from the hardware store (Home Depot) and all the electronics from sparkfun.com and jameco.com.


Shopping List:
  • Arduino UNO      (Sparkfun.com)
  • Ultrasonic Ping))) Sensor      (jameco.com) 
  • 2 Larg Servo motors continuous rotation  (sparkfun ROB-09347)
  • 1 Medium Servo Motor 180 Degrees rotation (sparkfun ROB-10333)
  • Breadboard  (sparkfun PRD-09567)
  • Jumper Wires (sparkfun PRD-11026)
  • SPST toggle switch (sparkfun COM-09276)
  • 22 AWG hookup wire (sparkfun PRD-08023)
  • Servo Motor Extensions (sparkfun ROB-08738)
  • 9v battery plug jack for Arduino (sparkfun PRY-09518)
  • 9v battery holder (optional)
  • 9v battery
  • 4 AA batteries
  • Breakaway headers-long (sparkfun PRT-10158)
  • An old R/C car's wheels
  • 2 Large servo mounts

Home depot:

  • 1/2" in. 45 degrees pvc pipe (Turrtle"s neck)  (in electrical)
  • 1/2" in. pvc one hole conduit snap strap or a conduit clamp  (to support the turtle"s neck) (in electrical)
  • 2" in. Service Entrance Cap (turtle"s shell) (in electrical)
  • 1" in. Service Entrance Cap (turtle"s head) (in electrical)
  • Liquid electrical  tape (in electrical)
  • Hot glue gun kit (in tools)
  • Solder kit (in tools)

Hardware section

  • 3/8"x6x24" Craft Board  (to make the base of the turtle)
  • #6-32x1" machine screws (about 20)
  • #6 flatwashers (small bag)
  • #6x1/2" sheet metal screws (to attach neck bracket, front wheels, and shell to the base)
  • #4x1/2" sheet metal screws (to attach servos and arduino to the base) (small bag)
  • #6 nuts (small bag) , 4 #6-32x2" long bolts (to attach head to neck and the ping servo to head)
  • 90 degrees angle corner plate
  • 2" painting brush (for the cool mohawk)  (in paint)

 

 
Remove these adsRemove these ads by Signing Up
bowhunter6168 months ago
I noticed you modified the front suspension. I'm assuming that was due to turning issues from the original design. I'm building a similar robot with my son. We are still in the initial design phase and I'm foreseeing turning issues once we begin production. What did you do to fix this issue?
Asus178 months ago
Hi, I wanted to make turtleduino, how much does it cost I mean details.
robdavinci (author)  Asus178 months ago
$70.00 in electronic components. And at about $20 in material.
infanati1 year ago
Hi, I started on a project using IR sensors but for some reason my servos only keep moving forward even if the sensor detects an object ahead. I checked the code and it seems to be fine. the connections are according to the codes. so im not quite sure whats going on there. any ideas?
Here is the code if anyone can see anything wrong please let me know.


#include // Include servo library

Servo servoLeft; // Declare left and right servos
Servo servoRight;

void setup() // Built-in initialization block
{
pinMode(10, INPUT); pinMode(9, OUTPUT); // Left IR LED & Receiver
pinMode(3, INPUT); pinMode(2, OUTPUT); // Right IR LED & Receiver

tone(4, 3000, 1000); // Play tone for 1 second
delay(1000); // Delay to finish tone

servoLeft.attach(13); // Attach left signal to pin 13
servoRight.attach(12); // Attach right signal to pin 12
}

void loop() // Main loop auto-repeats
{

int irLeft = irDetect(9, 10, 38000); // Check for object on left
int irRight = irDetect(2, 3, 38000); // Check for object on right

if((irLeft == 0) && (irRight == 0)) // If both sides detect
{
maneuver(-200, -200, 20); // Backward 20 milliseconds
}
else if(irLeft == 0) // If only left side detects
{
maneuver(200, -200, 20); // Right for 20 ms
}
else if(irRight == 0) // If only right side detects
{
maneuver(-200, 200, 20); // Left for 20 ms
}
else // Otherwise, no IR detects
{
maneuver(200, 200, 20); // Forward 20 ms
}
}

int irDetect(int irLedPin, int irReceiverPin, long frequency)
{
tone(irLedPin, frequency, 8); // IRLED 38 kHz for at least 1 ms
delay(1); // Wait 1 ms
int ir = digitalRead(irReceiverPin); // IR receiver -> ir variable
delay(1); // Down time before recheck
return ir; // Return 1 no detect, 0 detect
}

void maneuver(int speedLeft, int speedRight, int msTime)
{
// speedLeft, speedRight ranges: Backward Linear Stop Linear Forward
// -200 -100......0......100 200
servoLeft.writeMicroseconds(1500 + speedLeft); // Set left servo speed
servoRight.writeMicroseconds(1500 - speedRight); // Set right servo speed
if(msTime==-1) // if msTime = -1
{
servoLeft.detach(); // Stop servo signals
servoRight.detach();
}
delay(msTime); // Delay for msTime
}
IR sensor to servo.png
timgordon1 year ago
Is there a circuit diagram for this project?
robdavinci (author)  timgordon1 year ago
Hello timgordon, here is a Fritzing diagram, I hope it helps. (step8)
robdavinci (author)  timgordon1 year ago
No, but I'll upload one soon.
ufang1 year ago
i can hear the electricity from motor but it doesn't drive.
the servo motor also just repeat turn left and right and forward.
robdavinci (author)  ufang1 year ago
Check all your ground wires. All ground wires should be connected together, including the one from the arduino ground pin. Also, use another power source to drive your motors do not use the arduino.Two power source one for the Arduino and one for your motors.
ufang1 year ago
the codes are not completed, right?
robdavinci (author)  ufang1 year ago
The code is complete.
i have try the codes but seems that the motor doesn't work as expect.
robdavinci (author)  ufang1 year ago
I am going to load the code to a similar project I'm working on and see what happens. what happens to the motor? and which motor? Do they (motors) turn to the same direction?
ufang1 year ago
i have try the codes but seems that the motor doesn't work as expect.
That is freaking adorable.
robdavinci (author)  Marcaine Art2 years ago
I'm glad you find it adorable, I had a hard time deciding whether the mohawk will make it look good or kind of cheesy. But like Megaduty wrote the mohawk gave the Turtlrduino some style.
the drive wheels been in the middle with a little stump at back and front to allow a little bit of tipping would work much better
robdavinci (author)  dasimpson19812 years ago
That's a good idea, that would it make it more interesting.
megaduty2 years ago
That bot's got style! Voted for ya!
robdavinci (author)  megaduty2 years ago
Thank you for voting.
TekoMuto2 years ago
I once made a codpeice out of the part you used for the shell! nice job! :)
robdavinci (author)  TekoMuto2 years ago
thank you!
R.A.T.M2 years ago
Yeah only a couple hundred dollars
robdavinci (author) 2 years ago
Yes, Marvin The Martian. I got the idea from Dan M. in letsmakerobot.com blog.
Don't foget to vote for TurtleDuino in the Arduino contest. Thank you.
Foxtrot702 years ago
WOW!!! Great project! The Mohawk brush on top adds a comical flare to the TurtleDuino. It reminds me of a robot type that "Marvin The Martian" would have takes me back to by childhood and Bugs Bunny.