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

Arduino UNO Bluetooth-Controlled Robotic Arm with Servo Motors and DC Motors

View and Edit Project In Cirkit DesignerImage of Arduino UNO Bluetooth-Controlled Robotic Arm with Servo Motors and DC Motors

Circuit Documentation

Summary

This circuit is designed to control multiple servos and DC motors using an Arduino UNO microcontroller. It includes a Bluetooth module for wireless communication, a DC motor driver for controlling the motors, and a DC buck step-down converter for power regulation. The circuit is powered by a 12V battery.

Component List

  1. Arduino UNO

    • Description: Microcontroller board based on the ATmega328P.
    • 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
  2. XL4015 5A DC Buck Step-down

    • Description: DC-DC buck converter for voltage regulation.
    • Pins: Output +, Output -, Input +, Input -
  3. HC-05 Bluetooth Module

    • Description: Bluetooth module for wireless communication.
    • Pins: Key, VCC, GND, TXD, RXD, State
  4. L298N DC Motor Driver

    • Description: Dual H-Bridge motor driver for controlling DC motors.
    • Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, 5V-ENA-JMP-I, 5V-ENA-JMP-O, +5V-J1, +5V-J2, ENA, IN1, IN2, IN3, IN4, ENB
  5. Servo

    • Description: Servo motor for precise control of angular position.
    • Pins: gnd, vcc, pulse
  6. Battery 12V

    • Description: 12V battery for powering the circuit.
    • Pins: +, -
  7. DC Motor

    • Description: DC motor for rotational motion.
    • Pins: pin 1, pin 2

Wiring Details

Arduino UNO

XL4015 5A DC Buck Step-down

HC-05 Bluetooth Module

L298N DC Motor Driver

Servo

Battery 12V

DC Motor

Documented Code

Arduino UNO Code

#include <Servo.h>

Servo motor_1;
Servo motor_2;
Servo motor_3;
Servo motor_4;
Servo motor_5;

#define enA 5  //Enable1 L298 Pin enA 
#define in1 A3 //Motor1  L298 Pin in1 
#define in2 A2 //Motor1  L298 Pin in1 
#define in3 A1 //Motor2  L298 Pin in1 
#define in4 A0 //Motor2  L298 Pin in1 
#define enB 5  //Enable2 L298 Pin enB 

int servo1 = 90;
int servo2 = 110;
int servo3 = 40;
int servo4 = 50;
int servo5 = 90;

int bt_data;
int Speed = 255;

void setup(){
  
  Serial.begin(9600); // initialize serial communication at 9600 bits per second:
  
  motor_1.attach(8);
  motor_2.attach(9);
  motor_3.attach(10);
  motor_4.attach(11);
  motor_5.attach(12); 
  
  motor_1.write(servo1); 
  motor_2.write(servo2); 
  motor_3.write(servo3); 
  motor_4.write(servo4); 
  motor_5.write(servo5); 
  
  pinMode(enA, OUTPUT); // declare as output for L298 Pin enA 
  pinMode(in1, OUTPUT); // declare as output for L298 Pin in1 
  pinMode(in2, OUTPUT); // declare as output for L298 Pin in2 
  pinMode(in3, OUTPUT); // declare as output for L298 Pin in3   
  pinMode(in4, OUTPUT); // declare as output for L298 Pin in4 
  pinMode(enB, OUTPUT); // declare as output for L298 Pin enB
  
  delay(1000);
}

void loop(){
  //if some date is sent, reads it and saves in state
  
  if(Serial.available() > 0){     
    bt_data = Serial.read(); 
    Serial.println(bt_data);
    if(bt_data > 20){Speed = bt_data;}      
  }
  
  analogWrite(enA, Speed); // Write The Duty Cycle 0 to 255 Enable Pin A for Motor1 Speed 
  analogWrite(enB, Speed); // Write The Duty Cycle 0 to 255 Enable Pin B for Motor2 Speed 
  
  if(bt_data == 1){forword(); }  // if the bt_data is '1' the DC motor will go forward
  else if(bt_data == 2){backword();}  // if the bt_data is '2' the motor will Reverse
  else if(bt_data == 3){turnLeft();}