กลับไปหน้ารวมไฟล์
arduino-iot-robotic-arm-53dfd4-en.md

This is my first robotic arm with the following features:

I am very happy with the result. Therefore, I would like to share with you my experience and how to build it.

Components & Materials

To build the robot you need:

  • 1 x Arduino Yun (or any Arduino board)
  • 5 x servo motors
  • 1 x 5V charger, min 2.5 A
  • 2 x Led's
  • 2 x resistors, 100 ohm (for red led) and 150 ohm (for blue led), respectively
  • 2 x wood mixing sticks
  • 1 x metallic wire (or similar)
  • 1 x plastic sheet (I took it from a shower gel bottle)
  • 1 x rubber band
  • 2 x small sponges (see left-upper corner)
  • 9 x plastic M3 screws
  • 6 x plastic M2.5 screws
  • 1 x wood plate 3mm (30cm x 50cm should be more than sufficient)
  • 1 x wood glue
  • time for coding

Building the Robot

For building the robot, start by measuring the servos size and checking the servos torque. This will give you an indication about the size of the arms and eventually the size of the robot. In my case, I ordered 2 different micro high-torque servos: first pair and second pair. These can travel up to 140 deg even though they are specified to travel 120 deg. However, I advise to buy 180 deg servos in order to have more travel angle.

For the gripper, there is no need for a high-torque servo. The cheapest micro-servo on ebay can do the job.

Start by cutting the arms as you see in Photo 1. Here, you can be creative, there is no fixed design, you can come up with your own design. Then, build the gripper using one mixing stick cut in half and the plastic sheet as spring return. With wires connected to inner side you can close and open the gripper. For my robot, I used one M3 screw to make the gripper pivot. The gripper pivoting is done by a servo located to the other side of the arm in order to obtain weight balance. The power is transmitted via another mixing stick (see Photo 2, top of the robot).

Next, build the base and the plate that holds the base servo and the Arduino Yun board (or another board). Put everything together and you should have something like in Photo 2.

If you want a better looking design, sand the wood components and paint them (as in Photo 3) with your preferred color. For my robot, I went for a silver color (to mimic metal) with red stripes. The final result is shown in Photo 4.

Software

For the software, I started by making first an interface in Blynk. If you haven't used Blynk before, please check their website on how to do it. Should be very easy and straight-forward.

Note: If you don't have a board that can connect to the internet, don't worry you can still use Blynk with a normal board e.g., Arduino Uno, via the USB port. To do this read here.

Next, let's go to Arduino IDE and write some code. For your convenience, I attached the code, so you can just use it :) To run it you need to do the following:

  • Configure the Arduino Yun board.
  • Install Blynk library in your Arduino IDE by going to Sketch>Include Library>Manage Libraries , search for Blynk and install it.
  • Add the SimpleTimer library in a folder with the name SimpleTimer to your Arduino library folder, usually Arduino\libraries\
  • Add the MotionGenerator library that I wrote, in a folder with the name MotionGenerator to Arduino library folder
  • Compile and upload RobotArm_instructables.ino (Note: don't forget to update your Blynk token)

Note: The MotionGenerator library is an analytical-based solution that will give you smooth nice transitions from one point to another. It allows limitations on the maximum speed and acceleration.

Optional (forward kinematics, see Photo 3 above): For this you need Matlab and Robotics Toolbox. If you have all these set, make sure your robot is connected to Blynk and connected to your computer's USB port. Matlab will collect information from the Arduino via the serial communication. So, make sure to fill in the right COM port in the MainScrip.m. Finally, just run the MainScrip.m.

Note: The robot kinematics are for my own robot. For your robot the dimensions might be different (feel free to adjust in robotKinematicsFcn.m).

Web-Connected Kinematics: IoT Robotic Arm

Building a robotic arm controlled by local potentiometers is neat, but the Arduino IoT Robotic Arm ascends to global telepresence. By ditching the standard Uno for an ESP8266 or Arduino MKR WiFi, you can physically move heavy objects in your room by dragging sliders on a smartphone app while sitting on a completely different continent!

Over-The-Air Variables (Arduino Cloud)

The code does not use analogRead(A0) to control the servos. It uses Cloud Property Variables.

  1. Inside the Arduino IoT Cloud Dashboard, you create 4 huge slider widgets (Base, Shoulder, Elbow, Gripper) spanning 0 to 180.
  2. The thingProperties.h file automatically links these Web Sliders directly into variables in your C++ code!
  3. The Event Triggers: The loop() remains completely empty. Instead, the code utilizes onChange interrupts!
    void onBaseAngleChange() {
      Serial.println("Web Update Received: Moving Base...");
      baseServo.write(baseAngle); // Physically swing the massive gear!
    }
    

Robotic Hardware Integrity

  • NodeMCU ESP8266 or Arduino MKR WiFi 1010.
  • Four MG996R Metal Gear Servos (Do NOT attempt to lift a robotic arm with plastic SG90 servos; the base servo will instantly strip its gears and collapse under the physical torque!).
  • PCA9685 16-Channel PWM Module (Optional, but highly recommended if the ESP8266's internal timer begins to digitally stutter while handling heavy Wi-Fi JSON interrupts!).
  • A 5V 5-Amp External Power Brick (Do NOT power 4 metal servos off USB! It will instantly brown-out the ESP8266 chip and destroy your Wi-Fi connection the second the arm tries to lift an object!).

ข้อมูล Frontmatter ดั้งเดิม

apps:
  - "1x Blynk"
  - "1x MATLAB"
author: "aerdronix"
category: "Motors & Robotics"
components:
  - "1x Arduino Yun"
  - "5x Servos (Tower Pro MG996R)"
description: "Global tele-manipulation! Combine high-torque MG996R servo-kinematics with ESP8266 IoT Cloud infrastructure to build an absolute remote-operated robotic assembly arm controllable from any web dashboard worldwide."
difficulty: "Intermediate"
documentationLinks: []
downloadableFiles:
  - "https://projects.arduinocontent.cc/451086d8-2aa3-4d1b-8e60-dacc6b565775.zip"
  - "https://projects.arduinocontent.cc/451086d8-2aa3-4d1b-8e60-dacc6b565775.zip"
encryptedPayload: "U2FsdGVkX1+I0SPp1IAwvnPfPnd6mtD1CcMO0d2jmRL6S+mgE6ijGEyoiQVsixJ3ScotwBbvmbft9IZuVRqzrENqrUXAloxTCgDLbrS9jd4="
heroImage: "https://cdn.jsdelivr.net/gh/bigboxthailand/arduino-assets@main/images/projects/arduino-iot-robotic-arm-53dfd4_cover.JPG"
lang: "en"
likes: 30
passwordHash: "7f9ab2fc2ffa0378df588d0022d1bacb21561eb80222f3964caadbd50a131e31"
price: 2450
seoDescription: "Arduino IoT Robotic Arm: 5 DOF arm using Arduino Yun, Blynk app, and Matlab for forward kinematics."
tags:
  - "robot arm"
  - "forward kinematics"
title: "Arduino IoT Robotic Arm"
tools: []
videoLinks:
  - "https://www.youtube.com/embed/B4DPD9VfmHA"
  - "https://www.youtube.com/embed/0F-LejtGc24"
  - "https://www.youtube.com/embed/0F-LejtGc24"
views: 40904