Introduction: Wave Your Hand to Control OWI Robotic Arm... No Strings Attached

About: A maker and electronics enthusiast.

THE IDEA:

There are at least 4 other projects on Instructables.com (as of May 13, 2015) around modifying or controlling OWI Robotic Arm. Not surprisingly, since it is such a great and inexpensive robotic kit to play with. This project is similar in spirit (i.e, control the Robotic Arm with Arduino), but different in the approach. [video]

The idea is to be able to control the Robotic Arm wirelessly using gestures. Also, I tried to keep modifications of the Robotic Arm to a minimum, so it could still be used with the original controller.

Sounds simple.

What it ended up being is a three-part project:

  1. A glove fitted with enough sensors to control a LED and 5 motors
  2. An Arduino Nano based transmitter device to accept control commands from the glove and send it wirelessly to the Arm controller device
  3. An Arduino Uno-based wireless receiver and motor control device attached to the OWI Robotic Arm

FEATURES

  1. Support for all 5 Degrees Of Freedom (DOF) and the LED
  2. Big Red Button - to immediately stop the motors on the Arm preventing damage
  3. Portable modular design

For mobile users: the "promotional video" of this project is on YouTube here.

Step 1: Parts

GLOVE:

You will need the following to build a glove controller:

  1. Isotoner Smartouch Tech Stretch Stitched Glove (or similar) - on Amazon.com
  2. Spectra Symboflex Sensor 2.2" - on Amazon.com
  3. GY-521 6DOF MPU6050 3 Axis Gyroscope + Accelerometer Module - on Fasttech.com
  4. 2X5 BOX HEADER STRAIGHT - on Phoenixent.com
  5. 2X5 IDC SOCKET-RECEPTACLE - on Phoenixent.com
  6. FLAT RIBBON CABLE 10 Conductor .050" Pitch - on Phoenixent.com
  7. 2 x 5mm LEDs - Green and Yellow
  8. 2 x Small Buttons
  9. Resistors, wires, needle, black thread, glue gun, soldering gun, solder, etc.


TRANSMISSION STRAP-ON BOX:

  1. Arduino Compatible Nano v3.0 ATmega328P-20AU Board - on Fasttech.com
  2. nRF24L01+ 2.4GHz Wireless Transceiver Arduino Compatible - on Amazon.com
  3. Gymboss WRISTBAND - on Amazon.com
  4. 9V Battery Holder Box Case with Wire Lead ON/OFF Switch - on Amazon.com
  5. 2X5 BOX HEADER STRAIGHT - on Phoenixent.com
  6. 9v battery
  7. 47uF (50v) capacitor
  8. Resistors, wires, glue gun, soldering gun, solder, etc.

OWI ROBOTIC ARM CONTROLLER BOX:

  1. Arduino Compatible Uno R3 Rev3 Development Board - on Fasttech.com
  2. Prototype Shield DIY KIT for Arduino (or similar) - on Amazon.com
  3. nRF24L01+ 2.4GHz Wireless Transceiver Arduino Compatible - on Amazon.com
  4. 3 x L293D 16-pin Integrated Circuit IC Motor Driver - on Fasttech.com
  5. 1 x SN74HC595 74HC595 8-Bit Shift Register With 3-State Output Registers DIP16 - on Amazon.com
  6. 47uF (50v) capacitor
  7. Box for Arduino - on Amazon.com
  8. On/Off switch
  9. 2 x 13mm buttons (one Red and one Green caps)
  10. 2 x 2X7 BOX HEADER STRAIGHT - same as above on Phoenixent.com
  11. FLAT RIBBON CABLE 14 Conductor .050" Pitch - same as above on Phoenixent.com
  12. 9v battery + clip-on connector
  13. Resistors, wires, glue gun, soldering gun, solder, etc.

... and of course:

OWI Robotic Arm Edge - Robot arm - OWI-535 - on Adafruit.com

Step 2: PROTOTYPING

I strongly suggest prototyping each of the controller devices before soldering all the components together.

