Wednesday, February 26, 2014

Review: Arduino Motor Drivers: L298N Module

Last year I did a pair of reviews of various cheap motor driver modules, but I wasn't entirely happy with any of them for the purposes of spinning a couple of small robot wheels around. There was one module which had ended up delayed, probably lost in the Christmas parcel backlog, and only finally turned up a few weeks ago:

  • L298N DC Stepper Motor Dual H Bridge Drive Controller Board : $3.25 

Frankly, it's the best so far for the job. Well Recommended.

There are several variants floating around. You're looking for one with the L298N chip (not D or P or any other suffix including none) and you're also looking for those rows of huge diodes next to it. There's a variant that has the diodes internal to the chip, but you know what that means? All the heat gets to stay in. External diodes means the '298 can push more watts through the H-bridge. It's not a modern chip, so that matters.

I have mine working at both 5 volts for the logic AND the motor power (in fact, the same +5.2V supply connected to both the +12V and +5V power inputs - this is barely allowed by the spec, but does work fine) and I've tried PWM at various frequencies as well as full drive in both forward, reverse, and fast changes in direction. I managed to get the heatsink warm.

I expect that larger motors running at the full 12V could push this to "Hot", and you'd want to worry about airflow. But for 6V robots or cars, enclosing it is not a problem.

It's very easy to drive, with only four wires needed, one for each half of the H-bridges. You could also break out the 'enable' lines, but there's really no point - on my module, they are the two small jumpers you can see on the sides of the pin header which bridges them to +5V. (in other words, permanently enabled.) I can't see a reason why you would want control over these, unless you were doing weird things with separate PWM sources, extreme power saving, or had an "Emergency Stop" hardware control path. (In which case, good for you!)

The particular module I got also had a 5V regular on-board, which could be handy in some situations, but I basically disabled it for my installation. The Low-Dropout regulator on the Arduino is far superior, if you need one.

Let's get my main gripe out of the way, which is that I hate terminal blocks. Sure, I used them a bit during early testing, but now that I'm giving the module a permanent home I've pulled them from the board like bad teeth.

"What's wrong with terminal blocks?" you ask? Nothing, if you like your wires randomly coming loose and flopping around the neighboring terminals. Personally, I don't. Especially high-current motor windings.

You'd think they'd work fine, and if you have "single core" wire then perhaps they do. But most of us use multistrand wire, which is like trying to hold a rope in a vice: it works at first, but eventually the bundle of fibres shifts and settles into a different shape - usually compressing enough to slip out of the vice. Assuming the screws don't rattle loose first.

Tinning the wires doesn't help much either, because solder is soft and malleable, deforms, and slips out of the vice. Grrr. 

For ten minutes, it's fine. For permanent installation it's a failure waiting to happen. 

And they're huge and heavy and take longer than soldering, and their in-contact surface area (therefore current capacity/resistance) is essentially random. Into the parts bin they go.

Here's the module all wired up and installed into the base of a "Rover 5". There's a pair of fairly standard DC motors (and gearboxes) driving the treads, though you can't really see them. (The long black cylinders are "choke" inductors to suppress motor noise.) The module has been running this rig for weeks now.

And because it won the shoot-out for best motor module in this class, that's where it's going to stay.


  1. Hmmm. I've always blamed myself when wires I thought firmly held later slip out. Just some random sloppiness on my part, I'll try to be more careful next time. But it keeps happening, now and then. Maybe you are right, and it's partly that terminal blocks themselves are somewhat unreliable, and I'm never going to get it consistently right. SIgh.

    1. Try tinning the end of your stranded wires (to make them solid) before inserting into terminal block.

    2. Nope; as I mentioned, that doesn't work either. The solder also deforms (it's not elastic) and it slips loose, it just takes a little longer.

      They're especially bad on anything that gets vibration, like motorized robots.