robotic arm 1

27
http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/ Food Living Outside Play Technology Workshop Make Wired Robotic Arm Edge to "Wireless" with DIY Arduino + XBee by sath02 on April 3, 2012 Table of Contents Make Wired Robotic Arm Edge to "Wireless" with DIY Arduino + XBee . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 Intro: Make Wired Robotic Arm Edge to "Wireless" with DIY Arduino + XBee . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Step 1: Build the Robotic Arm Edge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Step 2: Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 Step 3: Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 Step 4: Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Step 5: Lets the fun begin... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 Step 6: Wiring the main Ground . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Step 7: Motor Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 Step 8: Motors Power Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 Step 9: Motor Controller Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 Step 10: (Alternative) Bluetooth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Step 11: Add Power Supply to Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 Step 12: Test the Motors Driver Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Step 13: Configure XBee and Test XBee . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18 Step 14: Arduino Sketch & Processing code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19 File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Step 15: Video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27 Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

Upload: efx8

Post on 10-May-2017

249 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

Food      Living       Outside        Play        Technology       Workshop

Make Wired Robotic Arm Edge to "Wireless" with DIY Arduino + XBeeby sath02 on April 3, 2012

Table of Contents

Make Wired Robotic Arm Edge to "Wireless" with DIY Arduino + XBee . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Intro:   Make Wired Robotic Arm Edge to "Wireless" with DIY Arduino + XBee . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

Step 1:   Build the Robotic Arm Edge . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 2:   Parts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3

Step 3:   Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4

Step 4:   Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Step 5:   Lets the fun begin... . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

Step 6:   Wiring the main Ground . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Step 7:   Motor Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

Step 8:   Motors Power Supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

Step 9:   Motor Controller Pins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

Step 10:   (Alternative) Bluetooth . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

Step 11:   Add Power Supply to Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13

Step 12:   Test the Motors Driver Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Step 13:   Configure XBee and Test XBee . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

Step 14:   Arduino Sketch & Processing code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

File Downloads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

Step 15:   Video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27

Page 2: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

Author:sath02I am Electronic Visualization Artist. I look at things through the Looking Glasses.

Intro:  Make Wired Robotic Arm Edge to "Wireless" with DIY Arduino + XBeeWhen I finished the "RevIO" - an Arduino Clone that has the different way of exposing pins usage. I decided to go further to the next project. To test my "RevIO" boardthat it could do the bigger task than just blinking the LED!

I modified the Wired Robotic Arm Edge to Wireless controlled, using my "RevIO" and DIY Three-Motor Driver ICs PCB together with XBee Series 1 module.

This instructables introduces the way I constructed Three-Motor Driver ICs PCB from scratch. Then using it as the "piggy back" on my "RevIO" Board.

To control the Robotic Arm, I designed the GUI (Graphical User Interface) with the Processing on the PC and Arduino sketch for driving the motors.

