Project tutorial

Quadruped Robot © GPL3+

Make your own quadruped robot with Arduino, 3D-printed, and Lego-compatible parts.

  • 7,721 views
  • 2 comments
  • 27 respects

Components and supplies

Necessary tools and machines

3drag
3D Printer (generic)
09507 01
Soldering iron (generic)

Apps and online services

About this project

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.

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.

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.

Materials

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

  • Frame, 5x7 module
  • Gear, 40-tooth
  • Gear, 24-tooth
  • Gear, 20-tooth and double bevel
  • Bevel gear, 12-tooth
  • Gear, 8-tooth
  • Beam, 9-module
  • Beam, 5-module
  • Beam, 3-module

Angular beam, 3x5 module

  • Angular beam, 3x5 module

Axle, 7-module

K2) Axle, 6-module

K3) Axle with stop, 4-module

  • K4) Axle, 3-moduleAxle, 7-moduleK2) Axle, 6-moduleK3) Axle with stop, 4-module

Bushing/axle extender, 2-module

  • Bushing/axle extender, 2-module

T-Beam, 3x3 module

  • T-Beam, 3x3 module

Angular block 2, 180°

  • Angular block 2, 180°
  • Connector peg with friction, 3-module

Connector peg with friction, 2-module

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

  • Connector peg with friction, 2-moduleP2) Connector peg with friction/axle, 2-module
  • Beam with cross hole, 2-module

Double cross block, 3-module

  • Double cross block, 3-module
  • Bushing, 1-module
  • Axle and pin connector perpendicular
  • Connector peg with axle, 2-module
  • Bushing, 1/2 module
  • Angular block 1, 0°
  • Axle connector with axle hole
  • Angular block, 6 (90°)

Liftarm, 2 x 4 L-Shape Thick

Z2) Universal Joint 3L

Z3) Axle, 2-module

  • Liftarm, 2 x 4 L-Shape ThickZ2) Universal Joint 3LZ3) 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.

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.

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.

Code

Quadruped Robot quick startC/C++
/*
  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);
}

Schematics

Quadruped Robot Circuit Schematic
Quadruped ti3kgvwfyc

Comments

Similar projects you might like

A DIY Tangible Coding Robot

Project tutorial by Tart Robotics

  • 2,519 views
  • 1 comment
  • 10 respects

A DIY Zipline Robot with Arduino, Lego, and 3D Printed Parts

Project tutorial by Tart Robotics

  • 4,731 views
  • 2 comments
  • 23 respects

A DIY Remote-Controlled Rescue Robot with Arduino and Lego

Project tutorial by Tart Robotics

  • 3,979 views
  • 2 comments
  • 13 respects

Amazing 6WD Off-Road Robot | Arduino RC Robot

Project tutorial by Jithin Sanal

  • 21,280 views
  • 1 comment
  • 82 respects

Scriba Robot - A Printing Robot

Project in progress by RobinB

  • 7,293 views
  • 1 comment
  • 18 respects
Add projectSign up / Login