Project tutorial

A DIY Biped Robot with Arduino, Lego, and 3D Printed Parts © GPL3+

Make your own walking humanoid robot out of Lego and 3D printed parts powered by Arduino Nano, off-the-shelf DC gear-motor and NeoPixel LED.

  • 471 views
  • 0 comments
  • 2 respects

Components and supplies

Ard nano
Arduino Nano R3
×1
1586 00
Adafruit NeoPixel Ring: WS2812 5050 RGB LED
You can also use any other type of WS2812 LED rings. We recommend using an 8-LED ring.
×1
11026 02
Jumper wires (generic)
×1
4765634
Toggle Switch, (On)-Off-(On)
Optional.
×1
L298N mini dual DC motor driver
You can also use any other type of DC dual-driver motors like TB6612FNG or L298.
×1
TT DC 1:120 gear-motor
×1
Screw M3 30mm
×2
Lock nut m3
×2
mini breadboard
×1
Omron b3f 1000 image 75px
SparkFun Pushbutton switch 12mm
Any other type of pushbutton is okay.
×1

Necessary tools and machines

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

Apps and online services

About this project

Introduction

Making Biped robots that can mimic human walking has always been the focus of scientists, makers, and inventors for many years. In fact, biped robots are mobile robots with articulated leg mechanisms that provide locomotion. To compare with wheeled robots, they can go upstairs and pass on obstacles, although, at a slower speed. Building humanoid biped robots have always been difficult due to the high number of joints and maintaining stability during walking. If you have no academic knowledge on forward, inverse kinematics, and control engineering, it is absolutely no problem. In this tutorial, we are going to make a fun and easy-to-build biped robot with Lego components, an Arduino board, and some off-the-shelf electrical components (Fig. A). The instructions are prepared in a way that you can build them at home.

Fig. A – General view of biped robot

In this project, the biped robot uses an interesting mechanical mechanism that mimics human walking with only one DC gear motor. The result is quite interesting.

In this tutorial, we will make the structure of the body and the leg mechanisms of the biped robot using Lego Technic parts. Then, one DC gear motor will drive the leg mechanism through bevel and spur gear trains (Fig. B).

In the next step, we will add an Arduino Nano as the brain of the biped. Arduino Nano uses a small-size powerful microprocessor that makes it suitable for low-weight and small-size projects (Fig. C).

Various off-the-shelf motors, sensors, and shields can be easily connected to Arduino boards. This feature enables us to do a variety of tasks with the biped. For instance, you can tell the biped to move back and forth and dance by programming the Arduino board.

Materials

  • 1x TT Gear Motor
  • 1x 3D Printed Gear Motor Housing
  • 1x BreadBoard, Mini Size
  • 1x Arduino Nano
  • 1x Neo Pixel LED Ring
  • 1x Power Jack
  • 1x 3D Printed Lego-Compatible Coupling
  • 1x L298N Mini Motor Driver
  • 1x Push button
  • 1x M3 x 30 Machine Screw
  • 2x M3 x 25 Machine Screw
  • Male to Male Jumper Wire
  • Frame, 5x7-module
  • Double bevel gear, 36-tooth
  • Bevel gear, 12-tooth
  • Beam, 9-module
  • Beam, 5-module
  • Beam, 3-module
  • Angular beam, 3x5 module
  • Bushing, 1-module
  • Axle, 8-module
  • Angular block 2, 180°
  • Double cross block, 3-module
  • Beam with cross hole, 2-module
  • Axle with stop, 4-module
  • Beam, 3-module
  • Axle, 2-module
  • Connector peg with friction/axle, 2-module
  • Connector peg with axle, 2-module
  • Tube, 2-module
  • Connector peg with bushing, 3-module
  • Connector peg with friction, 3-module
  • Connector peg with friction, 2-module
  • Axle connector with axle hole
  • Angular block 1, 0°

Assembly of mechanical parts

Let's start assembling the biped's body-structure and leg mechanisms. The leg mechanism consists of a parallelogram mechanism that is driven by a four-bar linkage mechanism (Fig. F). Prepare Lego Technic pieces according to Fig. E, and follow the step-by-step video tutorial below.

Mechanical Parts Assembly Tutorial

3D printed parts

Lego Technic components only match with LEGO gear motors. In order to transmit power from the shafts of the off-the-shelf gear motors to Lego gears or axles, we need to print a housing for the gear motor as well as a coupling. The housing will serve as an interface or an adaptor between the gear motor and the Lego Technic beams. The coupling connects the gear motor shaft to the Lego Technic axle. These 3D printed parts are called Lego compatible housing and shafts (Fig. G and Fig. H). We have also created front and back body covers for the robot. The back cover look likes the oxygen capsule and protects the electronic part. The front cover acts similar to an armor (Fig. I). Please download the 3D files and print the motor housing, Lego-compatible coupling, and covers with your 3D printer or use the ones in a maker space nearby.

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. J, so you don't end up toasting your Arduino board and motor driver.

Electrical Parts Assembly Tutorial

Programming

You can pick up LEGO 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 biped what to do. But for now, let's start with this code.

