Professional Documents
Culture Documents
Lucky Larry
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 1/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
You can see some other work Ive done with motor
DC motor control and Ill be covering the same info
throughout these posts.
Step 1
First we need to create our breadboard layout so we
can plug in all the wires, were going to be using alot
of pins on the Arduino, in fact I think I use pretty
much all of them. You could reduce this using shift
registers but for now its not an issue, although
please follow the wiring diagrams as this layout gives
the least hassle. Some pins e.g. digital pin 13 will
make the motors move when the board is powering
up so we want to avoid this.
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 3/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 4/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
Step 2
Now the circuit layout is complete we can start
stripping down the arm. First remove the control
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 5/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
Shoulder motor
chip 1, pin 1 to Arduino pin 14 (Analog pin o)
chip 1, pin 2 to Arduino pin 15 (Analog pin 1)
chip 1, pin 7 to Arduino pin 16 (Analog pin 2)
Base motor
chip 1, pin 9 to Arduino pin 2
chip 1, pin 10 to Arduino pin 3
chip 1, pin 15 to Arduino pin 4
Elbow motor
chip 2, pin 1 to Arduino pin 8
chip 2, pin 2 to Arduino pin 9
chip 2, pin 7 to Arduino pin 10
Wrist motor
chip 2, pin 9 to Arduino pin 5
chip 2, pin 10 to Arduino pin 6
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 6/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
You can see the battery power has been added. If you
have any problems you can always connect one
motor at a time and use a quick sketch to test the
circuit is working and below is some simple codeto
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 7/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
[ad#Google Ad in content]
int baseMotorEnablePin = 2;
int baseMotorPin1 = 3;
int baseMotorPin2 = 4;
int shoulderMotorEnablePin = 14;
int shoulderMotorPin1 = 15;
int shoulderMotorPin2 = 16;
int elbowMotorEnablePin = 8;
int elbowMotorPin1 = 9;
int elbowMotorPin2 = 10;
int wristMotorEnablePin = 5;
int wristMotorPin1 = 6;
int wristMotorPin2 = 7;
int handMotorEnablePin = 11
int handMotorPin1 = 17;
int handMotorPin2 = 18;
void setup() {
// set the motor pins as
outputs:
// set all chips to enabled
state
pinMode(baseMotorPin1, OUTPUT);
pinMode(baseMotorPin2, OUTPUT);
pinMode(baseMotorEnablePin,
OUTPUT);
digitalWrite(baseMotorEnablePin,
HIGH);
pinMode(shoulderMotorPin1,
OUTPUT);
pinMode(shoulderMotorPin2,
OUTPUT);
pinMode(shoulderMotorEnablePin,
OUTPUT);
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 8/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
digitalWrite(shoulderMotorEnablePi
n, HIGH);
pinMode(elbowMotorPin1, OUTPUT);
pinMode(elbowMotorPin2, OUTPUT);
pinMode(elbowMotorEnablePin,
OUTPUT);
digitalWrite(elbowMotorEnablePin,
HIGH);
pinMode(wristMotorPin1, OUTPUT);
pinMode(wristMotorPin2, OUTPUT);
pinMode(wristMotorEnablePin,
OUTPUT);
digitalWrite(wristMotorEnablePin,
HIGH);
void loop() {
/*
// SET either one to HIGH to
turn the motor on.
// e.g.
digitalWrite(baseMotorPin1,
LOW);
digitalWrite(baseMotorPin2,
HIGH);
*/
digitalWrite(baseMotorPin1,
LOW);
digitalWrite(baseMotorPin2,
LOW);
/*
// more motors here added.
digitalWrite(shoulderMotorPin1,
LOW);
digitalWrite(shoulderMotorPin2,
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 9/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
LOW);
digitalWrite(elbowMotorPin1,
LOW);
digitalWrite(elbowMotorPin2,
LOW);
digitalWrite(wristMotorPin1,
LOW);
digitalWrite(wristMotorPin2,
LOW);
*/
[ad#Google Ad in content]
Step 3
So now you should have all the motors wired to
chips on the breadboard, now we just add the power
to the board and were done this is the power from
the robot arm batteries, it can connect on either side
of the breadboard as long as its connected to the
power rails. Also remember to connect a wire from
the GND rail on the breadboard to a GND pin on
Arduino there must be a common ground
connection between Arduino and the H-bridge chips
for this to work. Lastly Find a way to secure the
Arduino and breadboard to the arm to minimise the
risk of wires disconnecting, I just used some blu-tak
(modelling clay etc..).
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 10/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
Onwards
So thats it, the arm is ready to go you can add your
own switches and inputs to control this but were
going to have some fun writing software to control
this arm in the next part to move each motor AND
after that were going to be looking at using Inverse
Kinematics and trigonometry to do some cool
controlling of all the motors of the arm and to maybe
start program tasks.
68 Comments
March 19, 2010
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 11/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
6:39 AM wow. i didnt know you can control DC motors like that!?
By calfred thanks for posting this. very valuable. its so accurate , more accurate
than servos.
Reply
March 19, 2010 It can be pretty accurate and you can use the h-bridge chips
10:32 AM with PWM to create speed control. But you can only measure
By larry the motors rotation using a rotary encoder otherwise you cant
accurately read the motor position its a problem Im facing
with the arm currently as I have no real way to measure
movement of the motor whereas with servos this is built in so
they tend to be more accurate for robotics.
Reply
Reply
Edgar Acosta
Reply
Reply
April 13, 2010 Cheers, youre at exactly the same stage as me I was looking to
5:23 PM use the wheel encoders from a mouse, just have to alter the case
By larry to connect them to the motors.
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 12/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
Reply
Thanks.
Reply
July 28, 2010 Hi Larry thanks for this great tutorial! My son and I are working on
1:03 AM it now (we are trying to add a robotic arm to his Spykee robot) but
By Alan have a small problem we have 6V going into the chip but only 3V
coming out so the motors are struggling. I tried taking the 5V logic
voltage from the Arduino board instead of the motor power and this
took the motor output up to 3.5V but we seem to be getting a big loss
of voltage somewhere that I cant understand. Any suggestions?
Cheers,
Alan
Reply
July 29, 2010 Which chip are you using? Generally I use a separate power
9:07 AM supply to drive the motors, all chips etc.. are powered off
By larry another supply e.g. the 5v arduino.
Anyway let me know which chip youve got running the motors.
Reply
July 29, 2010 Why the chips cannot control 4 motors? They have 4 input and
9:50 AM outputs no?
By sierra maybe it is a stupid question, sorry
Reply
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 13/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
Reply
July 29, 2010 Hi Larry its the SN754410 the one you suggested. Ive got the
11:24 AM motors being powered off one battery and all the other inputs come
By Alan from the Arduino. Ive moved up to using a 9V battery and it passes
through about 4.7V which is OK as it gives nice gentle movements of
the arm. We eventually will be trying to get it to operate remotely
from a laptop (as Spykee does) so we hope to control the arm while
watching through the web cam. Just wondering if it is normal for
that voltage drop to occur? Cheers. Alan
Reply
July 29, 2010 OK think Ive sorted it out, but not quite sure what was going on. I
1:02 PM found Id actually been getting weird low output voltages right back
By Alan from the Arduino pins, and it seemed to be caused by something
wrong in the program (which Id modified a bit). When I removed
this section
-
if (incomingByte == O) {
digitalWrite(baseMotorPin1, LOW);
digitalWrite(baseMotorPin2, LOW);
digitalWrite(shoulderMotorPin1, LOW);
digitalWrite(shoulderMotorPin2, LOW);
digitalWrite(elbowMotorPin1, LOW);
digitalWrite(elbowMotorPin2, LOW);
digitalWrite(wristMotorPin1, LOW);
digitalWrite(wristMotorPin2, LOW);
digitalWrite(handMotorPin1, LOW);
digitalWrite(handMotorPin2, LOW);
}
-
the Arduino output voltages were suddenly fine. I changed to using
a switch case statement rather than all the if ones and it was all
good, and the outputs from the chip were much stronger. I dont
understand it but at least its working now. Cheers, Alan.
Reply
July 29, 2010 I was going to suggest the draw of the motors to see if they were
5:02 PM draining to much at stall.
By larry
Very odd you had issues with the code as mine worked with 6v
from the robot arm. Ill keep an eye out for this, could be
inefficient coding.
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 14/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
Reply
July 29, 2010 Hi Larry its not your programming on that first line I quoted I
9:48 PM was using a zero, not an O. That probably confused things
By Alan somewhat! With the switch case statement I used the default clause
to turn off all motors (meaning I can hit any other key), so thats why
it worked again. Thanks for your help anyway, and thanks again for a
great tutorial. It really got us going with this project.
Cheers, Alan
Reply
Steve
Reply
Reply
August 02, 2010 absolutely! You can use PWM via Arduino as a speed controller.
5:17 PM Although You may want to use PWM on the motors power
By larry supply rather than the H-bridge power supply.
Reply
August 31, 2010 Larry I was wondering if you could just wire up the enable
1:32 PM pin to v+ on the chip ? Im assuming once enabled its just
By CdRsKuLL a case of setting the input pins to either LOW or HIGH
Spykeemods.co.uk dependant on which way you want the motor to go ? If you
set them both to LOW does the motor stop ?
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 15/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
cheers
Steve
Reply
September 16, 2010 i am extending you project by adding wiimote to control the robot
5:44 AM and also server and client software to control the robot from any
By amit where in the world.i am going to make it an opensource project.if you
have time you can join me in this project i am already done with the
wiimote controle and right now working on the server and client.will
be back with the updates.
Reply
September 16, 2010 oh regarding inverse kinematics that you were talking above i did a
6:09 AM project for my robotic course which i have open sourced .it is robot
By amit simulator with forward kinematics .here is the link for the project
http://sourceforge.net/projects/fanucrobotlrmat/files/. we can
modify it and use it for inverse kinematic calculations.here is the
video of the simulation
http://www.youtube.com/watch?v=b_nJ7FBHsAc&feature=related
and the video of the real robot
http://www.youtube.com/watch?
v=qe0A2p9RvWY&feature=watch_response
Reply
Reply
Shoulder motor
chip 1, pin 1 to Arduino pin 14 (Analog pin o)
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 16/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
The diagram of this chip is really there just to explain what each
pin does on these chips.
Reply
I wrote the code under the caption The Arduino Sketch uploaded
that but nothing happened. Do i have write all the codes in one
window to have the arm operated from a loptop?
Reply
Now you need to leave the arduino board connected and close
the Arduino software and start up the Processing software (get
it from processing.org) and copy and paste that sketch in there
and run that it will then allow you to control the arm using
that simple program by sending/receiving data over the USB
port.
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 17/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
Reply
October 19, 2010 Hi Larry just wanted to thank you again for the great tutorial. It
9:02 AM really inspired us and gave us the confidence to tackle this project. If
By Alan you want to see what we came up with Ive just written a blog entry
here:
http://simplycomputing.com.au/archives/37
Reply
October 19, 2010 That Spykee Robot is awesome, well done its impressive
9:37 AM
Reply
By larry
One other thing, would it be ok with you if i borrow a part your code
for a project Im doing? Ill be sure to give you the credit. Im sure my
other friends would be interested in this.
Reply
January 08, 2011 Hey sorry, in the delay in getting back to you by all means
11:48 AM take the code and do what you want with it, love to see what
By larry youve done with it
Reply
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 18/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
By TheDeadLives I was wondered if i could do that, but transforming the robot arm to
be wireless, using
Arduino Xbee Shield c/Xbee, in order to make the robot wirelessly
connect to the pc, so we could be on one side of the world and the
arm in the other, and control it, from internet (network). Could it be
possible?? And could u do that??
Grateful
Reply
January 08, 2011 Yep, absolutely I dont have an Xbee so cant test btu as long
12:04 PM as the signal gets to the Arduino to then control the motors itll
By larry work fine.
Reply
January 14, 2011 If anyone is interested, i managed to modify the four main motors in
6:06 AM my robotic arm, (which is the same as Larrys) and fitted some
By John Lannigan slotted optos inside, with a bit of care (a hell of a lot actually) I
drilled 6 holes in the brown cog that is directly driven from the
motor. Rough calculations show that the feedback is approximately
1000 pulses for a 180 degree travel. Looking on the scope, i get a nice
square wave out from each motor.
Ive removed the battery clips and cut away some of the plastic that
seperated the two rows of batteries, ready for a home made shield, to
take the Arduino, H Bridges, voltage regulators etc.
For the gripper, ive fitted a current sensing module, that feeds back
the grip pressure to the Arduino, I can preset the amount of grip the
jaws can give, with a similar sensor in the elbow, I would think i
could weigh things..(?)
Reply
January 14, 2011 The closest I got was attaching rotary encoders to the cogs do
11:06 AM you have any pictures of your modifications? As I think thatd
By larry help a few of us out to see what you did
Reply
January 14, 2011 Yes i have Larry, whats the best way of getting them to you?
4:54 PM
John
By John Lannigan
Reply
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 19/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
January 15, 2011 Hi,
12:03 PM
Ive done an instructable on how to mount the slotted optos inside
By John Lannigan the motor gearbox assembly, i hope you find this useful in modding
your own.
John
http://www.instructables.com/id/Modifications-to-Robot-Arm-for-
Opto-Coupler-Feedba/
Reply
January 21, 2011 Has anyone ever managed to add a 6th motor for a wrist to this robot
7:25 AM arm, to allow the jaws to rotate?
By John Lannigan
Any ideas of comments would be very welcome, as im tempted to
have a go!
John
Reply
January 21, 2011 Not that I know of cant be too hard to do though, I guess you
10:36 AM just need to cut the forearm part in half and do some clever join
By larry
Reply
January 23, 2011 Stay Tuned Larry, ive removed the jaw section, made a simple gear
12:05 PM box which fits onto the gear box before the jaws, using quite a lot of
By John Lannigan the original parts, some modified, some made, hopefully it should all
work?
John
Reply
February 25, 2011 hi johnjust wondering how can i make a import processing.
8:56 PM serial.*;im having a problem about that issue..could you help
By OZeP_99 me out or give some ideas on how to make itthank you so
much
Reply
Reply
Grateful
Reply
Reply
April 08, 2011 Ah this is interesting when the motors are connected to the
12:30 PM switching circuit it seems to have a common ground between
By larry them on the PCB. Best bet would be to cut the plug off and send
power down each pair of wires until you get a motor to run or
see if you can find information on the colour code, though I bet
its not standard.
Reply
Reply
April 02, 2011 Do you say that the robotic arm has control switches for making
12:45 AM the motors move?
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 21/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
By ivhan if thats true why didnt you just replace the signal sended by the
switches for some transistors, optocoplers, maybe relays(not usefull
if working with PWM), it seems more accurate and you dont need to
use the H bridge that in case of a medium or intermediate power
requirement are expensive. Despite that, your idea seems pretty cool
because you are controlling directly the motors and qhat you were
needing was an acceptable mecanism. (Y)
Reply
April 08, 2011 Its reeally done with the parts I had (and understand). the
12:20 PM control switches were all PCB based so it was easier just to build
By larry my own so I could do that I also thought PWM would have
been accurate with the motors, but turns out not so!
Reply
April 30, 2011 Im interested in building such a robot arm, but Im totally new when
11:02 PM its come to this field (The only skill I have is coding). So, I have a
By Dat question, for connecting jumpers to chips, do I have to know
soldering?
Reply
July 26, 2011 thx Larry you are the best^^ my robo mod
4:53 PM http://www.youtube.com/watch?v=AdYiPQ80Pvc
By mitchman
Reply
Reply
September 03, 2011 Nice little tutorial thanks! Im a developer, but not really dabbled in
10:57 PM electronics much its fun making stuff move
By Alex Key
http://www.youtube.com/watch?v=57ehTylkzO0
Reply
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 22/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
September 10, 2011 cool nice hack http://www.youtube.com/watch?v=jUC28lnVTq8
11:21 PM
Reply
By mitchman
September 26, 2011 Would I be able to use the Arduino UNO instead of the Arduino
8:49 AM Deumilanova w/ ATMEGA328? I am trying to hack this arm as well
By Nidal for a studio project.
Reply
January 08, 2012 Did you find out if this can be done with the UNO? Im trying it
6:29 AM with an UNO and not getting any response. Could be that Im
By dudleyjohn just a noob at this and made a dumb mistake. Id like to know if
its possible, though, so I dont keep going down a blind alley.
Reply
January 15, 2012 Well, they have the same 328p processor and pinouts, so
2:27 PM they should both work the same, right?
By dudleyjohn
Reply
September 27, 2011 [] figured someone else must have done this, so I googled it, and
7:30 PM indeed,this guy did something similar. Cool. Nice to have someone
By RobotRanch Mad figure out the details. And I can learn while []
Chomp
Reply
February 22, 2012 hello!! Im happy i found your site.. i am planning to make this
8:58 AM one..where do i can buy this robot kit?
By BOLOGTOY
Reply
March 23, 2012 Really interested blog. I would like to know if the Arduino
4:26 AM Deumilanova w/ ATMEGA328 can be used to control a MA2000
By mario robotic arm? Also could you provide a schematic diagram for the
circuit within the blog? Thanks in advance.
Reply
Thank you
Reply
April 29, 2012 Edgar, its not any sort of component, its just a short jumper
3:19 AM wire with a bit of red insulation
By Andrew Scheller
Reply
May 30, 2012 Wouldnt be easy just to change the DC motors to servo motors? Can
4:39 PM this be done?
By Felipe
Reply
August 27, 2012 Im interested in this also and from what I can see it look likes
9:36 AM they can be driven directly from the Arduino board without
By Dean needing an additional driver shield board.
Reply
August 16, 2012 i want to know of the robot arm kan lift 250 gr, because i like to use it
6:06 AM for winding my watches, 5 0r 6 each time, one by one,
By hans Thanks
Hans
Reply
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 24/25
4/15/2017 Arduino Modifying a Robot Arm Lucky Larry
This link is for a guy who has added small trim pots to the arms to
measure their position creating a closed feedback loop. He uses the
Arduino Uno and a motor shield and its a project was going to try.
http://www.instructables.com/id/Intro-and-what-youll-need/
Reply
Email (required)
Website
You may use these HTML tags and attributes: <a href=""
title=""> <abbr title=""> <acronym title=""> <b>
<blockquote cite=""> <cite> <code> <del
datetime=""> <em> <i> <q cite=""> <s> <strike>
<strong>
Post Comment
http://luckylarry.co.uk/arduino-projects/arduino-modifying-a-robot-arm/ 25/25