I also added the 6-pin socket as an alternative to use Bluetooth module (Sparkfun's Bluetooth Modem - Blue SMiRF Silver , or Bluetooth Modem - Blue SMIRF Gold .)

Again I am going to use the same presentation method as Build "The RevIO" (Arduino Clone) My Way , to build the board using the graphical illustrations, together withthe photos of actual build of the board.

Image Notes1. XBee Module on the PC(Laptop).This is the FTDI Cable Mod. I modified thecable to be located underneath the XBee module.2. XBee Module on the Robotic Arm

Image Notes1. Robotic Arm Control GUI

Page 3: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

Step 1: Build the Robotic Arm EdgeI got the Robotic Arm Edge Kit from TPE Shop in Thailand three months ago, while I was visiting my family in Thailand. But I did not do until I got back to USA a monthlater.

This is my very first Robotic Arm I ever encountered with. A week after I got back, I started to constructed the kit. I spend about four hours to build and pause to takepictures for this instructables.

I will not show you how I managed to put the kit together, but here is the collage of how I put the Robotic Arm together from the start to finish!

Image Notes1. Start2. Finish!

Step 2: PartsIC1, IC2, IC3 H-Bridge Motor Driver 1A, SN754410 (Sparkfun #COM-00315 ) or L293D (Digikey#497-2936-5-ND )R1 - 1K Resistor (Radio Shack #271-1321 or Digkey #PPC1.0KW-1CT-ND )LED1 - 3mm Red LED (Digikey #160-1708-ND )S1 - Slide DPDT Switch (Digikey #401-2000-ND )JP1 - 2x6 Male Header Connector, StraightJP2, JP3 -(2) 14-pin Male header, extra long pin or use shield stacking headers (Adafruit ID#85)JP4 - 2-pin Male Header Connector, Right AngleJP5 - 6-pin Female Connector, Right angle16-pin IC Socket (Radio Shack #276-1998 )Multipurpose PC Board with 417 holes (Radio Shack #276-150 )Wire

The RevIO or any kind of ArduinoNote: In case of using Arduino or others Arduino Clone you needed to make the Motor Control Board to match those Arduino.

Other parts:2 XBee Modules I got the Series 1 from AdaFruit2 Xbee Adapter Board from AdaFruit

Alternativel part:Bluetooth Modem - Blue SMiRF Gold (Sparkfun# WRL-10268 )or Bluetooth Modem - Blue SMiRF Silver (Sparkfun# WRL-10269 )

Page 4: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

Image Notes1. Ready to use, RevIO - DIY Arduino2. 3 nos. of L293D or SN754410, H-Bridge motors drivers3. PCB with 417 holes (Radioshack #276-150)

Step 3: LayoutAs mentioned in the intro. I planned to use this motors driver board as a "piggy back" on the RevIO PCB. So I obtained the same PCB (Radio Shack #276-150) to matchmy RevIO's exposed pins. I tried to use the plain PCB (Radio Shack #276-149) so I could put the three H-Bridge Motors Drivers in parallel to the width of the PCB, butthat did not worked! Because the holes on the width side was one hole short of the RevIO.

Notice that I placed the board by having the two row of individual holes on top and three rows of individual holes on the bottom. So it matches the layout of the RevIOboard.

Luckily, I could fit three H-Bridge Motor Drivers IC on the Multipurpose PC Board with 417 holes (Radio Shack #276-150) by put them one after another over the positiveand negative rails in the middle of the board.

The other good thing was that there were enough space to put 2x6 male header, for motors control pins and led on the board. So I place them on the top left corner of theboard next to the top 14-pin rail. And also there were enough space to put a 6-pin connector as an alternative for Bluetooth breakout board. (Bluetooth Modem - BlueSMiRF Gold (Sparkfun# WRL-10268) or Bluetooth Modem - Blue SMiRF Silver (Sparkfun# WRL-10269)) . So I placed it on the bottom right corner of the PCB.

Image Notes1. PCB (Radio Shack #276-150) Top and Bottom2. Two rows of individual holes.3. Three rows of individual holes4. Positive and Negative rails

Image Notes1. Motors and LED connector from Robotic Arm2. 3 nos. H-Bridge Motors Drivers3. Motors Power Supply connector.4. Bluetoorh5. Motors Power Switch6. Motor Power Supply indicator LED

Page 5: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

Step 4: ToolsSolder iron and Soldering Work Station

Solder - Rosin Core (Radio Shack #64-013)Hookup WireMultimeterDiagonal cutterPliersX-Acto KnifeWire StripperSolder Suckeretc. (something else that you might want to use.)

Step 5: Lets the fun begin...Places the components on PCB

First component I added to my Motors Controller Board is power connector (JP4).

Second component I added was JP2 - 2x6 Motors and LED connector from Robotic Arm Edge.

Next components added was LED1 - Motor Power Supply indicator LED and then R1 - 1K resistor.

Then I added S1 - Motor Power Switch.

And added 6-pin female connector to make a Bluetooth-ready connector. (optional)

Image Notes1. Frist component, JP4 - Motors Power Connector

Image Notes1. JP1 - Motors and LED connector from Robotic Arm Edge

Page 6: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

Image Notes1. Motors Power Supply indicator LED

Image Notes1. Motors Power Switch

Image Notes1. Optional Bluetooth 6-pin female Connector

Image Notes1. Motors Power Supply Jack (J4)2. JP2 - 2x6 Motors and LED connector3. Motors Power Supply indicator LED and 1K resistor4. Motor Power Switch (S1)5. Motor Power Switch (S1)

Image Notes

Page 7: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

1. Optional Bluetooth connector

Step 6: Wiring the main GroundConnected the ground or negative(-) pin of the Power Jack to Switch S1.

Image Notes1. Connect the ground or negative(-) pin.

Image Notes1. Wired the ground.

Step 7: Motor DriversI added first motor driver IC to the board. This motors driver are used to control Grip (M1 - as shown in the Robotic Arm Manual) and wrist (M2) of the Robotic Arm.After that I connected the ground pins of the H-Bridge IC (pin 4, 5, 12, and 13).

Next, I added second H-Bridge IC. This motors driver are use to control Elbow (M3) and Shoulder (M4). And also connected the ground pins of the H-Bridge IC (pin 4, 5,12, and 13).

And I added the third H-Bridge IC. This motors driver are use to control only one last motor of the Robotic Arm, Base (M5). Again I connected the ground pins of the H-Bridge IC (pin 4, 5, 12, and 13).

After that I connected all the ground together.

Page 8: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

Image Notes1. H-Bridge IC for controlling Grip (M1) and Wrist (M2)

Image Notes1. Second H-Bridge Motor Driver, this one is controlling elbow(M3) andshoulder(M4)

Image Notes1. Connects the ground on pin 4, 5, 12, and 13

Page 9: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

Image Notes1. The third H-Bridge Motor Driver, this one controls only one motor, base(M5)

Image Notes1. Connect the ground pins 4 and 5, 12 and 13.

Image Notes1. Connect all the ground.

Step 8: Motors Power SupplyConnect the motors power supply to pin 8 of middle H-Bridge ICs.

Connect pin 16, 5V pins, of three H-Bridge ICs together. Then connect the 5V pins on the H-Bridge ICs to Arduino 5V pin.

Page 10: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

Image Notes1. Motors power supply.2. Motors power supply indicator.

Image Notes1. Connect pin 16 of three H-Bridge together.2. Connect 5V H-Bridge ICs to Arduino 5V pin.3. Connect 5V H-Bridge ICs to Arduino 5V pin.

Step 9: Motor Controller PinsConnect the motors control pins to Arduino

Grip (M1)Motor Pin Arduino Pin9 D1010 D915 D5

Motor Pin 2x6 Motors Header Connector11 M1 Bottom Row14 M1 Top RowAdd 14-pin female connectors

Wrist (M2)Motor Pin Arduino Pin1 D112 D87 D12

Motor Pin 2x6 Motors Header Connector6 M2 Top Row3 M2 Bottom Row

Elbow (M3)Motor Pin Arduino Pin9 D610 D715 D14 or A0(As shown on the diagram)

Motor Pin 2x6 Motors Header Connector11 M3 Top Row14 M3 Bottom Row

Shoulder (M4)Motor Pin Arduino Pin1 D14 or A0(As shown on the daigram)2 D27 D4

Motor Pin 2x6 Motors Header Connector3 M4 Bottom Row6 M4 Top Row

Base (M5)Motor Pin Arduino Pin9 D310 D16 or A2(As shown on the diagram)15 D17 or A3(As shown on the diagram)

Page 11: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

Motor Pin 2x6 Motors Header Connector11 M3 Top Row14 M3 Bottom Row

LED Light (L)2x6 Motors Header Connector Arduino PinL Top Row D13L Bottom Row Gnd

Image Notes1. Same point.2. Same point.

Page 12: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

Image Notes1. Done! Top view. Wiring is kind of messy.

Image Notes1. Bottom view of the finished board.

Image Notes1. Three H-Bridge Motor Drivers installed.

Page 13: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

Step 10: (Alternative) Bluetooth

I added Bluetooth connector as an alternative. If you want to use Bluetooth instead of Xbee, you have to remove XBee module. And you have to remove Bluetooth out ofthe socket, when you are upload the sketch to Arduino Board. Since all of these three share the same Serial Comm. port.

One good thing is that Arduino sketch could be share between Bluetooth and XBee, since both are using Serial Comm.

Note that, this bluetooth connector is pins compatible with the Sparkfun's Modem - BlueSMirF GOLD or BlueSMiRF SILVER.for more infomation and bluetooth tutorial see Sparkfun's Bluetooth Tutorial .

Image Notes1. Alternative Bluetooth wiring.

Image Notes1. Bluetooth Modem installed.

Step 11: Add Power Supply to ArduinoI want to conserve the existing battery power supply, also I want the Arduino to have its own power supply. So I decided to add the 9V battery to the Robot, as close tothe Arduino power jack as possible. The most suitable place is at the end of the Robot battery compartment.

Before I installed the 9V battery holder I removed some of the existing parts, the PCB, and its yellow cover. And I no longer needed the existing handheld controller.

I drilled two holes on the battery compartment to fit the holes of the9V battery holder.

I removed the RevIO case, so I could drill two holes to fit the existing holes that used to hold the yellow cover. And made one big round opening for the screw that holdthe Robot battery cover.

Page 14: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

Image Notes1. These existing parts (Handheld controller, PCB and PCB cover) were no longerneeded!

Image Notes1. undefined2. Drill two holes. Note: the right hole is not visible.

Image Notes1. Drill two holes on the RevIO case to match the existing holes. And make anopenning for the screw at the bottom.

Image Notes1. Install the RevIO bottom ccover on the Robot Baterry case.

Page 15: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

Image Notes1. Connect the connectors accordingly.From left LED, Base motor, Shoulder motor, Elbow motor, Wrist motor, and Gripmotor.2. Robot motors power supply header.3. Robot motors power supply header.

Image Notes1. Everything were in place.

Image Notes1. Flip the switch!"We have the power! Yeah."2. Flip the switch!"We have the power! Yeah."

Image Notes1. Bluetooth ready connector.2. Bluetooth ready connector.

Step 12: Test the Motors Driver BoardFollowing sketch is for testing the motors and LED light.

The sketch only test Robot's base motors. To test another motor, add the functions i.e gripUp(), gripDown(), and gripPause(mSecond) to test Robot grip motor, etc...

Note: remove the XBee module (or Bluetooth, if you use Bluetooth) before upload the sketch to Arduino!

// Test Robotic Arm motors and LED light

// Grip (M1) IN and OUT actionint gripEnablePin = 10;int gripPin1 = 9;int gripPin2 = 5;

// Wrist (M2) UP and DOWN actionint wristEnablePin = 11;int wristPin1 = 8;int wristPin2 = 12;

// Elbow (M3) UP and DOWN actionint elbowEnablePin = 6;int elbowPin1 = 7;

Page 16: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

int elbowPin2 = 15;

// Shoulder (M4) UP and DOWN actionint shoulderEnablePin = 14;int shoulderPin1 = 2;int shoulderPin2 = 4;

// Base (M5) RIGHT and LEFT actionint baseEnablePin = 3;int basePin1 = 16;int basePin2 = 17;

// LED ON and OFF actionint ledLight = 13;

void setup() {pinMode(ledLight, OUTPUT);

// grip (M1)pinMode(gripEnablePin, OUTPUT);pinMode(gripPin1, OUTPUT);pinMode(gripPin2, OUTPUT);

// wrist (M2)pinMode(wristEnablePin, OUTPUT);pinMode(wristPin1, OUTPUT);pinMode(wristPin2, OUTPUT);

// elbow (M3)pinMode(elbowEnablePin, OUTPUT);pinMode(elbowPin1, OUTPUT);pinMode(elbowPin2, OUTPUT);

// shoulder (M4)pinMode(shoulderEnablePin, OUTPUT);pinMode(shoulderPin1, OUTPUT);pinMode(shoulderPin2, OUTPUT);

// base (M5)pinMode(baseEnablePin, OUTPUT);pinMode(basePin1, OUTPUT);pinMode(basePin2, OUTPUT);}

void loop() {// turn on/off Robot LEDdigitalWrite(ledLight, HIGH);delay(500);digitalWrite(ledLight, LOW);delay(500);

// rotate right for 1500 millisecondsbaseRight();delay(1500);

// pause for 1000 millisecondsbasePause(1000);

// rotate left for 1000 millisecondsbaseLeft();delay(1000);

basePause(1000);

}

void gripIn() {digitalWrite(gripEnablePin, HIGH);digitalWrite(gripPin1, LOW);digitalWrite(gripPin2, HIGH);}

void gripOut() {digitalWrite(gripEnablePin, HIGH);digitalWrite(gripPin2, LOW);digitalWrite(gripPin1, HIGH);}

void gripPause(int mSec) {digitalWrite(gripEnablePin, LOW);digitalWrite(gripPin1, LOW);digitalWrite(gripPin2, LOW);

delay(mSec);}

Page 17: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

void wristUp() {digitalWrite(wristEnablePin, HIGH);digitalWrite(wristPin1, LOW);digitalWrite(wristPin2, HIGH);}

void wristDown() {digitalWrite(wristEnablePin, HIGH);digitalWrite(wristPin2, LOW);digitalWrite(wristPin1, HIGH);}

void wristPause(int mSec) {digitalWrite(wristEnablePin, LOW);digitalWrite(wristPin1, LOW);digitalWrite(wristPin2, LOW);

delay(mSec);}

void elbowUp() {digitalWrite(elbowEnablePin, HIGH);digitalWrite(elbowPin1, LOW);digitalWrite(elbowPin2, HIGH);}

void elbowDown() {digitalWrite(elbowEnablePin, HIGH);digitalWrite(elbowPin2, LOW);digitalWrite(elbowPin1, HIGH);}

void elbowPause(int mSec) {digitalWrite(elbowEnablePin, LOW);digitalWrite(elbowPin1, LOW);digitalWrite(elbowPin2, LOW);

delay(mSec);}

void shoulderUp() {digitalWrite(shoulderEnablePin, HIGH);digitalWrite(shoulderPin1, LOW);digitalWrite(shoulderPin2, HIGH);}

void shoulderDown() {digitalWrite(shoulderEnablePin, HIGH);digitalWrite(shoulderPin2, LOW);digitalWrite(shoulderPin1, HIGH);}

void shoulderPause(int mSec) {digitalWrite(shoulderEnablePin, LOW);digitalWrite(shoulderPin1, LOW);digitalWrite(shoulderPin2, LOW);

delay(mSec);}

void baseRight() {digitalWrite(baseEnablePin, HIGH);digitalWrite(basePin1, LOW);digitalWrite(basePin2, HIGH);}

void baseLeft() {digitalWrite(baseEnablePin, HIGH);digitalWrite(basePin2, LOW);digitalWrite(basePin1, HIGH);}

void basePause(int mSec) {digitalWrite(baseEnablePin, LOW);digitalWrite(basePin1, LOW);digitalWrite(basePin2, LOW);

delay(mSec);}

Page 18: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

File Downloads

TestRobotArm.pde (3 KB)[NOTE: When saving, if you see .tmp as the file ext, rename it to 'TestRobotArm.pde']

Step 13: Configure XBee and Test XBeeIn order to cntrol the Robotic Arm with the XBee, we need two XBee Modules, and one FTDI cable. One XBee module will be connected to Arduino without FTDI cable.

The second XBee Module will be connected to PC or Laptop via FTDI cable.

This instructable is intentional for building the motors controller board. It would take up a lot of space and time to explain the installation, configuration, and test the XBeemodule.

Here are my WIKI XBee tutorials, show how to configure and test XBee module using Hyperterminal, and X-CTU:

Configure XBee using AT Commands.

Configure XBee using X-CTU Software.

My XBee video tutorial.

Following are the list of the links of the great resources to learn all about the XBee.

Tutorials and infomation:

XBee Radios at AdaFruit .

Datasheet, specification, and cofiguration app. from Digi

Image Notes1. XBee connects to PC or Laptop via FTDI cable

Page 19: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

Image Notes1. XBee Module on the PC(Laptop).This is the FTDI Cable Mod. I modified thecable to be located underneath the XBee module.2. XBee Module on the Robotic Arm

Step 14: Arduino Sketch & Processing code

Following are the Arduino Sketch and Processing Source Code (both Arduino Sketch and Processing are in the same zip file below) :

If you are using this sketch, please set the Baud Rate of your XBee according to your XBee setup.

void setup() {...// change the Baud Rate according to your XBee, I set my XBee to 115200.Serial.begin(115200);...

}

//============ Arduino Sketch

// Language: Arduino// RobotArmControl.pde//// by Sam Thongrong Feb 26, 2012// rev.02// control commands array:// {GripOut, GripIn, WristUp, WristDown, ElbowUp, ElbowDown,// ShoulderUp, shoulderDown, BaseCW, BaseCCW, LightOn, LightOff, Stop};int controls[13] = { 0x47, 0x67, 0x57, 0x77, 0x45, 0x65,0x53, 0x73, 0x42, 0x62, 0x4c, 0x6c, 0x58 };

// Baseint baseEnablePin = 3;int basePin1 = 16;int basePin2 = 17;

// Shoulderint shoulderEnablePin = 14;int shoulderPin1 = 2;int shoulderPin2 = 4;

// Elbowint elbowEnablePin = 6;int elbowPin1 = 7;int elbowPin2 = 15;

// Wristint wristEnablePin = 11;int wristPin1 = 8;int wristPin2 = 12;

//Gripint gripEnablePin = 10;int gripPin1 = 9;int gripPin2 = 5;

int ledPin = 13;

Page 20: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

// set a variable to store the byte sent from the serial portint incomingByte;

void setup() {// set light LEDpinMode(ledPin, OUTPUT);digitalWrite(ledPin, LOW);

// set the SN754410 pins as outputs:pinMode(basePin1, OUTPUT);pinMode(basePin2, OUTPUT);pinMode(baseEnablePin, OUTPUT);

pinMode(shoulderPin1, OUTPUT);pinMode(shoulderPin2, OUTPUT);pinMode(shoulderEnablePin, OUTPUT);

pinMode(elbowPin1, OUTPUT);pinMode(elbowPin2, OUTPUT);pinMode(elbowEnablePin, OUTPUT);

pinMode(wristPin1, OUTPUT);pinMode(wristPin2, OUTPUT);pinMode(wristEnablePin, OUTPUT);

pinMode(gripPin1, OUTPUT);pinMode(gripPin2, OUTPUT);pinMode(gripEnablePin, OUTPUT);

// start sending data at 115200 baud rate// I set my Xbee Baud Rate at 115200 bps,// change the Baud Rate according to your XBeeSerial.begin(115200);}

void loop() {// check that there's something in the serial bufferif (Serial.available() > 0) {// read the byte and store it in our variable// the byte sent is actually an ascii valueincomingByte = Serial.read();// note the upper casing of each letter!// each letter turns a motor different way.

//===== Grip// Grip inif (incomingByte == controls[0]) {gripIn();}// Grip Outif (incomingByte == controls[1]) {gripOut();}

//Wristif (incomingByte == controls[2]) {//digitalWrite(wristPin1, LOW);//digitalWrite(wristPin2, HIGH);wristUp();}if (incomingByte == controls[3]) {wristDown();}

//===== Elbow// Elbow Upif (incomingByte == controls[4]) {elbowUp();}// Elbow Downif (incomingByte == controls[5]) {elbowDown();}

//===== Shoulder// Shoulder Upif (incomingByte == controls[6]) {shoulderUp();}// Shoulder Downif (incomingByte == controls[7]) {shoulderDown();}

//===== Base

Page 21: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

// Base Rightif (incomingByte == controls[8]) {baseRight();}// Base Leftif (incomingByte == controls[9]) {baseLeft();}

// Light ONif (incomingByte == controls[10]) {digitalWrite(ledPin, HIGH);}// Light OFFif (incomingByte == controls[11]) {digitalWrite(ledPin, LOW);}

// if a O is sent make sure the motors are turned offif (incomingByte == controls[12]) {allStop();}

delay(100);}}

void gripIn() {digitalWrite(gripEnablePin, HIGH);digitalWrite(gripPin1, LOW);digitalWrite(gripPin2, HIGH);}

void gripOut() {digitalWrite(gripEnablePin, HIGH);digitalWrite(gripPin2, LOW);digitalWrite(gripPin1, HIGH);}

void wristUp() {digitalWrite(wristEnablePin, HIGH);digitalWrite(wristPin1, LOW);digitalWrite(wristPin2, HIGH);}

void wristDown() {digitalWrite(wristEnablePin, HIGH);digitalWrite(wristPin2, LOW);digitalWrite(wristPin1, HIGH);}

void elbowUp() {digitalWrite(elbowEnablePin, HIGH);digitalWrite(elbowPin1, LOW);digitalWrite(elbowPin2, HIGH);}

void elbowDown() {digitalWrite(elbowEnablePin, HIGH);digitalWrite(elbowPin2, LOW);digitalWrite(elbowPin1, HIGH);}

void shoulderUp() {digitalWrite(shoulderEnablePin, HIGH);digitalWrite(shoulderPin1, LOW);digitalWrite(shoulderPin2, HIGH);}

void shoulderDown() {digitalWrite(shoulderEnablePin, HIGH);digitalWrite(shoulderPin2, LOW);digitalWrite(shoulderPin1, HIGH);}

void baseRight() {digitalWrite(baseEnablePin, HIGH);digitalWrite(basePin1, LOW);digitalWrite(basePin2, HIGH);}

void baseLeft() {digitalWrite(baseEnablePin, HIGH);digitalWrite(basePin2, LOW);digitalWrite(basePin1, HIGH);

Page 22: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

}

void allStop() {digitalWrite(baseEnablePin, LOW);digitalWrite(basePin1, LOW);digitalWrite(basePin2, LOW);

digitalWrite(shoulderEnablePin, LOW);digitalWrite(shoulderPin1, LOW);digitalWrite(shoulderPin2, LOW);

digitalWrite(elbowEnablePin, LOW);digitalWrite(elbowPin1, LOW);digitalWrite(elbowPin2, LOW);

digitalWrite(wristEnablePin, LOW);digitalWrite(wristPin1, LOW);digitalWrite(wristPin2, LOW);

digitalWrite(gripEnablePin, LOW);digitalWrite(gripPin1, LOW);digitalWrite(gripPin2, LOW);}

//=========== Arduino End

Following is the Processing Source Code. You'ill need the background image file, and all the buttons image files in order to see those control buttons on the screen.

And all the background and buttons are provided ad there are in the folder called data. You will need to have this folder located in the same folder of the Processing code(RobotArmControl.pde)

// Language: Processing// RobotArmControl.pde

// by Sam Thongrong Feb 26, 2012

// load the serial library for Processingimport processing.serial.*;// instance of the serial classSerial port;

// control commands array:// GripOut, GripIn, WristUp, WristDown, ElbowUp, ElbowDown,// ShoulderUp, shoulderDown, BaseCW, BaseCCW, LightOn, LightOff, Stop

int[] controls = new int[] {0x47, 0x67, 0x57, 0x77, 0x45, 0x65,0x53, 0x73, 0x42, 0x62, 0x4c, 0x6c, 0x58 };

// Image button.// Loading images and using them to create a button.ImageButtons GripIn;ImageButtons GripOut;ImageButtons WristUp;ImageButtons WristDown;ImageButtons ElbowUp;ImageButtons ElbowDown;ImageButtons ShoulderUp;ImageButtons ShoulderDown;ImageButtons BaseCW;ImageButtons BaseCCW;ImageButtons LightOn;ImageButtons LightOff;

ImageButtons Pause;

// backgroundPImage bg;

// set the fontPFont myFont;

void controlGUI(){bg = loadImage("background.jpg");background(bg);

int buttonSize = 44;

PImage selected = loadImage("controlSel.png");

//Grip InPImage gripInImage = loadImage("controlIn.png");PImage gripInOver = loadImage("controlInOver.png");GripIn = new ImageButtons(30, 83, buttonSize, buttonSize,

Page 23: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

gripInImage, gripInOver, selected);

//Grip OutPImage gripOutImage = loadImage("controlOut.png");PImage gripOutOver = loadImage("controlOutOver.png");GripOut = new ImageButtons(78, 83, buttonSize, buttonSize,gripOutImage, gripOutOver, selected);

//Wrist UpPImage wristUpImage = loadImage("controlUp.png");PImage wristUpOver = loadImage("controlUpOver.png");WristUp = new ImageButtons(150, 36, buttonSize, buttonSize,wristUpImage, wristUpOver, selected);

//Wrist DownPImage wristDownImage = loadImage("controlDown.png");PImage wristDownOver = loadImage("controlDownOver.png");WristDown = new ImageButtons(198, 36, buttonSize, buttonSize,wristDownImage, wristDownOver, selected);

//Elbow UpPImage elbowUpImage = loadImage("controlUp.png");PImage elbowUpOver = loadImage("controlUpOver.png");ElbowUp = new ImageButtons(258, 83, buttonSize, buttonSize,elbowUpImage, elbowUpOver, selected);

//Elbow DownPImage elbowDownImage = loadImage("controlDown.png");PImage elbowDownOver = loadImage("controlDownOver.png");ElbowDown = new ImageButtons(306, 83, buttonSize, buttonSize,elbowDownImage, elbowDownOver, selected);

//Shoulder UpPImage shoulderUpImage = loadImage("controlUp.png");PImage shoulderUpOver = loadImage("controlUpOver.png");ShoulderUp = new ImageButtons(208, 160, buttonSize, buttonSize,shoulderUpImage, shoulderUpOver, selected);

//Shoulder DownPImage shoulderDownImage = loadImage("controlDown.png");PImage shoulderDownOver = loadImage("controlDownOver.png");ShoulderDown = new ImageButtons(256, 160, buttonSize, buttonSize,shoulderDownImage, shoulderDownOver, selected);

//Base CWPImage baseCWImage = loadImage("controlCW.png");PImage baseCWOver = loadImage("controlCWOver.png");BaseCW = new ImageButtons(130, 234, buttonSize, buttonSize,baseCWImage, baseCWOver, selected);

//Base CCWPImage baseCCWImage = loadImage("controlCCW.png");PImage baseCCWOver = loadImage("controlCCWOver.png");BaseCCW = new ImageButtons(178, 234, buttonSize, buttonSize,baseCCWImage, baseCCWOver, selected);//Light OnPImage lightOnImage = loadImage("LightOn.png");PImage lightOnOver = loadImage("LightOnOver.png");LightOn = new ImageButtons(30, 184, buttonSize, buttonSize,lightOnImage, lightOnOver, selected);

//Light OffPImage lightOffImage = loadImage("LightOff.png");PImage lightOffOver = loadImage("LightOffOver.png");LightOff = new ImageButtons(78, 184, buttonSize, buttonSize,lightOffImage, lightOffOver, selected);

}

void setup() {// List all the available serial ports in the output pane.// You will need to choose the port that the Arduino board is// connected to from this list. The first port in the list is// port #0 and the third port in the list is port #2.//println(Serial.list());// Open the port that the Arduino board is connected to// (in this case #0)// Make sure to open the port at the same speed Arduino is// using (112500bps)//port = new Serial(this, Serial.list()[1], 112500);

// On Window PC, use "Outgoing" of the bluetooth device// This one for XBeeport = new Serial(this, "COM30", 115200);

Page 24: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

// screen size of the program//size(145, 455);size(400, 300);smooth();

// test ellipseellipseMode(RADIUS);textFont(createFont("Verdana", 14));

controlGUI();

}

void updateDisplay() {

GripIn.update();GripIn.display();GripOut.update();GripOut.display();

WristUp.update();WristUp.display();WristDown.update();WristDown.display();

ElbowUp.update();ElbowUp.display();ElbowDown.update();ElbowDown.display();

ShoulderUp.update();ShoulderUp.display();ShoulderDown.update();ShoulderDown.display();

BaseCW.update();BaseCW.display();BaseCCW.update();BaseCCW.display();

LightOn.update();LightOn.display();LightOff.update();LightOff.display();}

//Send Commandsvoid sendCommands() {

// Gripif(GripIn.pressed) {port.write(controls[0]);//println("Grip In: " + (char)controls[0]);}if(GripOut.pressed) {port.write(controls[1]);//println("Grip Out: " + (char)controls[1]);}if(mouseX > 30 & mouseX < 129 &&mouseY > 51 & mouseY < 79) {port.write(controls[12]);//println("Grip Stop! " + (char)controls[12]);}

// Wristif(WristUp.pressed) {port.write(controls[2]);//println("Wrist Up: " + (char)controls[2]);}if(WristDown.pressed) {port.write(controls[3]);//println("Wrist Down: " + (char)controls[3]);}if(mouseX > 148 & mouseX < 248 &&mouseY > 5 & mouseY < 33) {port.write(controls[12]);//println("Wrist Stop! " + (char)controls[12]);}

// Elbowif(ElbowUp.pressed) {port.write(controls[4]);//println("Elbow Up: " + (char)controls[4]);}if(ElbowDown.pressed) {

Page 25: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

port.write(controls[5]);//println("Elbow Down: " + (char)controls[5]);}if(mouseX > 258 & mouseX < 358 &&mouseY > 51 & mouseY < 79) {port.write(controls[12]);//println("Elbow Stop! " + (char)controls[12]);}

//Shoulderif(ShoulderUp.pressed) {port.write(controls[6]);//println("Shoulder Up: " + (char)controls[6]);}if(ShoulderDown.pressed) {port.write(controls[7]);//println("Shoulder Down: " + (char)controls[7]);}if(mouseX > 208 & mouseX < 308 &&mouseY > 130 & mouseY < 158) {port.write(controls[12]);//println("Shoulder Stop! " + (char)controls[12]);}

// Baseif(BaseCW.pressed) {port.write(controls[8]);//println("Base Rotate CW: " + (char)controls[8]);}if(BaseCCW.pressed) {port.write(controls[9]);//println("Base Rotate CCW: " + (char)controls[9]);}if(mouseX > 130 & mouseX < 230 &&mouseY > 202 & mouseY < 230) {port.write(controls[12]);//println("Base Stop! " + (char)controls[12]);}

// Lightif(LightOn.pressed) {port.write(controls[10]);//println("Light On: " + (char)controls[10]);}if(LightOff.pressed) {port.write(controls[11]);//println("Light Off: " + (char)controls[11]);}}

void draw(){updateDisplay();

sendCommands();}

// Button & ImageButtons Classesclass Button{int x, y;int w, h;color basecolor, highlightcolor;color currentcolor;boolean over = false;boolean pressed = false;

void pressed() {if(over && mousePressed) {pressed = true;} else {pressed = false;}}

boolean overRect(int x, int y, int width, int height) {if (mouseX >= x & mouseX <= x+width &&mouseY >= y & mouseY <= y+height) {return true;} else {return false;}}}

Page 26: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

class ImageButtons extends Button{PImage base;PImage roll;PImage down;PImage currentimage;

ImageButtons(int ix, int iy, int iw, int ih,PImage ibase, PImage iroll, PImage idown){x = ix;y = iy;w = iw;h = ih;base = ibase;roll = iroll;down = idown;currentimage = base;}

void update(){over();pressed();if(pressed) {currentimage = down;} else if (over){currentimage = roll;} else {currentimage = base;}}

void over(){if( overRect(x, y, w, h) ) {over = true;} else {over = false;}}

void display(){image(currentimage, x, y);}}

// Processing End

To control Robot Arm motor, moves the cursor to the required button and click.To stop operation just move the cursor to any label. Robot will stop.In order to operate multiple motors at once, move the cursor to the buttons required, and click those buttons.But do not drag cursor pass over the labels, that will cause the operation to stop

Enjoy!.

Image Notes

Page 27: Robotic Arm 1

http://www.instructables.com/id/Make-Wired-Robotic-Arm-Edge-to-Wireless-with-DIY/

1. Robotic Arm Control GUI

File Downloads

RobotArmSourcesCode.zip (249 KB)[NOTE: When saving, if you see .tmp as the file ext, rename it to 'RobotArmSourcesCode.zip']

Step 15: Videoembed video text for instructables.

Here is the video, pardon me if the video is too long (~8 min.) because this is my first Robot Arm!

Image Notes1. XBee Module on the PC(Laptop).This is the FTDI Cable Mod. I modified the cable to be located underneath the XBee module.2. XBee Module on the Robotic Arm

Related Instructables

DIY Mod anOmnibot 80'sRobot withVoice, Camera,Servos,Bluetooth bydjsures

Modifications toRobot Arm forOpto CouplerFeedback, OWI535, Edge etc byjomac_uk

PROTEI_007 bygabriellalevine

Control an OWIRobotic Armwith Arduino byzlite

OCCU(PI) Bot byrandofo

Build "TheRevIO" (ArduinoClone) My Wayby sath02