L298N H-Bridge burned up

What just happened? Can my H-bridge not handle the load?

Bipolar Stepper (OSM Technology Co.,Ltd. )

  • 1.8° step angle (200 steps/revolution)
  • Manufacturer Part Number: 17HS19-2004S1
  • Motor Type: Bipolar Stepper
  • Holding Torque: 59Ncm(84.1oz.in)
  • Rated Current/phase: 2.0A
  • Phase Resistance: 1.4ohms
  • Recommended Voltage: 12-24V

Dual H-bridge driver

  • Chip: L298N
  • Logic voltage: 5V TTL
  • Logic ViL Max. 1.5, ViH Min. 2.3V
  • Logic current 0mA-36mA
  • Maximum power: 25W
  • Drive voltage: 5V-35V
  • Drive current: 2A (For each DC motor)

H-bridge voltage supplied: 24VDC

I used the sketch stepper_oneStepAtATime.ino to test and check if all my wiring is right, and that is when the H-Bridge wend up in smock. Note, I am using pin 7 through 10, not 8 through 11 as suggested in the original sketch; but that should not matter.

#include <Stepper.h>

const int stepsPerRevolution = 200;  // change this to fit the number of steps per revolution
// for your motor

// initialize the stepper library on pins 8 through 11:
//   >> I am using pin 7 through 10 - not 8 through 11:
Stepper myStepper(stepsPerRevolution, 7, 8, 9, 10);

int stepCount = 0;         // number of steps the motor has taken

void setup() {
  // initialize the serial port:
  Serial.begin(9600);
}

void loop() {
  // step one step:
  myStepper.step(1);
  Serial.print("steps:");
  Serial.println(stepCount);
  stepCount++;
  delay(500);
}

How did You limit the current to the stepper motor resp. how to limit it within the spec of the L298?
As I remember that driver You blew 24/1.4 = 17 Amps, a clear smoke generator.

The L298 is ancient technology. The L298 is really crappy motor driver by today's standards and an even worse stepper driver. Throw the L298 away and get an appropriate stepper driver. The TB6600 driver will be able to provide 2A per phase. The DRV8825 stepper driver can handle 1.5A coil current without heat sink and up to 2.2A with heat sink and forced air cooling.

Which ever driver that you choose, make sure to set the coil current before using the motor. The Pololu page has instructions for setting the DRV8825.

1 Like

Sorry - I am not sure I understand. I connected to motor wire straight to my H-bridge A/-A and B/-B.

Steppers are named being "motors" but the are way different from brushed DC motors etc.
Steppers are powered by pulses from current limiting drivers. The L298 is not such a driver. Wrong driver for a stepper but maybe possible to use on some small DC motors.

Thank you. That helps a lot!

The stepper motor basics tutorial may be of interest.

Thank you for all that info. It looks like I will end up getting three TB6600 drivers for my three motors.

I had a look at the video I found on the DRV8825 page you provided the link to, and was wondering if I need to set the driver to provide 2A per phase?

In my application I probably overshot the torque requirements by quite a bit. So would it be OK to say have it set to 1A/phase even though the motor is rated to handle 2A/phase?

And ... in the "Customer questions & answers" section I found this:

Questions: hi, i can use this driver with arduino? Thanks
Answer: Yes you can. you need to built a buffer circuit. EX. uln2003, or use a 2n2222a as seen on the data sheet.
By Milt K. on April 2, 2015

Would I need to build a buffer circuit? (I am using a Seeeduino)

Yes, that is fine. At a lower current the motor will run cooler and last longer.

No, you do not need any kind of buffer. The logic signal inputs to the TB6600 are a maximum of 15mA. Most any Arduino digital output will drive the optocoupler that is in the input of a TB6600.

Which Arduino board are you using?

The DRV8825 can handle at most about 1.5 A/phase without extra cooling. So you need to set the driver for 1.5A or preferably a bit less.

I am using 4 Seeeduino XIAO in my project. But this was probably not the best choice.

Doing a search for mA on that page I found this comment:


According to the ATSAMD21G18A [the MCU used in the XIAO] datasheet, It depends on what the "Driver Strength" is set to.

Driver Strength = 0 ["Normal" Drive strength -- though their definition of "Normal" is way below what I would consider normal, as far higher drive capability goes!]:

I Out Low @ 3.00-3.63V: 2.4mA
I Out High @ 3.00-3.63V: 2.0mA

