M2 ICP_7 - akkipant/IoT-Fall-2019 GitHub Wiki

Introduction:

This ICP was about designing a robot arm for pick-up items using Arduino, Node MCU, and mobile web-app. We were provided with the robotic arm kit to be assembled and tested.

Objectives:

  1. Assemble the robotic arm. Test its operation.
  2. Write an Arduino code to move the robot arm and pick-up light objects.
  3. Use Node MCU to control the directions through the MQTT protocol.

Approaches/Methods:

Our first approach was to assemble the robot arm. We referred the installation guide: Robot_arm_installtion. Then we proceeded ahead with the Arduino code for the arm. We later connected the Node MCU for controlling the robot arm.

Workflow:

  1. Assemble the Robot arm as per the following steps:
  • Install the base plate
  • Install pivot servo
  • Install servo on base plate
  • Install the bottom acrylic plate to pivot servo
  • Install left arm servo
  • Install right Arm Servo on right plate
  • Install center base plate join
  • Connect the hull
  • Install main arm
  • Install small arm
  • Install Grap
  • Connect the claw
  1. Write an Arduino code to drive the robot arm. Include the servo.h file to use the servo motor functions.
  2. Declare the servo_rotate, servo_grabber, servo_height, and servo_extender functions. These functions represent different servo motors on the robotic arm.
  3. Use Node MCU to connect with Arduino through Software serial and communicate through MQTT with the mobile app. Node-MCU will act as an MQTT subscriber as well as publisher for feedback.
  4. Design a web application to send commands to the robotic arm. As soon as the app is opened, click on the "Subscribe" button. Subscribing is mandatory to initiate the MQTT connection. slide the extender/rotate/grabber/height slide button in order to send command. Once, the button is slide, it gets locked until the acknowledgment is received from Node MCU that the given command is executed. It then publishes the command.
  5. When the Node MCU receives command from the web app, it passes the command in the form of digit to Arduino (as passing a long string was giving errors).
  6. Arduino when commands from Node MCU it moves the respective motor and sends the acknowledgment to the Node MCU.

Block Diagram:

blockdiagram

Circuit Diagram:

circuit

Output/Video:

Robotic_Arm

Communication_between_Arduino_Node_MCU

Parameters:

Hardware/Software used:

  1. Arduino
  2. Node MCU
  3. Robotic arm
  4. HTML Mobile application

Evaluation and Discussion:

  1. We first tried to connect the Arduino through Bluetooth with the mobile web app but it was unable to communicate. We decided to use Node MCU as it effectively communicates through MQTT. Communication of Arduino and Node MCU through UART was challenging. It was giving several errors. But, finally, after 2 days, we could successfully establish the communication between Node MCU and Arduino. Efforts were spent both on the Arduino code and the Node MCU code. We learned the javascript and HTML for designing a web application to control the robot arm.
  2. The servo motors that we have are not strong enough to pick and place the objects. It just made the sound when provided with the rotation angle commands. Hence, we have incremented the robot arm angle by 5 degrees after every 20ms.

Conclusion:

This ICP was challenging in terms of communication between Node MCU and Arduino. We learned to establish MQTT connection between the Node MCU and the web application. We learned to assemble the robot arm and operate it using the web application.

Github Links:

  1. Prerana
  2. Zeal
  3. Ashish
  4. Lee