Tart Robotics

Subscribe to our Newsletter

You can subscribe to get the latest news, product updates, offers and more from Tart Robotics.

December 09, 2020 by Tart Robotics

Quadruped Robot

Quadruped Robot with Arduino, 3D printed, and Lego-compatible parts

Introduction

Legged robots have always been one of the most interesting creations in the robotic industry as they could help us in exploring mysterious lunar caves and other space exploration missions. In fact, legged robots are mobile robots with articulated leg mechanisms that provide locomotion on rough trains. As compared with wheeled robots, they can move on different terrains, although at a slower speed.

Legged robots are often complicated to be made and controlled, as it requires precise control of each leg to maintain its balance. In this project, we are aiming to make a fun and easy-to-build four-legged robot with Lego-compatible and an Arduino board (Fig. A).

To do so, we take advantage of interesting mechanical mechanisms that simulate the walking pattern of a real animal, with only one DC gear motor. The result is quite interesting.

Fig. A – General view of the Quadruped robot


In this tutorial, we will make the body and the leg mechanisms of the robot using Lego-compatible parts. Then, an off-the-shelf DC gear motor will be connected to the leg mechanism to move the legs.

In the next step, we will need to add a brain to our robot to control its motions. Therefore, we will use Arduino Nano as an intelligent brain (Fig. B). Arduino enables us to expand our Quadruped’s possibilities with various commercially available motors and sensors.

Fig. B - An Arduino Nano board

To enhance the performance of the robot, we used an ultrasonic sensor as the eyes of the robot (Fig. C). By using the ultrasonic sensor, the robot can avoid obstacles. Thanks to the open-source nature of the Arduino board that allows such developments.

Fig. C - An Ultrasonic sensor as the eyes of the robot

Materials

Fig. D - Electronic and electromechanical components

  1. TT Gear Motor
  2. 3D Printed Gear Motor Housing
  3. 1x Arduino Nano
  4. 1x Breadboard, Mini Size
  5. 1x Power Jack, Barrel Type
  6. 1x Ultrasonic Sensor
  7. 3D Printed Lego-compatible Coupling
  8. 1x MOSFET
  9. 1x M3 x 25 Machine Screw
  10. 2x M3 x 10 Machine Screw

 

 

Fig. E - Lego-compatible components

  1. Frame, 5x7 module
  2. Gear, 40-tooth
  3. Gear, 24-tooth
  4. Gear, 20-tooth and double bevel
  5. Bevel gear, 12-tooth
  6. Gear, 8-tooth
  7. Beam, 9-module
  8. Beam, 5-module
  9. Beam, 3-module
  10. Angular beam, 3x5 module

     

  11. Axle, 7-module

    K2) Axle, 6-module

    K3) Axle with stop, 4-module

    K4) Axle, 3-module
  12. Bushing/axle extender, 2-module

  13. T-Beam, 3x3 module

  14. Angular block 2, 180°

     

  15. Connector peg with friction, 3-module
  16. Connector peg with friction, 2-module

    P2) Connector peg with friction/axle, 2-module

  17. Beam with cross hole, 2-module
  18. Double cross block, 3-module

  19. Bushing, 1-module
  20.  Axle and pin connector perpendicular
  21. Connector peg with axle, 2-module
  22. Bushing, 1/2 module
  23. Angular block 1, 0°
  24. Axle connector with axle hole
  25. Angular block, 6 (90°)
  26. Liftarm, 2 x 4 L-Shape Thick

    Z2) Universal Joint 3L

    Z3) Axle, 2-module

Assembly of mechanical parts

Let’s start off by assembling the body structure and leg mechanisms of the Quadruped robot. The body structure holds everything together, including the gears, Legs, and electronics. Prepare the Lego-compatible pieces according to Fig. E, and follow the step-by-step video tutorial below.

3D printed parts

In order to hold the DC gear motor in place and make a proper connection to the Lego-compatible pieces, we have used custom-designed, Lego-compatible, 3D printed motor housings and shaft couplings (Fig. F). Download and print out the motor housings, couplings. Then prepare the required Lego-compatible parts from Fig. E, and follow the step-by-step mechanical assembly tutorial.

Fig. F - 3D printed Lego-compatible DC gear motor coupling and housing

Electronics and wiring

Prepare your screwdriver and soldering iron and carefully follow the video instructions below. Make sure you properly implement the schematic circuit diagram shown in Fig. G so you don't end up toasting your Arduino board and motor driver.

Fig. G - Schematic diagram of the Quadruped robot circuit

Programming

You can pick up Lego-compatible pieces and let your imagination go limitless. Of course, coding is also the part that you can have lots of fun and be the most creative. You can go to Arduino IDE and write your own code to tell the Quadruped robot to do. But for now, let's start with this code.

/*
  Quadruped robot
    The idea:
    In this project, we will show you how to make a  quadruped robot out of Lego-compatible pieces,
    Arduino boards, off-the-shelf DC motor, and ultrasonic sensor.
    The current project uses an Arduino Nano boards as the main controller of the
    robot.
    The circuit:
    - In this circuit, an Arduino Nano is used. Any other types of Arduino
    can be used of course but do not forget to change the pin configurations
    if you want to change the circuit on your preference.
    Visit the Tart Robotics blog for more information:
    https://www.tartrobotics.com/blog
*/

#define VCC 4            // This pin define as Vcc
#define TRIG 5           // Ultrasonic sensor Trig pin
#define ECHO 6         // Ultrasonic sensor Echo pin
#define GND 7           // This pin define as GND
#define MOTOR 3      // Motor pin

const int dist = 15;     // Desired distance in cm

float duration, distance;

void setup() {
  pinMode(TRIG, OUTPUT);
  pinMode(ECHO, INPUT);

  pinMode(VCC, OUTPUT);
  pinMode(GND, OUTPUT);

  digitalWrite(VCC, HIGH);
  digitalWrite(GND, LOW);
  delay(5000);
}

void loop() {
//  This section is related to Ultrasonics sensor
/*
 digitalWrite(TRIG, LOW);
 delayMicroseconds(2);
 digitalWrite(TRIG, HIGH);
 delayMicroseconds(10);
 digitalWrite(TRIG, LOW);
 duration = pulseIn(ECHO, HIGH);
 distance = (duration * .0343) / 2;
  if (distance < dist)
    analogWrite(MOTOR, 200);
  else
    analogWrite(MOTOR, 0);
  delay(50);
*/

  analogWrite(MOTOR, 200);
}

You are all set. Your robot is ready to go.

 

 

 

⟵ Previous post

Comments

Please sign in to post a comment

Sign in

Stay tuned!

You can subscribe to get the latest news, product updates, offers and more from Tart Robotics.