App Controlled Robotic Arm (Blynk)

19K9820

Intro: App Controlled Robotic Arm (Blynk)

Control your robotic arm with an Android phone for less than $4 using the Blynk app.

After I 3d printed and assembled my EEZYbotARM robotic arm, I needed an effective and easy way to control it. The best method I found was to control it wirelessly using Blynk and my Android device. Blynk is an application for both IOS and Android that connects to your Arduino project via bluetooth, wifi, or ethernet. Check out their website here: Blynk. This is a super easy build. Let's get started!

Watch the build and the robot in action here:

STEP 1: Parts and Programs

Needed Hardware

Robotic Arm - This can be any robotic arm. Buy one, print one or build your own. I printed the EEZYbotArm which I would highly recommend.

Arduino Board - I used an Uno, any Arduino compatible board will work.

$4-$25 depending on quality.

4xAA Battery Pack- The Arduino can't provide enough power for all four servos we plan to control. So we use this as an outside power source.

$2

4 SG90 Servos- I used these cheap micro servos. You should use the servos that fit with your robotic arm.

$1.70 each x four servos = $6.80

HC-05 Bluetooth Module- This will allow the wireless connection.

$3

Android Phone- You probably have one of these in your closet. It needs to be able to download apps. No cell service is required.

Breadboard- Used for ground and power connections.

$4

Jumper Wires- For lengthening the servo wires.

$1

Needed Software

Arduino IDE

Blynk App

Needed Libraries

Software Serial

Blynk Library

STEP 2: Schematic

Arduino ------- HC-05

D10 ----------- TX

D11 ----------- RX

GND ---------- GND

5V ------------- VCC

Arduino ------ Base Servo

D6 ------------ Signal

Arduino ------ Forward Servo

D7 ------------ Signal

Arduino ------ Up Servo

D8 ------------ Signal

Arduino ------ Claw Servo

D9 ------------ Signal

4AA Battery Pack ------ Servos (All)

Positive ------- Positive

Negative ----- Negative

Arduino ------ 4AA Battery Pack

GND --------- Negative

STEP 3: Servos

A servo is a precise motor. We can tell it the exact degree we want it to turn. Learn more about servos here: What is a servo. We are using four servos in this project, but some simple changes to the code can allow you to control more or less servos. The servos are very easy to hook up. Servos have three wires each. The darkest wire is ground or negative. The red, middle wire is power or positive. The yellow wire is signal. Connect the darkest wire to the ground of the breadboard. This is the long section with a blue minus at the top. Connect the red wire to the positive part of the breadboard. Finally, the signal wire for each servo will be connected to the Arduino directly. Attach the signal wires of the four servos to pins D6 through D9.

STEP 4: Adding Bluetooth

Bluetooth is a way to transfer information over short distances. Bluetooth doesn't require cell service or internet to be used. In this project, we use the HC-05 unit. Learn more about Bluetooth here: What is Bluetooth. The HC-05 talks to the Arduino using serial communication. The same way the Arduino sends and receives information from the serial monitor. Bluetooth will allow a wireless connection between the Android phone and robotic arm over a short distance.

STEP 5: Building the Blynk App

Download the Blynk app from the Google Play store or the Blynk website here: App Download ensure you download for Android as Apple doesn't allow iPhones to be connected to Arduino via bluetooth. Once the app has been downloaded, you will need to create an account. When creating an account register with a real email. Your app will be emailing you your auth token, needed to control the robot.

Follow the steps below to set up your app or watch the video here:

Click "Create New Project".

Name your project. This can be anything, I named mine "roboarm".

Click under "Choose device" where it says "ESP8266".

Scroll through until you reach Arduino Uno.

Click the OK button.

Click under "Connection Type" where it says "WiFi".

Scroll through until you reach "Bluetooth".

Click the OK button.

Click "Create Project".

Click the nut icon.

Click "email" - this will send your auth code to your email. You will need this when coding.

Click anywhere on the dotted screen a secondary screen will appear.

Choose Slider L.

Repeat the process to make three more sliders.

You should now have four sliders.

Click on your first slider.

A secondary screen will appear.

Name the slider "Base" by clicking on where it says "Slider".

Click where it says "Pin".

Select Virtual and then select V3.

Next to where it now says V3 you should see a 0, a line then a 1023 - This represents the range of the slider.

Click where it says 1023 and change it to 180 - A servo can turn 180 degrees.

Click "OK".

