Go Down

Topic: Motor shield not working correctly (Read 904 times) previous topic - next topic

eric9489

I have an arduino uno w/ motor shield. I programmed a code to just have motor A rotate one direction continuously, just to make sure it was working. Well nothing happened, no lights or movement on the shield. I thought it was the code, however when I picked up the arduino my finger touched some pins on the bottom of the microprocessor  and the shield lit up and the motor started turning. The only way the motor will turn is if I physically touch digital pin 3 or some pins on the processor.

Anyone know why this is happening??

fkeel



Did you assemble the motor shield yourself?
How do you have your motor connected? Did you try any other connections?
What else are you touching when you touch pin3? Does simply applying pressure to it do the same trick or does it need to be your finger? Is the shield inserted properly?
What do you mean by "some pins on the processor"?
Maybe sharing the code might also be helpful.

Right now we have very little to go on in order to help you.
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

eric9489

The motor shield was purchased from Radio Shack as well as the uno. The motor is connected to the + and - connectors for motor A. Using a 9 volt battery to power motor. If I push on the two boards to try to get a better connection  while it is sitting on the table it does nothing. It only works when I touch the bottom of the uno board around  pin 3, I can post the code I'm using when I get home in an hour and a half.

Brewgyver

Are you using Pin 3 in your sketch?  If so, I would suspect either a bad contact from Uno Pin 3 to the Shield header pin 3,  (could also be a bad ("cold") solder joint). You can test (with board powered down) using multimeter, touching pin 3 stub solder joint on bottom side of Uno and top of pin 3 on Uno.  If open, push as you did before and see if resistance drops to 0.  If already at 0 resistance, attach shield and repeat, with probes at underside of Uno and top of Shield pin 3.

eric9489

Here is the sketch that I'm using:

int dirA = 12;
int dirB = 13;  // not used in this example
int speedA = 10; // not used in this example
int speedB = 11; // not used in this example


void setup()
{
  pinMode (dirA, OUTPUT);
  pinMode (dirB, OUTPUT);
  pinMode (speedA, OUTPUT);
  pinMode (speedB, OUTPUT);
}



void loop()
{
  // move the motor A to one direction
  digitalWrite (dirA, HIGH);


}


Pin three is not used at all in this sketch, I used a multimeter to verify that the connection is good just in case.

Now that im back home playing with the boards I noticed that I can run my fingers up and down the stubs on the bottom of the uno from pins 1-5 and it will vary the motor speed as well as turning it on and off. No contact from my finger to bottom of uno= no movement of the motor.

Look at my sketch, I think it may be wrong somewhere?? I loaded the "blink" sketch on the arduino, to test if it would do the same thing... well it does, touching the bottom pins powers on the motor ... is this because of the resistance of my finger triggering the motor to come on??

If my sketch is wrong, please help me fix it

fkeel

Try changing the variable SpeedA to 3

(I have not used this shield)

I think it requires a signal on pin3 to set the speed of the motor. Currently it is not sending anything, so the motor is not moving. If you touch pin3, static electricity or your bodies capacitence or something induces a slight current on pin3, which makes the motor move.

you also need to the actually send the signal. probably analogWrite(speedA, 100); or something like that. (the value after speedA should be something between 0 and 255)

Does that help?

Search the forums, there is more info floating around.


p.
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

fkeel


so to drive the motor, you need two values

first you need to set whether it goes forward and backward (by setting the apropreate pin to high or low) then you need to set the speed (by pulsewidth modulating the correct bin (analogWrite set to a value between 0 and 255).

(google PWM, if you dont know what it is.)

cheers

p.
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

eric9489

fkeel, thanks for your post, it saved me a lot of frustration. It is performing as expected after I changed the sketch with the other value. With no fingers attached

fkeel

yay! glad to have been of service :-) good luck with your new toy :-)
http://embodimentlabs.tumblr.com/
http://paulstrohmeier.info/

Go Up