Show Posts
Pages: [1]
1  Using Arduino / Installation & Troubleshooting / Error Message When trying to Upload Code (But only sometimes) on: March 26, 2013, 12:21:22 am
Hello everyone:

I just upgraded to the Mega 2560 for a project I'm working on. I keep getting the following message when I try to upload code: avrdude: stk500v2_getsync(): can't communicate with device: resp=0x01

It was working fine earlier, but suddenly it began giving me this message. Earlier while it was working, I kept having to unplug and replug the usb because it kept telling me that "the com port is already in use" or that it couldn't find that com port, even though I had literally just uploaded stuff to the board. Any suggestions? Also, I'm using Windows 7.
2  Using Arduino / Motors, Mechanics, and Power / Re: Motor Shield Capable of Driving 5 DC motors? on: February 22, 2013, 12:29:55 pm

It's the Uno (Soon to have a Mega 2560 subbed in for it for more pins). I'm sure that's exactly what my problem is though. I just overlooked the pin with the "~" symbol on it in my haste. I'm not at home right now, but I'll give it a whirl when I get back. And thanks for the advice on the (pwmPin, 0) portion! I've saved the adjustment. 

Thank you,
-Jeff F.
3  Using Arduino / Motors, Mechanics, and Power / Re: Motor Shield Capable of Driving 5 DC motors? on: February 22, 2013, 10:16:12 am
The short answer is that if you don't need it, don't use it. But it may be required to terminate it. Check the datasheet for that.


I got my H-Bridge in and got it all wired up to the arduino, motor and external supply. I decided not to use the current sense pin (pin 8) or the thermal flag ouput (pin 9), as I have no use for them in this project. Since I'm not going to use it, I first tried my test program with pin 8 & 9 NOT connnected to anything. The program compiled with no errors, but I got no movement with the motor. I then tried connecting the current sense output pin to ground with a 2.7kΩ resistor between the connection and ground (see pg 6 on the datasheet, as it shows a test circuit example schematic), still nothing. I have yet to try to connect the thermal flag output to anything, as I figured it really shouldn't affect the program working properly. I've checked over my circuit to make sure all the connections are correct multiple times. Is something wrong with my code that it's not running properly? (Keep in mind that the only coding that I ever really mess with is assembly for one of my classes and ladder logic for PLC's, so I'm not the best with this C++ based stuff). My code is as follows:

int pwmPin=4;//defines PWM input to LM18200
int dirPin=5;//defines direction input to LM18200
int brkPin=6;//defines break input to LM18200
int speed=127;//defines the speed of the motor (half speed)

void setup()




void forward()

//Necessary conditions to drive the motor in the forward direction

analogWrite(pwmPin,speed); //Sets speed of motor by PWM
digitalWrite(dirPin,HIGH); //Direction pin goes HIGH
digitalWrite(brkPin,LOW); //Brake pin is disabled


void reverse()

//Necessary conditions to drive the motor in the reverse direction


analogWrite(pwmPin,speed); //sets speed of motor by PWM
digitalWrite(dirPin,LOW); //Direction pin goes LOW, causing motor to turn opposite direciton
digitalWrite(brkPin,LOW); //Brake pin is disabled


void brake()
//Necessary conditions to short the motor terminals and "brake" the motor


void loop()

brake(); //Brakes inbetween directions to avoid immediate direction chnge

Any suggestions?
 Oh and here's the datasheet again to keep from having to hunt it down in previous posts:

Thank you,
-Jeff F.
4  Using Arduino / General Electronics / Creating Extra Interrupt Pins on Mega 2560 on: February 19, 2013, 07:59:27 pm
I'm in need of 8 interrupt pins to read channels A & B of four motors and do not want to invest in the DUE (since any of it's pins can allegedly be used for interrupts), as there seems to still be a lot of confusion in using it since it's relatively new. Is there any way I can assign 2 more pins (aside from the predetermined 6 on the Mega)?

Jeff F.
5  Using Arduino / Project Guidance / Re: Motor Shield R3 pin question on: February 13, 2013, 10:41:22 am


I knew the board I have is capable of running just two DC motors, but I thought that I would be able to hook up more motors as long as I build an H-bridge circuit separately?


