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

Arduino UNO Controlled Quadruped Spider Robot with IR Remote

Image of Arduino UNO Controlled Quadruped Spider Robot with IR Remote

Circuit Documentation

Summary

This circuit is designed to control a quadruped spider robot using an Arduino UNO microcontroller. The robot features multiple servo motors for leg movement and an IR receiver for remote control operation. The Arduino UNO is interfaced with an Arduino Sensor Shield v5.0 to simplify the connection of servos and sensors. Power is managed by two sets of 18650 Li-ion batteries connected to an LM2956 Buck Converter DC-DC to regulate the voltage supplied to the components. The IR receiver allows the robot to interpret commands from a remote control, enabling it to move forward, sideways, or perform a greeting action.

Component List

  • Arduino UNO: A microcontroller board based on the ATmega328P, featuring digital and analog I/O pins.
  • Tower Pro SG90 Servo: A small and lightweight servo motor suitable for robotic applications.
  • Arduino Sensor Shield v5.0: An expansion board that allows for easy connection of sensors and servos to the Arduino UNO.
  • LM2956 Buck Converter DC-DC: A step-down voltage regulator that converts higher voltage to a lower voltage.
  • IR Receiver: A module that receives and decodes infrared signals from a remote control.
  • 18650 Li-ion Battery x 2: A pair of rechargeable batteries providing power to the circuit.

Wiring Details

Arduino UNO

  • 5V: Provides power to the Arduino Sensor Shield v5.0.
  • GND: Connected to the negative terminal of the 18650 Li-ion Battery x 2 and the Arduino Sensor Shield v5.0.
  • Vin: Connected to the positive terminal of the 18650 Li-ion Battery x 2.
  • SCL: Connected to the IIC-SCL pin on the Arduino Sensor Shield v5.0 for I2C communication.
  • SDA: Connected to the IIC-SDA pin on the Arduino Sensor Shield v5.0 for I2C communication.

Tower Pro SG90 Servo

  • Signal: Connected to the corresponding signal pins on the Arduino Sensor Shield v5.0.
  • +5V: Connected to the corresponding +5V pins on the Arduino Sensor Shield v5.0.
  • GND: Connected to the corresponding GND pins on the Arduino Sensor Shield v5.0.

Arduino Sensor Shield v5.0

  • SD-VCC: Receives 5V from the Arduino UNO.
  • SD-GND: Connected to the GND on the Arduino UNO.
  • IIC-SCL: Connected to the SCL pin on the Arduino UNO.
  • IIC-SDA: Connected to the SDA pin on the Arduino UNO.
  • VCC: Receives regulated voltage from the LM2956 Buck Converter DC-DC.
  • GND: Connected to the GND of the LM2956 Buck Converter DC-DC.

LM2956 Buck Converter DC-DC

  • OUT+: Provides regulated voltage to the VCC pin on the Arduino Sensor Shield v5.0.
  • OUT-: Connected to the GND pin on the Arduino Sensor Shield v5.0.
  • IN+: Connected to the positive terminal of the 18650 Li-ion Battery x 2.
  • IN-: Connected to the negative terminal of the 18650 Li-ion Battery x 2.

IR Receiver

  • DATA: Connected to the 12-S pin on the Arduino Sensor Shield v5.0.
  • VCC: Connected to the 12-V pin on the Arduino Sensor Shield v5.0.
  • GND: Connected to the 12-G pin on the Arduino Sensor Shield v5.0.

18650 Li-ion Battery x 2

  • +: One set connected to the Vin pin on the Arduino UNO, and the other set to the IN+ pin on the LM2956 Buck Converter DC-DC.
  • -: Connected to the GND pin on the Arduino UNO and the IN- pin on the LM2956 Buck Converter DC-DC.

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 IR receiver. The setup() function configures the IR receiver and attaches the servo objects to their respective pins. The loop() function listens for IR signals and calls the appropriate movement functions based on the received command. The movement functions moveForward(), moveLeft(), moveRight(), and sayHello() control the servos to perform the robot's movements.