$2.86 L298N Motor Driver Module (Must Try to not Buy...)
erco
Posts: 20,256
Feb 2014 edit: price dropped from $3.40 to $2.86, so I changed this post's title. See last post in thread for link.
Sure I ordered another one. They're on sale and it's Christmas! L298N has some voltage drop, which is less noticeable at higher voltages, like 24V.
Just try to say no to erco at that price. Sale ends in 1 day!
http://www.ebay.com/itm/1PCS-HW-01-Stepper-Motor-Drive-Controller-Board-Module-L298N-for-arduino-/110953019447?pt=LH_DefaultDomain_0&hash=item19d550b837
Sure I ordered another one. They're on sale and it's Christmas! L298N has some voltage drop, which is less noticeable at higher voltages, like 24V.
Just try to say no to erco at that price. Sale ends in 1 day!
http://www.ebay.com/itm/1PCS-HW-01-Stepper-Motor-Drive-Controller-Board-Module-L298N-for-arduino-/110953019447?pt=LH_DefaultDomain_0&hash=item19d550b837
Comments
I ordered a couple of the other boards and I'll probably get two four of these. These have an onboard 5V regulator so you only need to provide one supply voltage.
BTW, the L298N seems to work fine on 3.3V logic.
It's crazy that this board only costs $0.45 more than a bare breakout board from SparkFun. Add the L298N chip and you're up to $5.90 and you'd still need some diodes. The ebay board even has a nice heatsink. I just can't figure out how they can do sell it for so little and provide free shipping?
Duane, you miss nothing. Here's the last one I bought, ~$1 more: http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItemVersion&item=110942422752&view=all&tid=931359100001
I get a dead link with that.
Here's the one I bought.
http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&item=110942422752&ssPageName=ADME:L:OC:US:3160
I bet it's genuine leaded solder, too!
It's an interesting question. It's possible it's counterfeit, but it's also possible that it is a grey market import and wasn't supposed to make it to the US market.
Two examples. Gillette razor blades are fairly pricy in the US. But Gillette has plants in India and Russia making similar products which sell for much less in those local markets. This is because the local market can't support US prices. However those items often get grey market imported into the US and sell for prices well below the US items. The movie studios had region codes added to DVD's to allow for similar market segmentation, except the Internet made the whole scheme irrelevant.
Grey market items are not counterfeit, but the manufacturers are generally not happy about competing with themselves.
YES to all of these for me! I released the magic smoke from a BS2 HW board New Year's Eve when I hooked up the other L298N: http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItemVersion&item=110942422752&view=all&tid=931359100001 (not the $3.40 board initially mentioned here). Not sure if the 298 board was bad, but it bricked the Stamp portion (5V regulator still works) when I connected 24V, I think somehow the (TTL?) control lines back to the Stamp got exposed to 24V. I had hoped to Youtube a successful test of this bargain module on New Year's Eve. But thus far, this particular Ebay deal hasn't saved me any money.
So go easy when you first try these out. Like maybe limit motor Vdd to 5V for initial tests, and measure voltage on the 298 input pins before connecting them to a uC. Will report back when my new $3.40 boards come in.
RIP BS2 HWB. I'm originally from the south, where we fry everything. But this is my first Kentucky Fried Stamp. The regulator still works, so at least it's still useful as a 5V breadboard.
Well I don't feel so bad for missing out on that bargain. Just think, you now hand an excuse to replace that HW board with a Propeller Quick Start board.
This recommends sending the PWM signal on the ENable line. Now on the module I tested, there was a jumper tying ENable to +5V, so I didn't even use that line. The L298N datasheet from Sparkfun says that the ENable line also enables dynamic braking. That is, when ENable is high, the motor is either going fwd, reverse, or being braked. And anytime ENable is low, the motor is always coasting off.
That's actually a huge difference, but I know from my past rants that I'm the only one who gives a hoot about dynamic braking: http://www.youtube.com/watch?v=hGQEzz8CNIQ
Nonetheless, there's a key difference since I sent my PWM signal on one of the two control input lines and grounded the other. Worked a treat in my test, as the video shows, and only used two I/O pins. But I suspect that my method is dynamic braking the motor during the brief off phases of PWM. Whereas sending the PWM signal on the ENable line would simply let the motor coast during the brief PWM off phases. So...
In order to have full control over dynamic braking and coasting, it appears that 3 control lines per motor are required, potentially 3 I/O pins. Any time the two control lines are both high or both low, dynamic braking happens when ENable is high. BUT if we were to add an NAND gate to the control lines, we can use that output to drive the ENable line so that motor control HIGH+HIGH input=LOW output to ENable, which enables coasting, and motor control LOW+LOW input=HIGH output to ENable for dynamic braking. Saves one I/O pin per motor.
I realize that no one cares, but I feel better having written this down before I forget. Heck, I'll use it for my own reference.
Personally, I'm not at a point with any of my robots where dynamic BRAKING is an issue.....I'm more at the dynamic BREAKING stage! :0)
I'm trying to change my Mecanum code to use the enable pin instead of one of the 'in" pins with these chips. I think you're right about the between pulse lows causing the robot to brake.
I haven't received the $3.40 control boards yet.
I already received the two $3.40 boards, ordered Christmas day... They arrived Saturday, fast ship. I'm gonna use one on a big bot (Retrobot sized, ~15 lb). I'm gonna try a new method for two wire control. I think an isolation diode on each line (INA, INB) both going to ENA will allow coasting when both low and enable braking when both high. Will smoke test that soon.
Speed controller shows 2 different modes here, controlled by Parallax BS-2 bit banging PWM. Same PWM ramping up/down profile in both directions. But clockwise, motor coasting is enabled (enable low) during off phase of PWM. Motor spins fairly fast and quiet. Counterclockwise, dynamic braking is on (enable held high) during off phase of PWM. Motor spins slower and "growls" loudly. More power consumed and more wear on motor commutator & brushes. BTW, ~2.0 volts drop through the 298 in both directions. 32VDC here gives 30 volts to motor at full power.
Thanks for the video erco!
I'm switching my L298 driven bots over pulsed enabled instead of pulsing an "IN" pin. This reinforces my idea that this is a good thing to do.
I doubt any of my bots so far need dynamic braking since they stop pretty fast once power is reduced. Maybe when I have a big heavy bot that could coast for a while without power, I'll worry about dynamic braking.
Braking might not be absolutely necessary if you ramp down properly, but every well-rounded roboticist should strive to have access to it! It might not necessarily take 3 uC pins. I have soldered up (but not tested yet) a diode from each direction pin to the enable pin. Think this will give me all 4 combinations, fwd, bwd, coast & brake. Will test & advise.
Alternatively, have a peek at http://www.societyofrobots.com/member_tutorials/book/export/html/159
In part 2 they suggest a tristate approach to get all four combinations, but it requires a transistor + 3 resistors per channel. IMO 2 diodes is easier.
Duane, I use the SN754410NE in 3 pin mode for the same reason. I'm fairly certain that the only way to coast is to bring ENA low, otherwise both non driving combinations brake the robot if you use PWM on the direction pins.
Actually I am surprised that the data sheet for the 298 doesn't mention that. Guess they're encouraging "repeat purchases".
I couldn't find them anywhere on their site.
I tried the following searches without any results: L289N, L298, Motor Controller, Motor Driver.
I did get results with "Motor", but I didn't see the L298N boards among the 164 results (though I didn't look very carefully).
Only the second time I've seen them under 4 bucks.
Stock up!
I just purchased four of these.
Thanks erco.
BTW, these little red PCBs are just small enough to fit under the base of my AX-12 Smart Arm. This makes it easier to mount the Smart Arm on a robot. Which makes it easier to have a mobile robot arm draw a figure 8.
I'm not sure if either of my Rover 5s will be able to handle the weight of the Smart Arm but I'm going to give it a try.
Built-in 78M05,get power from drive power, however, when drive power over12V, please use the external 5v power as power supply.
These particular L298N modules have a jumper to utilize the onboard 5V regulator. Similar types use a pushbutton switch. Get it right the first time if you use 32VDC motor voltage like I did. IIRC, even when hooked up properly, that pushbutton could be pressed anytime to release lots of magic smoke. I'd remove it completely if I were using over 12V motor voltage to eliminate the possibility.
And temptation... I wonder what that button does...
If you find one, grabbit!