Name the next slider "Forward".

Set it as pin V4 and change the range to 0-180.

Click "OK".

Name the next slider "Up".

Set it as pin V5 and change the range to 0-180.

Click "OK".

Name the final slider "Claw".

Set it as pin V6 and change the range to 0-90 - the claw should only open 90 degrees to avoid breaking.

Click "OK".

Click on the dotted screen again and then scroll down on the secondary screen.

Select Bluetooth.

Once the Arduino is ready, we will need to connect the HC-05 bluetooth module to the app.

Congrats, you just made your custom app!

STEP 6: Upload the Code

The code uses both the Software Serial and Blynk libraries. Links to both can be found on the parts and programs step. The Blynk library walks you through the installation process. Read this to learn how to install the Software Serial library Install A Library. We use the Software Serial library so that the HC-05 bluetooth module can be connected to pins 10 and 11. The Blynk library allows the Arduino to interact with the Blynk app. The code needs one quick change before it can be uploaded. Your auth token from the app you made needs to be included into the code. When you create your app, Blynk will send you an email with the auth token. Copy and paste it into the code in the line below.

char auth[] = "e7c17d6a8ae446cab9975d01d35e46af";

Once you have made this change, you are ready to go! Plug in your Arduino board, select the correct port and click upload.

STEP 7: Putting It All Together

Power on your Arduino. Open up your app and click on the bluetooth module. It will then search for a bluetooth device. It should then show "HC-05" select this and it will prompt you for a password. The password should be 1234. If that does not work, your password is 0000. Once the password in correctly entered, it should say the HC-05 is connected. Make sure both the Arduino is powered and the battery for the servos is on. Click the play button in the top right of your app and you're ready to go!

You now have a way to control your robotic arm wirelessly with an app you created. Show your friends your new robot. Please leave your questions and comments below and vote if you enjoyed!

15 Comments

Hi
I have problem with program. when I put my blynk password and push compiling the error is in the picture

the blynk library is not installed!
hi!
the arm moves alone! I already checked and all the pins are correct! What can it be?
I'm trying to make something very similar with the EEZYBotArm MK3, I'm also using an HM-10 module in a Bluetooth shield. Everytime I try to cannect to my phone it asks for a pin that is not 0000 or 1234 and nobody knows what it is, but when I try to connect with Blynk (Not diectly to the phone) nothing happens and if I look at the serial monitor it says this (in a random order):

[90] Connecting...
[3230] Login timeout
[5230] Connecting...
[8350] Login timeout
[10350] Connecting...
[13470] Login timeout
[15470] Connecting...
[20590] Connecting...
[23710] Login timeout
[25710] Connecting...
[30830] Connecting...
[33950] Login timeout

And just keeps going forever. Can you help me?

Hi

When I connected the bluetooth device Blynk didn't find my HC-05.

hi again, well i'm facing a problem that i used HC-06 instead of HC-05 because i didn't find it in the market and it will take too long to reach me if i bought it online and when pairing the HC-06 on my android phone it says : " Pairing Rejected by BT05" and no request for passcode appears ... any ideas? does the version HC-06 affects ?

hi, does the shematic is true ? because i'm in building process and everything is ready to be wired any accidently errors before wiring it would be appreciated if you tell me b4 :) nice job

The schematic is correct. Have fun building, if you have any questions, put them here. Also throw up a picture when you're done!

hi nice tutorial but when i use the blynk app it keeps saying connecting to your bluetooth module while it is already connected and the arm doesnt move. Any ideas? Thanks.

Make sure you have the bluetooth widget on your screen. Once placed, click it and select your HC-05 unit. Enter the password if prompted (1234 or 0000). It should then connect. Click the play button in the top right of the screen and it should work. I sometimes have trouble with the module and phone disconnecting as well. Try disconnecting and reconnecting the phone and module. Also try moving the sliders around and waiting a few seconds with the modules connected. Hope this helps.

thanks a lot it works vey well

Yes! Thank you for making my build!!

I don't really understand, for the HC-05 you take power from the arduino but you ground it ad the triple-a battery pack. am I missing something? because it seems like there would be no flow of electricity anyhow great project

Also in you're schematic you ground a servo on the power rail...

The servo being grounded on the power rail was an accident. Thanks for catching that. Regarding the bluetooth module, it is powered by the Arduino rather than the outside battery pack. That ground rail features both the ground from the battery pack and from the Arduino.