Skip to content

Robotic Arm Laboratory

eliosr edited this page Jul 25, 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. The Arduino microcontroller allows the interaction with the motors. 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: (1) “node_socketio” folder, which contains 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”; and the server source code that handles the websocket connections. They are all installed in the Raspberry Pi.(2) "js" folder containing the "server.js" file. (3) “modules” folder containing the libraries needed: “node.js”, “socket.io” and “serialport”. (4) “arduino” folder which contains the software to be installed in the Arduino board. ¿Dónde estaría físicamente la librería bootstrap?

Arduino board

The file named "robotic_arm.ino" must be downloaded to the Arduino board into 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 located in https://github.com/go-lab/smart-device/tree/master/RaspberryPi/robotic_arm-raspberry-pi/node_socketio/robotic_arm/js. This files will be located in the Raspberry pi in "/var/www/$BASE_DIR/js" folder. This "server.js" file opens, through the "serialport" library, a serial port communication channel with the Arduino board and the Web socket.

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

The Raspberry Pi microcomputer also contains the client software composed of a "$HOME_DIR/robotic_arm" (https://github.com/go-lab/smart-device/tree/master/RaspberryPi/robotic_arm-raspberry-pi/node_socketio/robotic_arm) folder where the 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”. 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 his Apache 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