This project uses a few challenging pieces of hardware:


nRF24L01

Took me a while to make the two nRF24 talk to each other. Apparently neither Nano, nor Uno provide enough of stabilized 3.3v power for the modules to work consistently. A solution in my case was a 47uF capacitor across the power pins on both nRF24 modules. There are also a few quirks with using RF24 library in IRQ and non-IRQ modes, so I recommend studying the examples really carefully.

A couple of great resources:

nRF24L01 Ultra low power 2.4GHz RF Transceiver IC Product Page

RF24 Driver library page

Just googling nRF24 + arduino will produce a lot of links. It is worth researching


74HC595 SHIFT REGISTER

Not surprisingly having to control 5 motors, a LED, two buttons and a Wireless module I ran out of pins on the Uno relatively quickly. The well known way to "extend" your pin count is to use a shift register. Since nRF24 was already using the SPI interface, I decided to use SPI for shift register programming as well (for speed and to save pins) instead of the shiftout() function. To my surprise it worked like a charm from the first time. You can check it out in the pin assignment and in the sketches.

Breadboard and jumper wires are your friends.

Step 3: GLOVE

OWI Robotic ARM has 6 items to control (OWI Robotic Arm Edge Picture)

  1. A LED located on the GRIPPER of the device
  2. A GRIPPER
  3. A WRIST
  4. An ELBOW - is the part of the robotic arm attached to the WRIST
  5. An SHOULDER is the part of the robotic arm attached to the BASE
  6. A BASE

The glove is designed to control Robotic Arm's LED and all 5 motors (Degrees of Freedom).

I have individual sensors marked on the pictures as well as a description below:

  1. The GRIPPER is controlled by the buttons located on the middle finger and pinky. Gripper is closed by pressing index and middle fingers together. Gripper is opened by pressing ring and pinky together.
  2. The WRIST is controlled by the flexible resistor on the index finder. Curling the finger half way makes the wrist go down, and curling it all the way makes the wrist go up. Keeping the index finger straight stops the wrist.
  3. The ELBOW is controlled by accelerometer - tilting palm up and down moves the elbow up and down respectively
  4. The SHOULDER is controlled by accelerometer - tilting palm to the right and to the left (not upside down though!) moves the shoulder up and down respectively
  5. The BASE is controlled by accelerometer as well, similar to shoulder - tilting palm to the right and to the left all the way upside down (palm facing up) moves the base right and left respectively
  6. The LED on the gripper is turned on/off by pressing both gripper control buttons together.

All button responses are delayed by 1/4 of a second to avoid jitter.

Assembling the glove requires some soldering and a lot of sewing. Basically it is just attaching 2 buttons, flexible resistor, Accel/Gyro module to the fabric of the glove and routing wires to the connector box.

Two LEDs on the connection box are:

  1. GREEN - power on
  2. YELLOW - blinks when data is transmitted to the arm control box.

Step 4: TRANSMITTER BOX

The transmitter box is essentially Arduino Nano, nRF24 wireless module, flexible wire connector and 3 resistors: 2 pull-down 10 kOhm resistors for the gripper control buttons on the glove, and a voltage division 20 kOhm resistor for the flexible sensor controlling the wrist.

Everything is soldered together on a vero-board. Note that nRF24 is "hanging" over Nano. I was worried that this might cause interference, but it works.

Using the 9v battery makes the strap-on part a bit bulky, but I did not want to mess with LiPo batteries. Maybe later.

Please see the pin assignment step for soldering instructions.

Step 5: ARM CONTROL BOX

Arm control box is based on Arduino Uno. It receives commands from the glove wirelessly via nRF24 module, and controls the OWI Robotoc Arm via 3 L293D driver chips.

Since almost all Uno pins were utilized, there are a lot of wires inside the box - it barely closes!

By design, the box starts in the OFF mode (as if a redstop button is pressed), giving operator time to put the glove on and get ready. Once ready, operator presses the green button, and connection between the glove and control box should be immediately established (as indicated by the yellow LED on the glove and red LED on the control box).

