Adding external power source to power motors?

I'm following these instructions. In it, there is a schematic which I've attached for your convenience. and the block diagram.

The motor driver module I am using is this.

I think I would need an external power soruce for more powerful motors such as 12V ones. How would I add on to the circuit shown above to accomodate for the need for external power? Will it require changes to the code? because I would prefer not to have to tinker with the code there but if necessary, I can try (with guidance of course).


Well were is the motor power supply at the moment?- you don't show the 298's Vs in the block diagram. The INx pins aren't the supply, just the control, if my '298 memory isn't faulty.

EDIT: Yep, just checked the datasheet. ENa, IN1 and IN2 control one motot, ENb, IN3 and IN4 the other; over and above those you still have to supply the correct voltage for the motors on the '298 pin Vs... you must already be doing that, else nothing would work.

The Instructables link has the code so I'm assuming there is something there that manages the voltage going to the motors to control them. I also haven't built the robot yet. I'm still gathering the parts so I just want to know what I'd need if I were to use more powerful motors.

Isn't that the wire shown at the bottom right corner of the first diagram ?

I think the two power supplies have to have a common ground.

michinyon: Isn't that the wire shown at the bottom right corner of the first diagram ?

I think the two power supplies have to have a common ground.

The first diagram wasn't there before: it's a later edit.

The 298 datasheet doesn't use the term Vcc, so that Vcc might be either Vs the motor supply, or Vss the logic supply, who knows?. According to the L298 datasheet Vss is actually supposed to be between 4.5 and 7, with 5 typical. That 3.7 to 7.4 is a little outside that, but I see they're using Lipos so that's where that comes from: either 1x for 3.7 or 2x in series.

So back to the original question: You can drive motors with up to almost 50V (Vs max = 46). Put about 5V into Vss to drive the chip (assuming their experience shows 7.4 is safe, ymmv) and put enough voltage into Vs to drive the motors. The whole idea of the 298 and similar chips is to let you control that hefty motor power by "tickling" the chip with low power controls from somewhere, Arduino in this case.

A word on the efficiency of the 298. Look at the datasheet, find the line VCE Sat at bottom of page 3/13. It shows a minimum voltage drop of 1.8, and this becomes 3.2 or 4.9V at 1 or 2A. You will therefore always need to make Vs at least 2V higher than the voltage required by your motor; you'll need it to be 5V more at high current. That's why the board has the chip mounted on a heat sink as big as a truck: lots of energy getting wasted into the air as heat.

You might like to consider a more modern approach like this, tiny and no heat sink, although that particular model doesn't go quite to 12v.... Point is the 298 is "old school" and very inefficient: check the supplier sites and you'll find a less wasteful chip with the right voltage. (Edit: This one handles 15v, and is 0.8" (20mm) square.)

EDIT: You might like to give some thought to that 3.7 to 5V that they're putting into the Arduino. Have a look at the Arduino UNO specs or Leonardo specs; nowhere does it say that they can run under 5V. In fact, 5V will only work if you put it into the USB socket; other inputs like the barrel jack or Vin require 6V min, 7V and up recommended. So what you could do here, assuming as I said that 7.4 is ok for the 298's Vss, is use 7.4V to drive the 298 logic on Vss, the motors via the 298 Vs, and the Arduino via Vin.

Then if you need higher voltage for the motors, leave the 7.4 for Vss and the Arduino, put the 12V into Vs for the motors. Link the grounds or else you won't have a circuit...

More edit: I'm leaving for work soon, it's 615 am here.... my office lan is intranet only, and I get almost non-existent mobile modem coverage, so I'm off the air for the day, most likely.

Thing is, I don't really know coding. Since the Instructables is supposed to be simple, I figure I wouldn't need to change much if at all.

The "Motor Driver 1A Dual TB6612FNG" at seems fine but wouldn't it require changing some code? I'd like to avoid that if possible.

Yep you would probably need to change the code a bit for a different chip.

But if you stick with the original board, a la the instructable, and are happy to live with its inefficiency, then you can run any motors up to the Vs maximum voltage without changing any code.

The Arduino controls the 298, which in turns controls the Vs through to the motor/s... so the Arduino control is exactly the same, just supply the right Vs to suit your motors.

I think I'll stick with inefficiency for now. If I were to run the motors to maximum voltage (what is that maximum voltage by teh way?), I still wouldn't need external power? Would the current schematic remain as it is now.

I'm not sure what you mean by "external power": external to what? Call it what you like, internal or external, you must supply Vs and Vss to the 298. Vss powers the logic in the chip (its transistors which do the work) and Vs is controlled by the chip and which powers the motors.

I said above, the maximum the 298 chip can handle on the motor side is Vs= 46V; that's as distinct from the voltage which drives the chip itself, which is Vss ~ 5V (4.5 - 7)

I also said above, the current schematic is wrong in the first place: it doesn't show Vs going to the 298. If your motors run at the same voltage as the chip and all can run off the same power (perhaps that's what you mean by internal vs external?), the put the ~7V to both inputs on your motor driver board so that both Vs for the motors and Vss for the 298 are the same.

EDIT: Have a look at the pic in reply 11 of this thread which shows both a 5V and a motor voltage going into the 298: you must supply both of those. (The pic reminds me: your schematic doesn't show the ENx pins, which would usually be connected from the Arduino to the 298 board, and which are typically used to PWM the motor for speed. Your pic shows PWM via INx which is ok, as long as the EN pins are made 5v or the motor will not be enabled. I can't see in your schematic, or in the instructable's code, where the EN pins are made 5v.....)

If the motors need Vs > Vss then supply that higher Vs to the 298 board from what I guess you mean as "external" power.

Remember though, that according to the 298 datasheet (which I hope you've downloaded ;) ):

  • the 7.4V is actually more than Vss max of 7V so use at your own risk
  • you will always lose about 2V of the motor supply Vs, even at no load. That loss is intrinsic to the 298's design, may go as high as 5V. You need to supply that much more than the motors actually need because it doesn't make it out the far side of the 298

What i meant was whether or not I can power the motors using the powersource that goes power the Arduino. Specifically. do I somehow make the energy from te power source go through the Arduino and to the motors to power them?

You can use the same power source, subject to my comments on the suitability of the voltages in the posts above, just by taking wires from the battery to the Arduino and more wires to the motor controller. That way the power to the motor board is straight from the battery, and doesn’t “go through” the Arduino.

The pic below shows 2 batteries in series with a 0v (or ground) wire at left, a 3.7v wire in the middle, using only left battery (that is, 3.7 compared to the 0), and a 7.4v wire at the right using both batteries (that is, 7.4 compared to the 0), and a wire joining the left battery +ve to the right battery -ve. That way, you can get both the voltage of a single battery and that of both, at the same time.

I’d advise, before you apply those wires to anything, to test the voltages with your multi-meter, to satisfy your self that’s how series voltages work. If you don’t have a meter, strongly suggest you get one…

batteries in series.jpg

Ok then. Thanks a lot for your help!