Tart Robotics
Published © GPL3+

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

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.

BeginnerFull instructions provided2 hours9,228

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1
NeoPixel Ring: WS2812 5050 RGB LED
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
Jumper wires (generic)
Jumper wires (generic)
×1
Toggle Switch, (On)-Off-(On)
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
Pushbutton switch 12mm
SparkFun Pushbutton switch 12mm
Any other type of pushbutton is okay.
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
3D Printer (generic)
3D Printer (generic)

Story

Read more

Schematics

Electrical Circuit Assembly

This is the basic electrical circuit assembly. You can enhance this by adding different Arduino modules and sensors.

Code

Biped Demo Arduino Code

C/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;
}

Credits

Tart Robotics

Tart Robotics

15 projects • 51 followers
Our mission is to provide children with novel robotic tools, to inspire them to become future innovators.

Comments