CONNECTING TO OWI

Connection to the robotic arm is made via 14 pin dual rows header (according to the picture above) via 14 wire flat cable.

  • LED connections are to common ground (-) and arduino pin A0 via 220 Ohm resistor
  • All motor wires are connected to L293D pins 3/6, or 11/14 (+/- respectively). Each L293D supports 2 motors, hence two pairs of pins.
  • OWI Power lines are leftmost (+6v) and rightmost (GND) pins of the 7 pin connector on the back of the yellow top. (You can see the wires plugged in on the picture above). These two are connected to pins 8 (+) and 4,5,12,13 (GND) on all three L293Ds.

Please see the rest of pin assignment at the next step.

Step 6: PIN ASSIGNMENT

NANO:

  • 3.3v - 3.3v to nRF24L01 chip (pin 2)
  • 5v - 5v to Accelerometer board, buttons, flexible sensor
  • a0 - flexible resistor input
  • a1 - yellow "comms" LED control
  • a4 - SDA to accelerometer
  • a5 - SCL to accelerometer
  • d02 - nRF24L01 chip Interrupt pin (pin 8)
  • d03 - open gripper button input
  • d04 - close gripper button input
  • d09 - SPI CSN pin to nRF24L01 chip (pin 4)
  • d10 - SPI CS pin to nRF24L01 chip (pin 3)
  • d11 - SPI MOSI to nRF24L01 chip (pin 6)
  • d12 - SPI MISO to nRF24L01 chip (pin 7)
  • d13 - SPI SCK to nRF24L01 chip (pin 5)
  • Vin - 9v +
  • GND - common ground

UNO:

  • 3.3v - 3.3v to nRF24L01 chip (pin 2)
  • 5v - 5v to buttons
  • Vin - 9v +
  • GND - common ground
  • a0 - Wrist LED +
  • a1 - SPI SS pin for Shift Register Select - to pin 12 on Shift Register
  • a2 - RED button input
  • a3 - GREEN button input
  • a4 - direction base right - pin 15 on L293D
  • a5 - comms led
  • d02 - nRF24L01 IRQ input (pin 8)
  • d03 - enable base servo (pwm) pin 1 or 9 on L293D
  • d04 - direction base left - pin 10 on respective L293D
  • d05 - enable shoulder servo (pwm) pin 1 or 9 on L293D
  • d06 - enable elbow servo (pwm) pin 1 or 9 on L293D
  • d07 - SPI CSN pin to nRF24L01 chip (pin 4)
  • d08 - SPI CS pin to nRF24L01 chip (pin 3)
  • d09 - enable wrist servo (pwm) pin 1 or 9 on L293D
  • d10 - enable gripper servo (pwm) pin 1 or 9 on L293D
  • d11 - SPI MOSI to nRF24L01 chip (pin 6) and pin 14 on Shift Register
  • d12 - SPI MISO to nRF24L01 chip (pin 7)
  • d13 - SPI SCK to nRF24L01 chip (pin 5) and pin 11 on Shift Register

SHIFT REGISTER AND L293Ds:

  • pin QA (15) of 74HC595 to pin 2 of L293D #1
  • pin QB (1) of 74HC595 to pin 7 of L293D #1
  • pin QC (2) of 74HC595 to pin 10 of L293D #1
  • pin QD (3) of 74HC595 to pin 15 of L293D #1
  • pin QE (4) of 74HC595 to pin 2 of L293D #2
  • pin QF (5) of 74HC595 to pin 7 of L293D #2
  • pin QG (6) of 74HC595 to pin 10 of L293D #2
  • pin QH (7) of 74HC595 to pin 15 of L293D #2

Step 7: COMMUNICATION

Glove sends 2 bytes of data to the control box 10 times per second or whenever a signal from one of the sensors is received.

