Pages: [1]   Go Down
Author Topic: Driving a motor shield from external power  (Read 708 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Sorry for the newbie question (or this is how this might sound like) but I cannot seem to understand the following situation: I cannot power this motor shield from external power: http://www.ebay.com/itm/251080674810.

I have both motors hooked to the right place, also the 4 control pins (IN1-IN4) are connected to arduino where I instruct both of them to rotate:
  digitalWrite(IN1,HIGH);
  digitalWrite(IN2,LOW);
  digitalWrite(IN3,HIGH);
  digitalWrite(IN4,LOW);  

This works fine as long as I power the motor shield from +5V and GND pins of the Arduino. BUT when I connect the +5V and GND (I also tried it first with the 12V input) directly to a 9V battery, the motors don't move at all, but the red light indicating power does light up, only the motors don't move. I tried removing the 5V, also didn't make any difference. And here comes the stranges part (at least to my basic knowledge): if I connect the +5V and GND of the motor shield to the SAME 9V battery that powers Arduino, the motors move! Why is connecting the motor shield to the same battery that Arduino is using different than connecting it to a separate 9V battery? Again, if I connect the shield directly to the +5V and GND pins of Arduino, the motors move (only not that fast) OR if I connect to the +/- terminals of the SAME battery that is connected to arduiono, it works, but using a separate battery it doesn't move, just the red light is lit up.

The motors that I use: www.ebay.com/itm/160964087637

I cannot seem to understand this, so some help would be really welcome. smiley

Thanks!
Bence
« Last Edit: March 05, 2013, 12:35:44 pm by bbence » Logged

Johannesburg. UTC+2
Offline Offline
Faraday Member
**
Karma: 82
Posts: 3844
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sounds to me that what's missing is that when you power the board externally, you didn't connect the ground of the board to the ground of the Arduino?- Difficult to tell without you showing a circuit, but that might be the problem.

Without the grounds linked, the Arduino control signals to the board have no meaning, since they are 5v as far as the Arduino is concerned but not to the shield since it has no 0V to measure the supposed 5V against.

Edit: Pic added... something like this is needed, see the 0V between the Arduino and the motor board

Edit: The 298 chip in that board guzzled volts by the way... you need about 2-3 (iirc) more in than you need at the motor.


* Power supply.jpg (8.9 KB, 435x195 - viewed 34 times.)
« Last Edit: March 05, 2013, 12:51:42 pm by JimboZA » Logged

The Elders of the Internet know who I am.....
Get me on LinkedIn: za.linkedin.com/in/jimbrownza/

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

DOH! smiley
How could I have missed this?
Indeed, the ground was not connected to Arduino. Somehow I forgot about this.
But now it works like a charm. Thanks!

One more question if you don't mind: for me it's not that clear from the description what are the PWM pin for the motors? Is it IN1 and IN3?
Logged

Johannesburg. UTC+2
Offline Offline
Faraday Member
**
Karma: 82
Posts: 3844
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
what are the PWM pin for the motors? Is it IN1 and IN3?

If I remember correctly, last time I used an L298 I PWM'd the ENable pins
Logged

The Elders of the Internet know who I am.....
Get me on LinkedIn: za.linkedin.com/in/jimbrownza/

Offline Offline
Newbie
*
Karma: 0
Posts: 11
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks, works like a charm (except this issue: http://arduino.cc/forum/index.php/topic,153427.0.html)

Thanks again!
Bence
Logged

Pages: [1]   Go Up
Jump to: