Shop OBEX P1 Docs P2 Docs Learn Events
$2.86 L298N Motor Driver Module (Must Try to not Buy...) — Parallax Forums

$2.86 L298N Motor Driver Module (Must Try to not Buy...)

ercoerco Posts: 20,254
edited 2014-02-12 20:49 in General Discussion
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
«1

Comments

  • Martin_HMartin_H Posts: 4,051
    edited 2012-12-25 18:37
    That's an amazing deal. An L298 IC alone cost $3.00 from Spark Fun and they have one of the best prices on it.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-12-25 18:47
    This looks a little different than the last L298N board you linked to.

    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?
  • ercoerco Posts: 20,254
    edited 2012-12-25 19:01
    Duane Degn wrote: »
    This looks a little different than the last L298N board you linked to.

    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
  • RDL2004RDL2004 Posts: 2,554
    edited 2012-12-25 20:32
    You guys don't actually believe that's a genuine L298N chip at that price?
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-12-25 20:38
    erco wrote: »
    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
  • ercoerco Posts: 20,254
    edited 2012-12-25 21:14
    Yep, sorry 'bout dat. That first board has a pushbutton switch switch (5V in on/off?) which the newer board with the regulator doesn't.
  • ercoerco Posts: 20,254
    edited 2012-12-25 21:15
    RDL2004 wrote: »
    You guys don't actually believe that's a genuine L298N chip at that price?

    I bet it's genuine leaded solder, too! :)
  • Martin_HMartin_H Posts: 4,051
    edited 2012-12-26 04:56
    RDL2004 wrote: »
    You guys don't actually believe that's a genuine L298N chip at that price?

    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.
  • ercoerco Posts: 20,254
    edited 2013-01-02 09:36
    Can you sense the magic (smoke) in the air? Did you see fireworks on New Year's Eve? Is 2013 an electrifying year already?

    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.
  • Martin_HMartin_H Posts: 4,051
    edited 2013-01-02 09:45
    erco wrote: »
    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.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-01-02 10:29
    Thanks for the warning erco. I have two different versions of these on their way. I'll be careful when I connect them to a Propeller.
  • ercoerco Posts: 20,254
    edited 2013-01-02 22:50
    OK, got it. My mistake. Upon closer examination, that first board also had a small onboard voltage regulator to deliver 5V to the TTL logic on the board. The little white pushbutton switch may break that connection, but I just cut the regulator out to be safe since I already fried one BS2 HW board when I hooked 36V up for the motor. Once I did that, it was piece of cake driving with bit-banged PWM off another HW board. 24V motor on 24 VDC shown here. Here's my video & code:
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    ccw:LOW 0
    FOR B0=0 TO 20     ' ramp up ccw
    B1=20-B0
    FOR B2=1 TO 10
    HIGH 1
    PAUSE B0
    LOW 1
    PAUSE B1
    NEXT
    NEXT
    HIGH 1
    PAUSE 500  ' full on 1/2 sec
    LOW 1
    FOR B0=0 TO 20     ' ramp down ccw
    B1=20-B0
    FOR B2=1 TO 10
    HIGH 1
    PAUSE B1
    LOW 1
    PAUSE B0
    NEXT
    NEXT
    
    cw:LOW 1
    FOR B0=0 TO 20        ' ramp up cw
    B1=20-B0
    FOR B2=1 TO 10
    HIGH 0
    PAUSE B0
    LOW 0
    PAUSE B1
    NEXT
    NEXT
    HIGH 0
    PAUSE 1000  ' full on 1/2 sec
    LOW 0
    FOR B0=0 TO 20       ' ramp down cw
    B1=20-B0
    FOR B2=1 TO 10
    HIGH 0
    PAUSE B1
    LOW 0
    PAUSE B0
    NEXT
    NEXT
    
    END
    
  • ercoerco Posts: 20,254
    edited 2013-01-02 23:21
    Tested module to destruction folowing that test. :) She was fine at 43 volts, no load. Added 2 more Li-Ions fresh off the charger and the 298 sparked and smoked at 51 volts, no load. :) Sparkfun rates them at up to 46 volts, so maybe these are fake 298s, that 5-volt margin should not have resulted in instant smoke like that. At any rate, I suspect they are fine for 24-30V, at lowish currents. These 24V MPJA motors have a stall current of 1A at 24V, so this module should handle two of those. Will advise if I find out otherwise.
  • ercoerco Posts: 20,254
    edited 2013-01-04 13:21
    Found this pdf on a similar module (not much info direct from Ebay sellers on the modules I've ordered): http://blog.pennybuying.com/down/f/F815A.pdf

    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.
  • mindrobotsmindrobots Posts: 6,506
    edited 2013-01-05 04:55
    We care!!

    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)
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-01-10 14:21
    I received my my first set of four of these controllers a few days ago. I haven't tested them yet, but I'll make sure and use resistors on the signal lines to hopefully protect my Propeller.

    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.
  • ercoerco Posts: 20,254
    edited 2013-01-10 14:58
    Duane Degn wrote: »
    I think you're right about the between pulse lows causing the robot to brake.

    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.
  • ercoerco Posts: 20,254
    edited 2013-01-12 22:54
    As I suspected, there is a noticeable difference between modes:

    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.
  • ercoerco Posts: 20,254
    edited 2013-01-13 00:04
    Another pointless coast/brake demo, sans ramping. I'm the only one who cares. :(
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-01-19 11:06
    erco wrote: »
    As I suspected, there is a noticeable difference between modes:

    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.
  • ercoerco Posts: 20,254
    edited 2013-01-19 11:27
    You mean someone's actually following my ridiculous rants & ramblings? :)

    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.
  • Martin_HMartin_H Posts: 4,051
    edited 2013-01-19 12:44
    Duane Degn wrote: »
    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.

    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.
  • ercoerco Posts: 20,254
    edited 2013-01-19 14:34
    I'm pretty sure my diode trick will enable coasting with just 2 pins. A PWM signal on either input pin will feed into ENable at the same time, but it will allow coasting during the off phase. But what likely won't pan out is braking too. My intent was to drive both input pins on the 298 high, but apparently there's no shoot-through protection on the 298 and that would smoke it in short order. Not sure that the "overtemp" protection on these Chinese 298s would save them.

    Actually I am surprised that the data sheet for the 298 doesn't mention that. Guess they're encouraging "repeat purchases".
  • ercoerco Posts: 20,254
    edited 2013-02-28 10:27
    Aren't these colorful modules gorgeous, cinematically filmed on nice background paper with delightful music? When they're this appealing, who cares how well they function?
  • mindrobotsmindrobots Posts: 6,506
    edited 2013-02-28 10:30
    Sell the sizzle, not the steak!
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-02-28 12:23
    It's kind of strange they go through the trouble of making a nice video when then not have them for sale?

    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).
  • ercoerco Posts: 20,254
    edited 2013-03-18 06:45
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-03-18 10:22
    I was just looking at the ones in the top post. I didn't buy any since the price had gone 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.
  • ercoerco Posts: 20,254
    edited 2013-03-20 13:10
    Repeating the seller's warning, which I learned from direct experience:

    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...
  • ercoerco Posts: 20,254
    edited 2013-10-02 21:00
    Shack L298P shield, likely a clearance price of $2.48: http://www.radioshack.com/product/index.jsp?productId=12333768

    If you find one, grabbit!
Sign In or Register to comment.