2 bytes is sufficient for 6 controls because we only need to send:

  • ON/OFF for LED (1 bit) - I actually used 2 bits to be consistent with the motors, but one is enough
  • OFF/RIGHT/LEFT for 5 motors: 2 bit each = 10 bits

Total of 11 or 12 bits is sufficient.

Direction codes:

  • OFF : 00
  • RIGHT: 01
  • LEFT: 10

Control word looks like this (bit-wise):

Byte 2 ----------------    Byte 1----------------
15 14 13 12 11 10  9  8    7  6  5  4  3  2  1  0
 0  0  0  0 LED--  M5--    M4--  M3--  M2--  M1--
  • M1 - gripper
  • M2 - wrist
  • M3 - elbow
  • M4 - shoulder
  • M5 - base

Byte 1 could be conveniently fed directly into the shift register, since is controls right/left direction of motors 1 through 4.

A timeout of 2 seconds is enabled for communications. If timeout occurs, all motors are stopped as if a RED button was pressed.

Step 8: SKETCHES and More...

GLOVE

Glove sketch uses the following libraries:

  • DirectIO - available on Github
  • I2Cdev - available on Github
  • Wire - part of Arduino IDE
  • MPU6050 - available on Github
  • SPI - part of Arduino IDE
  • RF24 - available on Github

and three libraries developed by me:

  • AvgFilter - available of Github
  • DhpFilter - available on Github
  • TaskScheduler - available on Github

Glove sketch is available here: Glove Sketch v1.3

ARM CONTROL BOX

Arm sketch uses the following libraries:

  • DirectIO - available on Github
  • PinChangeInt - available on Github
  • SPI - part of Arduino IDE
  • RF24 - available on Github

and a library developed by me:

  • TaskScheduler - available on Github

Arm sketch is available here: Arm Sketch v1.3

Data Sheets for hardware used


May 31, 2015 UPDATE:

A new version of glove and arm control box sketches is available here: Glove and Arm Sketches v1.5

They also are located on github here.

Changes:

  • Added two more bytes to the communication structure to send requested motor speed for Wrist, Elbow, Shoulder and Base motors as a 5 bit value (0 .. 31) from the Glove proportionate to the angle of the control gesture (see below). Arm Control Box maps values [0 .. 31] to respective PWM values for each of the motors. This enables gradual speed control by the operator, and more precise arm handling.
  • New set of gestures:

1. LED: Buttons control LED - middle finger button - ON, pinkie finger button - OFF

2. GRIPPER: Flexible strip controls Gripper - half-bent finger - OPEN, fully bent finger - CLOSE

3. WRIST: Wrist is controlled by tilting palm from fully horizontal position UP and DOWN respectively. More tilt produces more speed

4. ARM: Arm is controlled by tilting palm from fully horizontal position LEFT and RIGHT. More tilt produces more speed

5. SHOULDER: Shoulder is controlled by rotating palm RIGHT and LEFT from the palm pointing straight up position. Palm is rotated along the elbow axis (as is waving your hand)

6. BASE: Base is controlled the same way as shoulder with palm pointing straight down.

Step 9: WHAT ELSE?

IMAGINATION AT WORK

As usual with such systems, they could be programmed to do a lot more.

For instance, current design already incorporates additional abilities, not possible with the standard remote:

  • Gradual speed increase: every motor movement is initiated at a predefined minimal speed, which is increased gradually every 1 second until a maximum speed is achieved. This allows more precise control of each of the motors (especially the wrist and gripper)
  • Faster motion cancellation: when the command is received by the Arm Box to stop a motor, it momentarily reverses the motor for about 50 ms, thus "breaking" the movement, and allowing a more precise control.

WHAT ELSE?

Perhaps a more elaborate control gestures could be implemented. Or simultaneous gestures could be used for elaborate controls. Can the Arm dance?

If you have an idea how to re-program the glove, or have a version of a sketch you want me to test - please let me know: arkhipenko@hotmail.com

Step 10: *** WE WON !!! ***

This project won First Prize in the Coded Creations contest sponsored by Microsoft.

Check it out! WOO-HOO!!!