How to Make a Bluetooth Controlled Robot Arm with Arduino

How to Make a Bluetooth Controlled Robot Arm with Arduino

Hello and welcome back. In this project, we will learn how to make a Bluetooth control robotic arm with Arduino. For that, I have used the Arduino Nano board and PWM servo motor driver. Also, the SriTu Hobby app is used to control the robotic arm. You can download it using the link below.

Also, I used the robotic arm kit and four SG90 servo motors for this project. But you can use any other DIY robotic arm. In this project, I have described this project using the robotic arm kit. But the process is the same. The HC05 Bluetooth module is used for Bluetooth communication.

  • What’s a robotic arm – Read me

OK, let’s do this project step by step. The required components are given below.

Disclosure: These Amazon links are Affiliate links. As an Amazon Associate, I earn from qualifying purchases.

Step 1

Firstly, identify these components.

Step 2

Secondly, assemble the robot arm kit step by step. Use the following project for that.

  • Robotic arm kit assemble — Read

Step 3

Thirdly, connect the servo motors to the PWM servo motor driver and install it side of the robotic arm.

Step 4

Next, place the Arduino Nano board and Bluetooth module on the breadboard. And then, connect these components to the Arduino Nano board. For that, use the circuit diagram below.

How to Make a Bluetooth Controlled Robot Arm with Arduino

Step 5

Now connect the Arduino Nano board to the computer. Then, upload the program to it.

  • Program and circuit diagram — Download
/*Robot arm control with Bluetooth
   
Home Page
*/ #include <Wire.h> #include <Adafruit_PWMServoDriver.h> #include <SoftwareSerial.h> Adafruit_PWMServoDriver srituhobby = Adafruit_PWMServoDriver(); SoftwareSerial getValue(10, 11); // TX , RX #define servo1 0 #define servo2 1 #define servo3 2 #define servo4 3 int S1curntPos = 350;//150 - 600 int S2curntPos = 450;//150 - 600 int S3curntPos = 400;//150 - 600 int S4curntPos = 350;//150 - 600 int S1newPos; int S2newPos; int S3newPos; int S4newPos; void setup() { Serial.begin(9600); getValue.begin(9600); srituhobby.begin(); srituhobby.setPWMFreq(60); srituhobby.setPWM(servo1, 0, S1curntPos); srituhobby.setPWM(servo2, 0, S2curntPos); srituhobby.setPWM(servo3, 0, S3curntPos); srituhobby.setPWM(servo4, 0, S4curntPos); delay(3000); } void loop() { robotArm(); } void robotArm() { if (getValue.available() > 0) { String value = getValue.readString(); if (value.startsWith("S1")) { value = value.substring(3, value.length()); int S1 = value.toInt(); S1 = map(S1, 0, 180, 150, 600); S1 = S1 - S1curntPos; for (int a = 0; a <= S1 ; a++) { delay(10); Serial.println(a); S1newPos = S1curntPos + a; Serial.print("Servo"); Serial.println(S1newPos); srituhobby.setPWM(servo1, 0, S1newPos); } for (int b = 0 ; b >= S1; b--) { delay(10); Serial.println(b); int c = b * -1; S1newPos = S1curntPos - c; Serial.print("Servo"); Serial.println(S1newPos); srituhobby.setPWM(servo1, 0, S1newPos); } S1curntPos = S1curntPos + S1; Serial.print("curntPos:"); Serial.print(S1curntPos); } else if (value.startsWith("S2")) { value = value.substring(3, value.length()); int S2 = value.toInt(); S2 = map(S2, 0, 180, 150, 600); S2 = S2 - S2curntPos; for (int a = 0; a <= S2 ; a++) { delay(10); S2newPos = S2curntPos + a; srituhobby.setPWM(servo2, 0, S2newPos); } for (int b = 0 ; b >= S2; b--) { delay(10); int c = b * -1; S2newPos = S2curntPos - c; srituhobby.setPWM(servo2, 0, S2newPos); } S2curntPos = S2curntPos + S2; } else if (value.startsWith("S3")) { value = value.substring(3, value.length()); int S3 = value.toInt(); S3 = map(S3, 0, 180, 150, 600); S3 = S3 - S3curntPos; for (int a = 0; a <= S3 ; a++) { delay(10); S3newPos = S3curntPos + a; srituhobby.setPWM(servo3, 0, S3newPos); } for (int b = 0 ; b >= S3; b--) { delay(10); int c = b * -1; S3newPos = S3curntPos - c; srituhobby.setPWM(servo3, 0, S3newPos); } S3curntPos = S3curntPos + S3; } else if (value.startsWith("S4")) { value = value.substring(3, value.length()); int S4 = value.toInt(); S4 = map(S4, 0, 180, 150, 600); S4 = S4 - S4curntPos; for (int a = 0; a <= S4 ; a++) { delay(10); S4newPos = S4curntPos + a; srituhobby.setPWM(servo4, 0, S4newPos); } for (int b = 0 ; b >= S4; b--) { delay(10); int c = b * -1; S4newPos = S4curntPos - c; srituhobby.setPWM(servo4, 0, S4newPos); } S4curntPos = S4curntPos + S4; } } }

  • These values depend on the current positions of your robot arm servos. You can change these values as you like.
int S1curntPos = 350;//150 - 600
int S2curntPos = 450;//150 - 600
int S3curntPos = 400;//150 - 600
int S4curntPos = 350;//150 - 600
  • Now, select board and port. After, click the upload button.

Step 6

Next, remove the USB cable and provide an external power supply to this project. For that, use the circuit diagram above.

Step 7

Now, let’s set up the Bluetooth controller app. Follow the below steps for that.

  • First, download and install the SriTu Hobby app from the play store.
  • SriTu Hobby app — Download
  • And then, click the control button and select the Bluetooth robot arm controller. After, click the “connect to device” button.
  • Next, find your device. In this case, location and location permission should be enabled. Now, you can see the green indicator.

Now you can control the robot arm using this remote control. Enjoy this project. The full video guide is below. So, see you in the next project or tutorial.

How to Make a Bluetooth-Controlled Robot Arm with Arduino

Leave a Comment

Your email address will not be published. Required fields are marked *

Shopping Cart
Select your currency
USD United States (US) dollar
EUR Euro
Scroll to Top