Skip to content

Robotic Arm Laboratory

ilequerica edited this page Jul 29, 2014 · 15 revisions

How it works

The Robotic Arm laboratory is composed of the following hardware pieces: (1) a physical robotic arm connected to (2) an Arduino UNO board which is, in turn, connected to (3) a Raspberry Pi B microcomputer. The robotic arm has several DC motors to move the different parts on it, named as: base, shoulder, elbow, wrist and clamp; and a led. The Arduino microcontroller allows the interaction with the motors and the led. The Raspberry Pi microcomputer operates as a websocket server, opening the interaction with the remote laboratory to Internet.

The Robotic Arm is composed of the following software pieces: in the Raspberry Pi there is (1) “node_socketio” folder, which contains a set of html files that represent the different elements of the Robotic Arm into the client browser: “led.html”, “clamp.html”, “wrist.html”, “elbow.html”, “shoulder.html” and “base.html”. (2) "js" folder containing the "server.js" file that handles the websocket connections. (3) “modules” folder containing the libraries needed: “node.js”, “socket.io” and “serialport”. In the Arduino there is (4) “arduino” folder which contains the software "robotic_arm.ino" to be installed in the Arduino board.

Arduino board

The file named "robotic_arm.ino" must be downloaded into the Arduino board, in the "/arduino/robotic_arm" folder.

Server side - Raspberry Pi

The server software is installed in the Raspberry Pi and is composed of a single "server.js" file,that can be downloaded from https://github.com/go-lab/smart-device/tree/master/RaspberryPi/robotic_arm-raspberry-pi/node_socketio/robotic_arm/js. This file will be located in the Raspberry Pi in "/var/www/$BASE_DIR/js" folder. It opens, through the "serialport" library, a serial port communication channel with the Arduino board and websocket server.

The Raspberry Pi contains the libraries needed to open websockets communication channels with the client, which are downloadable from https://github.com/go-lab/smart-device/tree/master/RaspberryPi/robotic_arm-raspberry-pi/modules.

The Raspberry Pi microcomputer also contains the client software, that is, the different elements of the Robotic Arm into the client browser: “led.html”, “clamp.html”, “wrist.html”, “elbow.html”, “shoulder.html” and “base.html”. They are downloadable from https://github.com/go-lab/smart-device/tree/master/RaspberryPi/robotic_arm-raspberry-pi/node_socketio/robotic_arm and installed in "$HOME_DIR/robotic_arm" () folder. They allow to:
-Switch on and off the led
-Open and close the clamp
-Move the wrist forward and backward
-Move the elbow forward and backward
-Move the shoulder forward and backward
-Move the base to the left and to the rigth

Each of the html files draws an slider, with 5 positions. Selecting a position and clicking on the "send" buttom allows the interaction.

Note1: these files should be located in the web directory of Apache web server along with the directory Style (https://github.com/go-lab/smart-device/tree/master/RaspberryPi/robotic_arm-raspberry-pi/node_socketio/robotic_arm)

Note2: Should you need further information on how to install the files into Raspberry Pi, please visit: How to use Node.js and Socket.io laboratories with Raspberry Pi and Arduino