#include <Adafruit_NeoPixel.h>
#define PIXELSPIN A1 // Which pin on the Arduino is connected to the NeoPixels?
#define NUMPIXELS 8 // How many NeoPixels are attached to the Arduino?
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIXELSPIN, NEO_GRB + NEO_KHZ800);
#define M1 A4
#define M12 A5
#define button A3
int buttonNew;
int buttonOld = 1;
int Motorstate = 0;
void setup() {
// Initialize Arduino pins to outputs
pinMode(M1, OUTPUT);
pinMode(M12, OUTPUT);
pinMode(button, INPUT_PULLUP);
// This initializes the NeoPixel library.
pixels.begin();
for (int i = 0; i < 9; i++) {
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255.
pixels.setPixelColor(i, pixels.Color(0, 0, 0));
// This sends the updated pixel color to the hardware.
pixels.show();
}
}
void loop() {
buttonNew = digitalRead(button);
if (buttonOld == 0 && buttonNew == 1) {
if (Motorstate == 0)
{
// bright blue color.
pixels.setPixelColor(1, pixels.Color(0, 0, 250));
pixels.setPixelColor(2, pixels.Color(0, 0, 250));
pixels.setPixelColor(3, pixels.Color(0, 0, 250));
pixels.setPixelColor(5, pixels.Color(0, 0, 250));
pixels.setPixelColor(6, pixels.Color(0, 0, 250));
pixels.setPixelColor(7, pixels.Color(0, 0, 250));
pixels.show();
// Motor run.
digitalWrite(M1, HIGH);
digitalWrite(M12, LOW);
delay(1000);
digitalWrite(M12, HIGH);
digitalWrite(M1, LOW);
delay(1000);
Motorstate = 1;
} else {
for (int i = 1 ; i < 8 ; i++)
{
pixels.setPixelColor(1, pixels.Color(0, 0, 0)); // Neopixel off.
pixels.show();
}
// Motor stop.
digitalWrite(M1, HIGH);
digitalWrite(M12, HIGH);
Motorstate = 0;
}
}
buttonOld = buttonNew;
}

Run your biped

Complete Biped

Please let us know what you think about this tutorial by commenting below. Your feedback will help us to improve our future work.

Code

Biped Demo Arduino CodeC/C++
With this code, your robot starts and stops walking by pressing a button.
/*
  Bipedal Walking Robot
    The idea:
    In this project, the robot starts and stops walking when a button is pressed on
    its back. There's also the robot's eye which is an Adafruit Neopixel 
    controllable color RGB LED ring.
    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 Tart Robotics blog for more information:
    https://www.tartrobotics.com/blog
*/


#include <Adafruit_NeoPixel.h>
#define PIXELSPIN A1 // Which pin on the Arduino is connected to the NeoPixels?
#define NUMPIXELS 8  // How many NeoPixels are attached to the Arduino?
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIXELSPIN, NEO_GRB + NEO_KHZ800);

#define M1 A4
#define M12 A5
#define button A3

int buttonNew;
int buttonOld = 1;
int Motorstate = 0;

void setup() {
  // Initialize Arduino pins to outputs
  pinMode(M1, OUTPUT);
  pinMode(M12, OUTPUT);
  pinMode(button, INPUT_PULLUP);
  // This initializes the NeoPixel library.
  pixels.begin();

  for (int i = 0; i < 9; i++) {
    // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255.
    pixels.setPixelColor(i, pixels.Color(0, 0, 0));
    // This sends the updated pixel color to the hardware.
    pixels.show();
  }
}

void loop() {
  buttonNew = digitalRead(button);
  if (buttonOld == 0 && buttonNew == 1) {
    if (Motorstate == 0)
    {
      // bright blue color.
      pixels.setPixelColor(1, pixels.Color(0, 0, 250)); 
      pixels.setPixelColor(2, pixels.Color(0, 0, 250));
      pixels.setPixelColor(3, pixels.Color(0, 0, 250));
      pixels.setPixelColor(5, pixels.Color(0, 0, 250));
      pixels.setPixelColor(6, pixels.Color(0, 0, 250));
      pixels.setPixelColor(7, pixels.Color(0, 0, 250));
      pixels.show();
      // Motor run.
      digitalWrite(M1, HIGH);
      digitalWrite(M12, LOW);
      delay(1000);
      digitalWrite(M12, HIGH);
      digitalWrite(M1, LOW);
      delay(1000);
      Motorstate = 1;
    } else {
      for (int i = 1 ; i < 8 ; i++)
      {
        pixels.setPixelColor(1, pixels.Color(0, 0, 0)); // Neopixel off.
        pixels.show();
      }
      // Motor stop.
      digitalWrite(M1, HIGH);
      digitalWrite(M12, HIGH);
      Motorstate = 0;
    }
  }
  buttonOld = buttonNew;
}

Schematics

Electrical Circuit Assembly
This is the basic electrical circuit assembly. You can enhance this by adding different Arduino modules and sensors.
Biped wiring diagram ezzl4ahene

Comments

Similar projects you might like

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

Project tutorial by Tart Robotics

  • 1,695 views
  • 0 comments
  • 9 respects

Make a BBot Robot Step by Step

Project tutorial by makersecrets

  • 1,673 views
  • 0 comments
  • 7 respects

WW2 Tank Laser Tag Sherman & Panther

Project tutorial by Arduino “having11” Guy

  • 20,485 views
  • 1 comment
  • 61 respects

WiFi Robot

Project tutorial by Kartik

  • 5,394 views
  • 1 comment
  • 15 respects

How to Make a Walking Robot

Project tutorial by MEGA DAS

  • 2,468 views
  • 0 comments
  • 10 respects

DIY 3-Axis CNC VMC

Project tutorial by Amit Nandi (BigWiz)

  • 28,474 views
  • 11 comments
  • 101 respects
Add projectSign up / Login