Introduction

The ArduPed Biped Robot is a simple Arduino-based walking robot designed for students, beginners, and robotics hobbyists. It uses multiple servo motors to move its legs and an ultrasonic sensor to detect obstacles. When an obstacle is detected, the robot automatically changes direction.

This project helps students learn:

  • Robotics basics
  • Arduino programming
  • Servo motor control
  • Ultrasonic sensor interfacing

The robot mimics human walking motion using two legs, making it a great STEM educational project

Component Required

Main electronics used in the ArduPed robot:

  • Arduino Nano / Compatible Board
  • 5 × SG90 Micro Servo Motors
  • HC-SR04 Ultrasonic Sensor
  • 3D Printed Robot Body Parts
  • On/Off Rocker Switch
  • Jumper Wires
  • 2 × 3.7V Li-Po Batteries (or 5V power supply)
  • Screws and Nuts for assembly

The servo motors control the legs and head movement, while the ultrasonic sensor detects obstacles and sends distance data to the Arduino.

Pin Connection

Ultrasonic Sensor Connections

Sensor Pin Arduino Nano
VCC 5V
GND GND
TRIG D9
ECHO D10

Servo Motor Connections

Servo Arduino Pin
Left Hip Servo D2
Left Leg Servo D3
Right Hip Servo D4
Right Leg Servo D5
Head Servo D6

Power:

  • Servo motors → External 5V supply
  • Arduino → Battery / USB

Circuit Diagram

Arduino Code

#include <Servo.h>

Servo servo1;
Servo servo2;
Servo servo3;
Servo servo4;
Servo servo5;

int trigPin = 9;
int echoPin = 10;

long duration;
int distance;

void setup() {

servo1.attach(2);
servo2.attach(3);
servo3.attach(4);
servo4.attach(5);
servo5.attach(6);

pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);

Serial.begin(9600);
}

void loop() {

digitalWrite(trigPin, LOW);
delayMicroseconds(2);

digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);
distance = duration * 0.034 / 2;

Serial.println(distance);

if(distance < 20)
{
// obstacle detected
servo1.write(90);
servo2.write(45);
servo3.write(90);
servo4.write(45);
delay(500);
}
else
{
// walking motion
servo1.write(60);
servo2.write(120);
servo3.write(60);
servo4.write(120);
delay(500);

servo1.write(120);
servo2.write(60);
servo3.write(120);
servo4.write(60);
delay(500);
}
}

Working Principal

  1. The ultrasonic sensor measures distancein front of the robot.
  2. Arduino processes the distance data.
  3. If no obstacle is detected → robot walks forward.
  4. If obstacle detected → robot changes motion pattern.