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

Arduino Mega-Controlled Robotic Arm with Servos and Solenoid Actuators

View and Edit Project In Cirkit DesignerImage of Arduino Mega-Controlled Robotic Arm with Servos and Solenoid Actuators

Circuit Documentation

Summary

The circuit in question is designed to control multiple servomotors, a solenoid, and a motor driver module using an Arduino Mega 2560 microcontroller. The servomotors are likely used for precise movement or positioning, while the solenoid is an electromechanical device that can be used for actuation or locking mechanisms. The motor driver module interfaces with the microcontroller to control the speed and direction of a motor. The circuit is powered by a combination of 18650 Li-ion batteries and a 12V battery, which suggests that the system is designed for portable or remote applications where a mains power supply is not available.

Component List

Microcontroller

Actuators

Power Sources

Motor Driver

Miscellaneous

Wiring Details

Arduino Mega 2560

Servomotor MG995

Solenoid

Cytron

18650 Li-ion Battery x 2

Battery 12V

Documented Code

Arduino Mega 2560 Code

#include "CytronMotorDriver.h"
#include <Servo.h>

#define grabber1 22 // right grabber
#define grabber2 26 // left grabber

Servo servo1; // platform servo 25 Kg (right)
Servo servo2; // left
Servo servo3; // linkage servo 60kg (right)
Servo servo4; // left
Servo servo5; // path servo 15 kg (right)
Servo servo6; // left
int pos1 = 0; // platform servo
int pos2 = 0; // linkage servo
int pos3 = 0; // path servo
CytronMD motor1(PWM_DIR, 3, 4);

void Rock() // function for loading sapling to grabbers and travel them up to hold and convey
{
  digitalWrite(grabber1, 1);
  digitalWrite(grabber2, 1);
  Serial.print("Plants has been grabbed");
  Serial.println();
  delay(500);

  for (pos1 = 0; pos1 <= 90; pos1 += 1) // platform servo controller
  {
    servo1.write(pos1);
    servo2.write(pos1);
    delay(10);
  }
  delay(100);
  Serial.print("platform has moved up");
  Serial.println();
  for (pos2 = 0; pos2 <= 90; pos2 += 1) {
    servo3.write(pos2);
    servo4.write(pos2);
    delay(15);
  }
  delay(400);
  digitalWrite(grabber1, 0);
  digitalWrite(grabber2, 0);
  Serial.print("plants have been released");
  Serial.println();
}

void lock() {
  for (pos1 = 90; pos1 >= 0; pos1 -= 1) {
    servo1.write(pos1);
    servo2.write(pos1);
    delay(10);
  }
  delay(100);
  Serial.print("The platform has shifted to down");
  Serial.println();

  for (pos2 = 90; pos2 >= 0; pos2 -= 1) {
    servo3.write(pos2);
    servo4.write(pos2);
    delay(15);
  }
  delay(500);
  Serial.print("Grabbers has returned to loading position");
  Serial.println();
}

void setup() {
  servo1.attach(6);
  servo2.attach(7);
  servo3.attach(8);
  servo4.attach(9);
  servo5.attach(10);
  servo6.attach(11);
  pinMode(grabber1, OUTPUT);
  pinMode(grabber2, OUTPUT);
  Serial.begin(9600); // initializing serial monitor at 9600 baud rate for knowing the processing going on
  Serial.print("make sure that every servo should be at zero position");
  Serial.println();
}

void loop() {
  Serial.print("let's lock and Rock");
  Serial.println();

  Rock();

  for (pos3 = 0; pos3 <= 90; pos3 += 15) {
    servo5.write(pos3);
    servo6.write(pos3);
    delay(100);
  }
  Serial.print("The path has been changed to another slot");
  Serial.println();
  lock();
  delay(500);
  Rock();
  for (pos3 = 90; pos3 >= 0; pos3 -= 15) {
    servo5.write(pos3);
    servo6.write(pos3);
    delay(100);
  }
  motor1.setSpeed(255);
  delay(100); // delay will be dependent on time required to move tray by 3.9 cm with actuator
  motor1.setSpeed(0);
  lock();
  delay(500);
}

Cytron Code

void setup() {
  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
}

This concludes the documentation for the provided circuit design and embedded code.