Oh, I'm sorry. I miss understood your question. Using external H-Bridge should work just fine. I'm actually dealing with that in a project I'm working on, except I have to build 5  smiley-eek ... But yes you could hook up external H-bridge circuits to pins 1-8 and 11 to drive other motors. If you want to save yourself some time from having to build the H-Bridge circuit, you could just use the free pins mentioned earlier to connect to another motor driver (One that's not a shield or that doesn't stack so you can choose which pins to connect it to). It may be a little more expensive to buy a pre-built motor driver circuit vs building an H-bridge circuit, but it'll save ya a little time. I hope this helped.

6  Using Arduino / Project Guidance / Re: Motor Shield R3 pin question on: February 12, 2013, 02:08:37 pm
Will I have enough room and which pins are open after using the two hook ups for DC motors.

You'll only be able to run 2 of your DC motors using that shield, but if you want to run 4 DC motors (as you've listed) you may may check out the shield in the link below. Although, the shield you're using can handle more current than the one I've recommended and makes it a lot easier to use the avaialbe pins the arduino has due to the pass through style headers . Do you have a datasheet for the DC motors you're using? The shields are rated at certain voltages & currents that they are capable of handling. The one in the link below is capable of controlling 4 DC motors at 0.6A per bridge. The shield/driver you use really just depends on what your DC motors are rated as.
7  Using Arduino / Motors, Mechanics, and Power / Re: Motor Shield Capable of Driving 5 DC motors? on: February 12, 2013, 01:41:46 pm
Guessing - I haven't used one, but I'd assume that the current sensing pin gives you the opportunity to measure the current the motor is pulling, on the arduino by using analogread and doing a little math. This would let you detect when your motors are stalled.

Yes, that is typically what it is used for. It is also used for torque feedback, which some applications require.

Ok, sweet. Thanks a lot guys!
8  Using Arduino / Motors, Mechanics, and Power / Re: Motor Shield Capable of Driving 5 DC motors? on: February 12, 2013, 01:05:19 pm
It looks like you would only need a few common components to get that H-Bridge running. The examples show a PWM chip being used, but if you will be using the PWM from the arudion, you don't need that. The bootstrap caps are necessary. Depending on whether you wish to use the current sense output, it looks like you may need a few more common components.

I have learned one thing from looking around at these.... I am in the wrong business. Good Lord on these prices. Ridiculous!

Ha! No kidding on the prices! I can get the bootstrap caps and necessary resistors (for the current sense output) from one of the labs at the university. Another question though, what is the current sensing actually there for? I read on the datasheet that the LMD18200 uses sinking and sourcing outputs. Does the statement (below) from the datasheet just mean that the current sensing pin is used for sourcing? I guess what I'm really trying to ask is why is pin 8 there and what purpose does it serve?

The CURRENT SENSE output (pin 8) has a sensitivity of 377 mA per ampere of output current. For optimal accuracy and linearity of this signal, the value of voltage generating resistor between pin 8 and ground should be chosen to limit the maximum voltage developed at pin 8 to 5V, or less. The maximum voltage compliance is 12V. It should be noted that the recirculating currents (free
wheeling currents) are ignored by the current sense circuitry. Therefore, only the currents in the upper sourcing outputs are sensed."
9  Using Arduino / Motors, Mechanics, and Power / Re: Motor Shield Capable of Driving 5 DC motors? on: February 10, 2013, 09:14:07 pm
If you use H-Bridge ICs, they may already have flyback diodes installed. If they do not, they are a smart thing to add. Other than that, the IC really doesn't typically need anything extra. For my TA7291S chips for example, you have IN1 and IN2 which control forward or reverse, and you have OUT1 and OUT2 which you wire up to your motors. These also have the flyback diodes built in. Look at the datasheet for a "typical application circuit." I attached it.

The S comes in a really compact SIP package which I find nice to work with. You would need one for each motor. The L298 ICs are quite different, but they do have two H-bridges in them, so you can control 2 motors with one IC.

However, since these cannot handle 6A directly, point me to some of the ones you found and I might be able to give you a hand with putting the circuit together.

Hi RetroPlayer,

Thanks again. I found this H-Bridge. I did see on the datasheet that it has a built in protection diode. It looks like it can handle the amount of current & voltage that is required. It has a continuous output current of 3.0A with a peak output current of 6A. Since the motors have a max peak stall of 5.54A, I figure this will be suitable. Although these would be $75 for five,  I'm willing to drop the money if this is my only option. Would I be able to just buy these with no extra circuitry/design and connect them to the arduino & motors?
10  Using Arduino / Motors, Mechanics, and Power / Re: Motor Shield Capable of Driving 5 DC motors? on: February 07, 2013, 04:35:00 pm
Thanks! After looking more for shields that are capable of the specifications, I still cannot find one. I've found a few H-Bridge IC's capable of handling 6+Amps, but I have no idea where to begin on building my own H-Bridge circuit. Are the "support components" you mentioned absolutely necessary if I buy my own parts to build 5 H-Bridge circuits or can I just wire up the motors & Arduino Straight to the H bridges?

