Crawling robot

This small robot can crawl. It is all it can do, and it is not very good at it. But it is super cute and great fun.

Materials


  • 1 Arduino Uno board
  • 1 Education Shield
  • 2 standard servos
  • 8 AA batteries
  • 1 AA battery holder
  • 1 power plug
  • Crawling robot kit

Instructions

  1. Attach the shield onto the top of the Arduino board
  2. Assemble the crawling robot.
  3. Turn the servo by hand until it reaches the end. Then separate and place the servo arm in the same direction of the length of the servo. Do this on both servos, front and rear.
  4. Mount each motor in its hole and attach the clown legs to the servo axes.  

  5. Connect a servo to D9. Connect the other servo to D10.
  6. Connect the assembly to the computer and upload example ‘CrawlingRobot’.
  7. Disconnect your Arduino from the computer and place it in the body of the crawling robot.
  8. Place the batteries in the battery holder and connect it to the Arduino power socket.

Code

Find the code in File>Examples>EducationShield>Block4-Robots>Projects>CrawlingRobot

How it works

  • The EducationShield and Servo libraries are included.
  • The Servo objects are declared.
  • In setup(), the Servo objects are initialized.
  • The front servo position is set to 110 degrees.
  • The program pauses for 200 milliseconds.
  • The back servo position is set to 70 degrees.
  • The program pauses for 200 milliseconds.
  • The front servo position is set to 70 degrees.
  • The program pauses for 200 milliseconds.
  • The back servo position is set to 110 degrees.
  • The program pauses for 200 milliseconds.
  • loop() continues to loop.

Troubleshooting

  • Refer to the illustration and double check your connections. Make sure the shield and jumper wires are firmly connected.
  • The servos might not be working. Test if it works when the Arduino is plugged into the computer instead of the battery. If it is, try changing the battery.
  • If it is still not working, make sure you have connected the servos properly. See the standard servo referencefor debugging.

Learn by doing

  • If you want the robot to take bigger or smaller steps, change the angles.
  • If you want the robot to crawl faster or slower, try changing the delay time.
  • See in how many different ways you can make the robot crawl and which one is the most effective.