Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Controlled Robotic Arm with Multiple Motors and Servos

View and Edit Project In Cirkit DesignerImage of Arduino UNO Controlled Robotic Arm with Multiple Motors and Servos

Circuit Documentation

Summary

This circuit involves an Arduino UNO microcontroller, multiple DC motors, servos, a 9V battery, a 5V battery, resistors, diodes, capacitors, and NPN transistors. The Arduino UNO controls the servos and motors, while the power is supplied by the batteries. The circuit also includes various passive components to ensure proper operation and protection of the active components.

Component List

  1. Micro servo 9G

    • Pins: GND, +5V, PWM
    • Description: A small servo motor used for precise control of angular position.
  2. DC Motor

    • Pins: pin 1, pin 2
    • Description: A motor that converts electrical energy into mechanical motion.
  3. Arduino UNO

    • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
    • Description: A microcontroller board based on the ATmega328P.
  4. MG996R

    • Pins: GND, VCC, SIG
    • Description: A high-torque servo motor.
  5. 9V Battery

    • Pins: -, +
    • Description: A battery providing 9V power supply.
  6. 5V Battery

    • Pins: positive, negative
    • Description: A battery providing 5V power supply.
  7. Electrolytic Capacitor

    • Pins: -, +
    • Description: A capacitor with a capacitance of 0.01 Farads.
  8. Resistor

    • Pins: pin1, pin2
    • Description: A resistor with a resistance of 270 Ohms.
  9. Diode

    • Pins: cathode, anode
    • Description: A diode used for current direction control.
  10. NPN Transistor (EBC)

    • Pins: emitter, base, collector
    • Description: A transistor used for switching and amplification.

Wiring Details

Micro servo 9G

DC Motor

Arduino UNO

MG996R

9V Battery

5V Battery

Electrolytic Capacitor

Resistor

Diode

NPN Transistor (EBC)

Code Documentation

#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>

// Initialize the PWM driver
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();

void setup() {
  pwm.begin();
  pwm.setPWMFreq(60);  // Set the frequency to 60 Hz
}

void loop() {
  // Example: Turn servo on channel 0 to the middle position
  pwm.setPWM(0, 0, 2048);
  delay(1000);
  
  // Turn servo on channel 0 to the minimum position
  pwm.setPWM(0, 0, 409);
  delay(1000);
  
  // Turn servo on channel 0 to the maximum position
  pwm.setPWM(0, 0, 3687);
  delay(1000);
}

This code initializes the PWM driver and sets the frequency to 60 Hz. In the loop, it moves a servo connected to channel 0 to three different positions: middle, minimum, and maximum, with a delay of 1 second between each movement.