Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

Arduino-Controlled Quadruped Spider Robot with IR Remote Interaction

Image of Arduino-Controlled Quadruped Spider Robot with IR Remote Interaction

Circuit Documentation

Summary

This circuit is designed to control a quadruped spider robot with multiple servo motors per leg. It uses an Arduino UNO as the main microcontroller, interfaced with an Arduino Sensor Shield v5.0 for easy connection to various peripherals. The circuit includes a number of Tower Pro SG90 servos that actuate the robot's legs, an IR receiver for remote control input, and a power supply system consisting of 9V batteries and a buck converter to regulate the voltage. The Arduino UNO is programmed to interpret IR signals from a remote control and command the servos to move the robot in different directions or perform specific actions.

Component List

Microcontroller

  • Arduino UNO: A microcontroller board based on the ATmega328P, with a variety of digital and analog I/O pins.

Power Supply

  • 9V Batteries: Two 9V batteries provide power to the circuit.
  • LM2956 Buck Converter DC-DC: A buck converter that steps down voltage from the 9V battery to a regulated 5V output for the servos and sensor shield.

Actuators

  • Tower Pro SG90 Servos: Small servo motors that control the movement of the robot's legs. There are multiple instances of this component in the circuit.

Sensors

  • IR Receiver: An infrared receiver that captures signals from a remote control to command the robot.

Shields

  • Arduino Sensor Shield v5.0: An expansion board that allows for easy connection of sensors and actuators to the Arduino UNO.

Wiring Details

Arduino UNO

  • 5V to Sensor Shield SD-VCC
  • GND to Sensor Shield SD-GND and 9V Battery -
  • Vin to 9V Battery +
  • SCL to Sensor Shield IIC-SCL
  • SDA to Sensor Shield IIC-SDA

Arduino Sensor Shield v5.0

  • VCC from LM2956 Buck Converter OUT+
  • GND from LM2956 Buck Converter OUT-
  • Various Signal Pins (S) connected to the signal pins of the Tower Pro SG90 servos
  • Various Voltage Pins (V) connected to the +5V pins of the Tower Pro SG90 servos
  • Various Ground Pins (G) connected to the GND pins of the Tower Pro SG90 servos

Tower Pro SG90 Servos

  • Signal connected to corresponding Sensor Shield signal pins
  • +5V connected to corresponding Sensor Shield voltage pins
  • GND connected to corresponding Sensor Shield ground pins

IR Receiver

  • DATA to Sensor Shield 12-S
  • VCC to Sensor Shield 12-V
  • GND to Sensor Shield 12-G

LM2956 Buck Converter DC-DC

  • IN+ to 9V Battery +
  • IN- to 9V Battery -
  • OUT+ to Sensor Shield VCC
  • OUT- to Sensor Shield GND

Documented Code

/*
 * This Arduino sketch controls a quadruped spider robot with 3 servo motors
 * per leg, using an IR receiver to interpret commands from a remote control.
 * The robot moves forward if the up arrow is pressed, sideways if the left or
 * right arrow is pressed, and says hello with one leg if the number 1 is
 * pressed.
 */

#include <Servo.h>
#include <IRremote.h>

#define FORWARD 0xFF629D
#define LEFT 0xFF22DD
#define RIGHT 0xFFC23D
#define HELLO 0xFF6897

const int RECV_PIN = 12;
IRrecv irrecv(RECV_PIN);
decode_results results;

Servo servos[12];

void setup() {
  irrecv.enableIRIn();
  for (int i = 0; i < 12; i++) {
    servos[i].attach(i);
  }
}

void loop() {
  if (irrecv.decode(&results)) {
    switch (results.value) {
      case FORWARD:
        moveForward();
        break;
      case LEFT:
        moveLeft();
        break;
      case RIGHT:
        moveRight();
        break;
      case HELLO:
        sayHello();
        break;
    }
    irrecv.resume();
  }
}

void moveForward() {
  for (int i = 0; i < 12; i++) {
    servos[i].write(90);
  }
  delay(1000);
  for (int i = 0; i < 12; i++) {
    servos[i].write(0);
  }
  delay(1000);
}

void moveLeft() {
  for (int i = 0; i < 6; i++) {
    servos[i].write(90);
  }
  delay(1000);
  for (int i = 0; i < 6; i++) {
    servos[i].write(0);
  }
  delay(1000);
}

void moveRight() {
  for (int i = 6; i < 12; i++) {
    servos[i].write(90);
  }
  delay(1000);
  for (int i = 6; i < 12; i++) {
    servos[i].write(0);
  }
  delay(1000);
}

void sayHello() {
  servos[0].write(90);
  delay(1000);
  servos[0].write(0);
  delay(1000);
}

This code is designed to run on the Arduino UNO microcontroller. It initializes an array of 12 Servo objects and an IRrecv object for receiving IR signals. In the setup function, it enables the IR receiver and attaches the servos to their respective pins. The loop function continuously checks for IR signals and calls the appropriate movement function based on the received command. The movement functions (moveForward, moveLeft, moveRight, sayHello) command the servos to move in patterns that correspond to the robot's forward, left, right movements, and a greeting action, respectively.