Driver Strength = 1 ["Stronger" Drive strength -- Yes, stronger, but No, still below what I would even call "Normal"!]:

I Out Low @ 3.00-3.63V: 10mA
I Out High @ 3.00-3.63V: 7mA

So, it depends on whether the default, for the XIAO is "Normal" or "Stronger" -- though, I suppose this could be altered, say, in the Setup() function(?)

But, in either case, the short answer is: not much! And, in fact, [far] less than you would think!!

I mean, considering that a standard Arduino UNO can comfortably do 20mA, and can actually do as much as 40mA [the Absolute Max], [in the temperature range: -40°C to 85°C], and still be in spec [as long as the output voltage is not too high/low for the application], but 20mA is the Recommended Max.


This could explain why one of my H-Bridge would note even respond to anything I would try. (?)

What I see on the data sheets for the TB6600 driver is 8 to 15mA for the control signals. That makes sense because they are driving the LED of an optocoupler.

Why that board?

Good question.

Well ... the last time I designed something (it is a while back) I used a propeller chip. It has 8 cores! This time around I thought to try using an Arduino. I did like the size of the Seeeduino; the internal ADC and DAC; the SDA/SCL and TX/RX pins. It looked like a perfect fit for my project. I am building another flash-scanner for film transferring.

Now on second thought I should have maybe chosen another board. I am currently using 4 of these Seeeduino's:

  • the first one is my master-motor controller with LCD SDA/SCL for feedback and master speed setting
  • (2) as slave-motor controllers with ToF (distance sensor) SDA/SCL for film pickup (with torque) and feeding (with torque)
  • and the last one for the laser and an optocoupler controlling the flash and camera tirgger

It now sounds like I will have to reevaluate things a bit. I do have ways to solder stuff to my board, but soldering can be challenging at times. Maybe I need to get me some of these TXS0108E to send the signal to the TB6600. They look like they would be up for the task.

Two things I note here that are common causes of confusion for newcomers.

Firstly L298 and other DC motor shields are sold as able to power steppers - which is technically true, but very misleading. Most steppers today are low-impedance and cannot be driven by any DC motor shield - they require current drive from a specialized stepper driver like the A4988, DRV8825, TBxxxx etc.

Secondly the datasheet for your motor was lying to you - such steppers do not have a voltage rating (other than the insulation breakdown voltage, in the 100's of volts). I think what they were trying to say is 24V is a recommended supply voltage for the stepper driver, but frankly the motor's driver could be powered from 6V to 80V or more (assuming the driver is rated for the voltage) - higher supply voltage enables a stepper to go faster.

The crucial understanding is that steppers are limited by the inductance of the windings and the rotational back-EMF, both of which have less effect with higher supply voltages. In any case the driver limits the current to the set level, acting as a power converter (higher supply voltage means less current is drawn from the supply).

Or put concisely steppers are very very different to other motors.

I finally got myself some TB6600 and some TXS0108E and had to discover that the TXS0108E is really designed just for logical switching and not to drive a LED of an optocoupler.

Is there a preferred NPN transistors array that you would recommend for that? Or should I go as far as to consider using a NPN darlington transistor array ... as my Seeeduion pin can only provide Out High at 3.00-3.63V of 2.0mA.

Never used a TB6600, but I think the common way is to power the internal opto coupler(+) from 5volt, and let the MCU pin switch opto(-) pin to ground.
(there should already be an internal 330 ohm resistor in series)
This is also commonly done with with 5volt opto relay modules and a 3.3volt processor.
2mA max pin current is a killer though.
Leo..

This is what I ended up doing:

Related links that helped me refresh my rudimentary electronics knowledge:

Unfortunately he doesn't know the basics about switching.
Gain (Hfe) is not used for a switching transistor (where collector voltage drops below base voltage).

You can find the required base current for switching in the transistor datasheet,
which is usually 5-10% of the collector current.
Just use a 1k2-1k5 base resistor (Seeeduino restrictions), and remove that 10k resistor.
Leo..

I was basing the 10K resistor idea from this page npn - 2N2222 as a switch - Electrical Engineering Stack Exchange, but was not sure if the 10K was really needed.

If that were a MOSFET instead of a BJT the 10K resistor would make sense. MOSFETs are voltage actuated devices. A floating pin can have enough voltage to turn a MOSFET on. The pulldown resistor keeps the MOSFET off till the pin is set to OUTPUT. BJTs are current operated. A floating pin will not have enough current to turn on a BJT. So the pull down is not necessary.