Thank you,

11  Using Arduino / Motors, Mechanics, and Power / Motor Shield Capable of Driving 5 DC motors? on: February 04, 2013, 04:08:02 pm
Hi Everyone,

I'm in search of a motor shield that would be compatible with the Due that is capable of Driving 5 DC motors that opperate on 12 to 24V. I found one from Adafruit capable of controlling four DC motors at 4.5VDC - 25VDC. The link below contains information on the DC motors that are being used. I wouldn't call it a datasheet, as it is very limited in information, but has enough to determine what type of motor shield I'll need. As far as a solid datasheet goes, I've used search engines with the serial number in hand, called the manufacturer (Pittman), and offered compensation for a datasheet from Pittman, and did not get a response. The motors are on a SCARA robot that was used by the University back in 70's, so info is a bit tough to find. Thanks for the help in advance.

12  Topics / Robotics / Re: Rhino SCARA Robot on: January 14, 2013, 12:39:24 pm
Thanks for the help guys!

According to the doc the "optics" encoders appear to be quadrature encoders. This tutorial shows an encoder knob that is functionally and electrically equivalent to what you have.
I read this and tried to run the code for the encoder without a pushbutton, but did not receive results. Two problems on my end that are causing no feed back with the program provided on the page you referred me to are 1). I don't know how much voltage these encoders are supposed to be supplied with (I've tried 3.3V and 5V). Having said this, when I connect power to the encoder, it's not drawing any current. 2). As cr0sh and I are discussing, I have not found a way to get a datasheet on the motors/encoders to figure out the information needed as stated in my first point.

The picture of that robot is pretty poor, but from the look of things, those motors appear to be Pittman DC motors, with encoders. Have you tried contacting the current manufacturer of these motors (whomever they are) for datasheet info (and hookup info for the encoders)? If they are Pittman, contact info here:

Note - be nice, state what you are wanting in plain language, offer to pay for the information (literature shouldn't be too expensive - but I can tell you that the gears in those motors are not cheap, so don't break them!).

Yes, their whole website is poorly put together. Anywho, you are correct about the motors being pittman. I tried to email them on January 9th, but they did not respond to my email. I also offered some type of compensation for the information, but still nothing. As I mentioned above, when I apply power, the encoder is not drawing any current. I've tried connected to three of the five just to see if one or two may be bad or something, but I don't think that's the problem. I've got the red wire connected to power, the black to ground and the blue and green wires are Channels A and B (if encoder in the link that Chagrin posted is similar to the ones on these motors) of the encoder which are connected to pins 2 and 3 on the arduino.  I think I'll try and call Pittman to see if I can speak with someone directly because datasheets would be extremely helpful.
13  Topics / Robotics / Rhino SCARA Robot on: January 11, 2013, 01:00:33 pm
Hi Everyone,

I'm new here, but I'm using an arduino for this project, so I figured this would be the best place to seek help/guidance. I'm working a project and have run into a couple of questions before I proceed. A little background info first..The project uses a Rhino SCARA (See first link below) and an Arduino uno. My objective is to eventually get the robot interfaced with the arduino so that it can be programmed to do simple tasks (such as picking up an object, placing somewhere and moving back to the home position) for the purpose of getting this robot worked back into the cirriculum at the university. The robot's wiring has been completely obliterated by whoever was the last to mess with it, so if you checked out the link to view the SCARA robot I'm working with, picture that, but with no wiring.. The robot was bought by the university back in the 70's (which is why finding info on it is difficult). Since the robot is so old and has apparently been through a lot, my first step of the project is to test all of the components on the bot. I've tested all 5 motors to assure that they are still functioning, which they do.  My next step is to figure out a method for testing the encoders attached to each motor's shafts. The second link below has somewhat detailed info on the encoders. The company (Rhino Robotics) is awful about communicating back and the manuals aren't worth a crap..They responded to one of my emails a couple months back and have not done so since, so I know the company still exists.   smiley-confuse ..... Anywho, could any of you suggest a method for testing these encoders?


Pages: [1]