[vc_row][vc_column][vc_tta_tour][vc_tta_section title=”Bluetooth Robot Arm + App | Arduino & Android” tab_id=”1472820541430-70b7a1ec-3a6a”][vc_column_text]
As of summer 2016, it had been a little more than a year since I had started programming. What I used to do was mostly little projects using LEDs, LCDs, sensors, etc, that required a few hours of work.
But this summer, I thought I should do a more concrete project, that would require me to work for multiple weeks, during which I would learn a lot more skills.
Building a robotic arm was great, but I wouldn’t learn a lot… So I decided to build it and also create an app to control it, because I had never created any app, nor any Java program.
The app is for Android and works using Bluetooth.
In this Instructable, I will show you how I did and how to do it.
Let’s learn !
[/vc_column_text][/vc_tta_section][vc_tta_section title=”Step 1: How it works” tab_id=”1472820541516-b2d95e8e-a638″][vc_column_text]
The structure of the arm is made of Legos, but because you certainly don’t own the same bricks as me, I didn’t design any plan, or any guidelines to build it. However, you can see the overall on the pictures.
In this Instructable, I describe all the electronics and code.
The arm has 4 servos, including one for the claw, all connected to an Arduino Uno.
In the app, there are 6 arrow buttons, and 3 normal buttons.
The ‘Start’ button initializes the Bluetooth.
The arrow buttons send a byte to the Arduino via Bluetooth when they are pressed, and another byte when released.
When the Arduino receives a byte, the corresponding servo starts moving in a direction, and stops when the other byte is received.
For the claw, there are 2 buttons: ‘Open’ and ‘Close’.
When you press ‘Close’, a byte is sent and the servo of the claw writes an angle closing it.
Opposite for the ‘Open’ button.
I may upload a video of the arm soon.
[/vc_column_text][/vc_tta_section][vc_tta_section title=”Step 2: Components and tools needed” tab_id=”1472820658678-fdbe24e4-77c7″][vc_column_text]For this project you need:
– an Arduino Uno,
– a permanent breadboard,
– male/male & male/female jumper wires,
– 4 servos,
– a Bluetooth module (HC-05),
– an Android phone,
– Legos or custom 3D printed parts,
– a soldering iron and solder,
– some hot glue,
– eventually tighteners to fix the servos to the structure,
– Android Studio (because my app is not available on the Play Store),
– the Arduino software.[/vc_column_text][/vc_tta_section][vc_tta_section title=”Step 3: Robot Arm: circuit” tab_id=”1472820701068-5dcc301e-fab2″][vc_column_text]
Here is a Fritzing sketch of the electronic circuit of the arm.
[/vc_column_text][/vc_tta_section][vc_tta_section title=”Step 4: Fix the motors to the structure” tab_id=”1472820758891-b77d1f22-df17″][vc_column_text]
I hot glued the servos to the main structures and their horn to the moving parts of the structure. For more strenght and durability, I added tighteners (see photo).
For the claw. I attached 2 strings to the horn, connected to a part of the claw. With gears on each part of the claw, when one moves, the other one does the same (see video).
[/vc_column_text][/vc_tta_section][vc_tta_section title=”Step 5: Robot Arm : code” tab_id=”1472820806950-ca8185f8-9846″][vc_column_text]
Here is the code of the arm that goes in the Arduino.
[/vc_column_text][/vc_tta_section][vc_tta_section title=”Step 6: The app ” tab_id=”1472820843048-47cb90ea-544c”][vc_column_text]
The files of the app are available on GitHub.
Please not that you have to press the ‘Start’ button 2 times in order for the phone to connect to the BT module. I may solve this later.
[/vc_column_text][/vc_tta_section][vc_tta_section title=”Step 7: The development process” tab_id=”1472820886874-4ab3346b-dc87″][vc_column_text]Because this was a big project for me, I had to separate the development in several parts:
First, I developed the arm, but even this had to be developed in different parts.
First, I built the Lego structure.
Then, I developed the claw, activated by push-buttons, and then activated by a serial command (first video). On this video, you can see that the claw doesn’t close well, but I solved it later during the development process.
After the claw, I developed the ‘shoulder’ and ‘elbow’ of the arm.
I assumed that the app would send a continuous flow of bytes, so during the development, it would work with continuous press push-buttons (second video).
Then I developed the app. I had to learn a lot about Java, the Android environment, etc.
First, I designed it in the WYSIWYG interface of Android Studio (What You See Is What You Get), then I programmed the Bluetooth setup and finally the buttons.
But as it turned out, I couldn’t send a continuous stream of data via Bluetooth, so I programmed it to send single bytes, and reprogrammed the Arduino with single press push-buttons.
After a little more than a month of work…. It worked!
Thanks a lot to people on StackOverflow, Android Forums and the Arduino Forum for their help when I needed some, especially about Android development.
Thanks also to OpenClassrooms, a great French website where I learned Java and the basics of Android.[/vc_column_text][/vc_tta_section][vc_tta_section title=”Section” tab_id=”1472820933810-fec29815-5d1c”][vc_column_text]http://www.instructables.com/id/Bluetooth-Robot-Arm-App-Arduino-Android/step7/The-development-process/[/vc_column_text][/vc_tta_section][/vc_tta_tour][/vc_column][/vc_row]
Leave a Reply
You must be logged in to post a comment.