IBT-2 H-Bridge with Arduino

The IBT-2 H-bridge module from wingxin is an inexpensive, high power motor driver based on two BTS7960 chips and is readily available from various ebay vendors; see e.g. here.


The link provides more details but here are a few key parameters.

  • Input voltage : 6V-27V
  • Maximum Current : 43A
  • Input level : 3.3V-5V

I am not sure whether the heat sink is sufficient for handling 43A but even if one does not drive the unit to its limits the specifications are still impressive given the typical price point of this module (currently between $13 and $17 including free shipping from China). There is relatively little information available about how to hook up the module with an Arduino controller. This thread on the Arduino forum was useful but the solution wastes a few pins and does not demonstrate bidirectional motor control. In this post I describe a slightly more complete solution that uses an Arduino controller with connected potentiometer to drive a motor via the IBT-2 module from full reverse speed to full forward speed.

For reference here is the description of the input ports and the two supported usage modes (image taken from one of the ebay postings). In this post I leverage usage mode one.


Here is the associated Arduino sketch:

IBT-2 Motor Control Board driven by Arduino.

Speed and direction controlled by a potentiometer attached to analog input 0.
One side pin of the potentiometer (either one) to ground; the other side pin to +5V

Connection to the IBT-2 board:
IBT-2 pin 1 (RPWM) to Arduino pin 5(PWM)
IBT-2 pin 2 (LPWM) to Arduino pin 6(PWM)
IBT-2 pins 3 (R_EN), 4 (L_EN), 7 (VCC) to Arduino 5V pin
IBT-2 pin 8 (GND) to Arduino GND
IBT-2 pins 5 (R_IS) and 6 (L_IS) not connected

int SENSOR_PIN = 0; // center pin of the potentiometer

int RPWM_Output = 5; // Arduino PWM output pin 5; connect to IBT-2 pin 1 (RPWM)
int LPWM_Output = 6; // Arduino PWM output pin 6; connect to IBT-2 pin 2 (LPWM)

void setup()
  pinMode(RPWM_Output, OUTPUT);
  pinMode(LPWM_Output, OUTPUT);

void loop()
  int sensorValue = analogRead(SENSOR_PIN);

  // sensor value is in the range 0 to 1023
  // the lower half of it we use for reverse rotation; the upper half for forward rotation
  if (sensorValue < 512)
    // reverse rotation
    int reversePWM = -(sensorValue - 511) / 2;
    analogWrite(LPWM_Output, 0);
    analogWrite(RPWM_Output, reversePWM);
    // forward rotation
    int forwardPWM = (sensorValue - 512) / 2;
    analogWrite(RPWM_Output, 0);
    analogWrite(LPWM_Output, forwardPWM);

The following Fritzing diagram illustrates the wiring. B+ and B- at the top of the diagram represent the power supply for the motor. A 5k or 10k potentiometer is used to control the speed.


109 thoughts on “IBT-2 H-Bridge with Arduino”

      1. Hi Dave, I’m attempting to make racing simulators to sell here in South Africa. Would you be interested giving me a boost financially? My email is guypmb@gmail.com.

  1. Is there any reason why the two sides require a dedicated PWM pin? Could you tie those together to the one PWM output from the Arduino and use R_EN and L_EN to select direction? Even better, if one is always the inversion of the other, could a NOT gate be used so that to drive a motor forward and reverse, only one PWM pin and one non-PWM pin are required? (Possibly meaning as many as 6 motors could be driven from the one Arduino)

    … Actually, writing that gives me an inkling as to why two PWM inputs are available…

    Similarly, could two of these bridges be used to drive a high current stepper motor?

    1. Thse boards definitely can’t be used with a single PWM pin. The half-wit chinese board torturer who designed this thing named the enable pins R and L but there is no relation to the driving direction. They are just the enable pins for each of the two half-bridges on the board. (The L pin for the right of them and vice versa) Unless you activate them both, there is no function at all.
      Therefore, it is not possible using only one PWM pin without further parts. With some additional logic you could easily use one PWM pin and one direction select pin.

      I can’t even articulate my anger against such people. This board must have consumed thousands of hours of good people trying to figure out why dhe directional enable pins do not enable any direction, bringing despair to beginners and spoiling a nice hobby for so many.

      Best Regards and good luck.

      1. Arrrhm, David,

        I know this is 2 years late, but dis-information needs to be corrected whenever it is found.

        The board is advertized as a dual half-bridge driver. If the user chooses to combine the 2 into a full-bridge that’s fine. Invert the Left & Right PWM (in software or hardware) and you get bi-directional control of 1 brushed DC motor.

        It also can drive a high power, 4 wire stepper motor (or more likely a pair of them at opposite sides of a heavy CNC work table) in reversable, single step mode. (Requires a special lookup table, but microcontrollers are quite good at reading these)

        Also lots of DC motor applications don’t need a reverse, just a high voltage, large power, High OR Low side PWM. This very versatile module can drive (up to 24V, 30A each) 2 uni-directional motors where the switching side for each is selected via setting Left (or Right) to high for high side driving or to low for low side sinking, then applying independant PWM to each Inhibit pin.

        This board was thoughtfully designed for HOBBYISTS to be able to experiment with and learn from as well as being a robust (and extremely cheap) dual half bridge driver in finished projects.


        1. Hi Dave, bruceg and anyone else reading. Sorry I’m even later to the party – it’ now mid 2023 a full decade since this article was written! :P, but I 100% agree with bruceg – and since I found this today as one of the top results when searching Google for how to use this board, clearly contribution is still relevant in 2023…. If you’re short on time / impatient – skip to the [Findings] paragraph – but I think it’s important to understand how this board/chip works, so here’s my long story of a contribution. Hopefully it will help someone – regardless, I sure learned a lot today! 🙂

          Firstly – I’m a long time hobby electronics enthusiast – I’m not a qualified electrical engineer or anything similar. Everything I say here is “to the best of my knowlege” and “based on the research I have done today” but please correct me on anything if you know better! :). I read through all the info and many of the very many comments on this page (and many other pages I found) and felt like I still don’t understood this board well enough still.Unfortuantely, I apparently didn’t read enough of the comments until most of this was written, as later I found much of the info below already mentioned by others… I only had a vague understanding of H-Bridges from some YouTube I watched a few years ago. So I broke out my DMM, my scope and dug up the datasheets for the chips on the board and spent much of the day messing around with it and studying the datasheets. The results were interesting and satisfying. Wheny you understand it, this is a useful and flexible board.

          I think the labelling on this board, while arguable not necessarily wrong, is “subjective” and leads people to make wrong assumptions about how to use it. Things may become more clear when you trace the circuit and read the datasheet to understand how the chip works.

          Adddressing a few concerns/comments in some other comments here:
          [R_EN and L_EN] – these are not “Direction Enable” pins they’re the connected to the “INH” or “Inhibit” pins on each chip. They actually control if the respective chip (Left or Right) is “active” or “sleeping”, When sleeping, that chip does not energise either of it’s two FETs in it’s half-bridge. So it absolutely makes sense to join these pins together and enable them simultaneously when using these two chips in a “full-bridge” configuration – which is what you use for driving one motor in both directions. In a full-bridge configuration, you won’t be able to energise the motor _at all_ unless both half-bridges are enabled. Keep in mind that you should be able to drive two motors from this board (in one direction only!) by connecting each motor to only one of the two “M” pin and either B+ or B-. In this configuration you may want to keep the “L_EN” and “R_EN” pins separated.

          [PWM] – I would say that these pins are not “stricly” PWM – they are actually connected to the “IN” pins on the half-bridge driver chips. What they actually do is decide if the “HIGH” or “LOW” side FET in each half-bridge is enabled. Of course neither is enabled unless the INH “Inhibit” pin is also HIGH. Driving these pins with PWM signals is really actually flipping the active of the two FETs in a half-bridge. Therefore if you flip them both at the same time with either the same or inverse logic – nothing will actually happen. This is why when you are driving a motor with two PWM pins you have to hold one of then steady (LOW or HIGH) and PWM pulse the other… Down below I’ll explain why I think this is actually a waste of a PWM pin.. maybe you can already begin to see why…

          [Cross condution] A word on Cross conduction can ruin your day with some Full H-Bridges but I believe cross conduction is taken care of internally in the BTN79x0 package. It’s a “Half-Bridge IC” not a bare pair of MOSFETS – and therefore I’m pretty sure you don’t need to worry about creating shorts through cross Condution. (heck if you did I’m sure I’ve have blown up my board many times over today!). Considering the IN pin (pin 2) determines whether the HIGH or LOW side of a given half bridge is active and that pin can only be HIGH or LOW, not both, you cannot influence whether both LOW and HIGH side mosfets are on at the same time. The potential could exist for Cross Condution to occur when switching from HGH to LOW but the chip takes care of that with an internal dead time where neither FET are active when switching. See the datasheet section 5.4.2 “Dead Time Generation”.

          Keep in mind that cross conduction occurs when both mosfets in _one_ _single_ half-bridge are active at the same time. The same is _not_ true when the both LOW side FETs (only) _or_ both HIGH sides FETs (only) are active on both half-bridge. While it’s very possible to do this, in a full-bridge configuration, all this does is create the same potential on both sides of the driven motor and since the other FET in each Half-bridge cannot also be enabled this does completely nothing. 🙂 Since each chip takes care of ensuring that both of it’s own HIGH and LOW sides cannot be active simultaneously if LOW sides of both chips are active, then both HIGH sides must therefore be inactive and no cross condution occurrs from B+ to B-.

          Now as burceg suggests – yes it is definitely possible to drive the board with a single PWM pin by using a logic inverter such as Texas Instruments SN7404 Hex Inverter IC to create an additional “inverted”” PWM signal – this is the “hardware” option he refers to. Simply connect one IN pin – these are the ones labelled “PWM” (eg Pin 1 on the boards 8 pin header) to a >NON< PWM pin of your microcontroller (yes non-PWM on the Micro to PWM on the Motor controller board – not a mistake), then connect that same pin to the first "A" (input) of the SN7404 – The pin called "1A" which is actually chip pin 1) and the output 1 of the chip – "1Y" which is Chip pin 2 to the other "IN" pin on your motor controller board – eg Pin 2 on the 8 pin input connector.

          Now connect the PWM pin on your micro to BOTH L_EN an R_EN (eg pin 3 and 4).

          Your Non-PWM pin now becomes a "direction" pin. When it's HIGH, one Half-Bridge will enable the HIGH side fet only and the other Half-Bridge will enable only the LOW side fet. This doesn't need to be PWM – it's only going to change as rapidly as you want the motor to change directions. Now you can apply PWM to the "Inhibit" pins (called L_EN and R_LEN) to adjust the speed at which those active FETs are turned on and off. This will cause both Half-Bridge ICs to go to sleep and wake up with the PWM signal. Unsure if this is an intentional/correct use of the Inhibit pin – but it does work and I don't see why not…

          But in fact it's absoutely possible to drive this board with SINGLE PWM (plus a non PWM pin) and NO ADDITIONAL components. [Wait… I now see Jim already said something similar to this back in 2014!! I think my solution is slighty different, but in that case someone else maybe even said exactly this!]. Once you understand what's going on above you may realise that since the motor will only ever be energised when the two PWM signals are different – we can in fact regard one as a "direction" pin (no PWM required) and the other as a "speed" pin (using PWM). The only catch here is that the logic state of the direction will also affect whether the motor is energised with the speed pin being HIGH or LOW. Therefore in software we must "invert" the speed PWM output for one of the directions, otherwise for one direction low PWM values will result in the motor running slow and high PWM values being fast but in the other direction, low PWM values will make the motor run fast and high PWM values will be slow. This is easy to do though with something like the following:

          if (myDir==0) {
          setMotor(mySpeed, myDir);
          } else {
          setMotor(255-mySpeed, myDir);

          void setMotor(int setSpeed, int setDirection) {

          I've tried both of the described methods above and both work fine as far as I can tell.

  2. is it possible to ad a feedback potentiometer to the dc motor. and code in arduino so it will act like 180 degree servo.
    Kind regards
    Tom Jensen

    1. Did you ever get this to work? I’m trying to make a radio controlled 2 axis gimbal with 24v motors at the moment and can’t find anything similar using this IBT_2.

  3. Dr. Hessmer,
    I plan to use a similar (higher power) single H bridge to control a DC brushed motor.
    The bridge has a similar connection schema, including an ENABLE and LPWM and RPWM.
    I am worried about cross-conduction (shoot-through) protection when changing direction. My guess is that the bridge does not provide it.
    In that case, would such protection not be provided by always taking the xPWM pin that was fed until now to zero and ONLY THEN feeding the other?
    In other words, in the code above, have the “forward rotation” coded thus:
    // forward rotation
    int forwardPWM = (sensorValue – 512) / 2;
    analogWrite(RPWM_Output, 0);
    analogWrite(LPWM_Output, forwardPWM);
    Many thanks for your opinions and advice,

    1. Late reply, I know (better late then never in this case).

      Yes this is an issue with these H-bridge models and high power uses.
      The H-bridge does provide a delay (switch on/off delay / slew rate), which would prevent the cross-conduction issue if you could send both PWM signals at the same time. But because of the time arduino takes to process the line of code (analogWrite in this case) it will still cause cross-conduction.
      I don’t have the exact numbers anymore, but the build-in delay is about 4/6 ms (depending on resistance and temerature) and the delay time between the 2 lines of code is about 4-8 ms. This sometimes causes an overlap, resulting in crossconduction.
      I broke about 2/3 h-bridges before I found out about this issue. The code you provides in your comment does solve the issue and no h-bridges have broken down since.
      Someone also suggested using digitalWrite(pin, LOW), instead of analogWrite(pin, 0). But I don’t know if this makes much difference.

  4. Hi Thanks for the post. Very useful.
    May I know IBT-2 can control the Bipolar Stepper Motor, if so, how to connect the motor.

    1. It is possible to drive a steeper motor with these bridges, however it is not recommended.

      First you will need two as there are two sets of winding’s in the stepper and this bridge will only handle 1 set of winding’s
      If you are using the IBT-2 I will assume you are planning to run a high power stepper.
      In most cases, dedicated stepper drivers will not only control the voltage to the stepper motors, but also limit the current.
      The voltage applied to the motor can be a lot higher than the nominal voltage of the winding’s.
      This is because at higher frequencies of phase reversal, the impedance of the winding’s increases, reducing the current flow and motor torque will drop off rapidly. To overcome this, a higher voltage is used and the current is then limited to prevent damage to the motor.
      This method allows motors that when stationary have a winding voltage of 6V to operate at up to 60V

      So while it is possible, these motor drivers do not have the precise current control that would be needed but high power stepper motors.

  5. Dr. Hessmer, thanks for sharing! Very informative and useful…I always learn something new and useful every time I visit your blog. Thx!

  6. Good morning
    This is exactly what I was looking for but would like to add rpm measurement via a slotted optical sensor board based on an LM393 chip and also an LCD display showing the measured rpm. Would you be able to provide some guidance on how to wire and program this additional equipment?
    Thanks a lot


  7. Thanks for the great info!! I thought I would share how I controlled this with one PWM pin. I “drove” both the enables with one PWM pin (Pin 44 goes to R_EN and L_EN). I then used the LPWM and RPWM pins to set the direction. I also use some digital pins to power/ground the logic of the IBT-2’s (46,47,52, 53).

    The following code is for the Mega-2560 and can control two IBT-2’s

    int pwmpin1=44; // 8-bit pwm 0-255 timer 5 for motor 1
    int pwmpin2=45; // 8-bit pwm 0-255 for motor 2
    int mcgnd1=46; // ground for motor control 1
    int mcpwr1=47; // power for motor control 1
    int pwmdirection2r=48; // digital motor control direction 2
    int pwmdirection2l=49; // digital motor control direction 2
    int pwmdirection1r=50; // digital motor control direction 1
    int pwmdirection1l=51; // digital motor control direction 1
    int mcgnd2=52; // ground for motor control 2
    int mcpwr2=53; // power for motor control 2

    //Code snippet for two motors on 2 IBT-2’s using just two pwm pins.

    //set h-bridge to reverse or CCW


    //else CW

    //set h-bridge to reverse or CCW motor 2


    //else CW

    Jim K says:
    November 30, 2014 at 4:51 pm
    Could you share the fritzing part for the IBT-2?



    1. hello, thanks for providing this code..
      but the question is how did you use 4 pins to determine the direction of the two motors on this driver? or did you use relays or what?
      can you send the connections please!

  8. Hej dr.Hessmer do you now if its possible to run a segway on two ibt2 motor controller instead
    Of the sabertooth motor controller with arduino.i am a newbee to arduino. if you can run it on
    Ibt2 do you then got some exsampel code for that.
    Kind Regards
    Tom jensen

  9. Hola.
    Estoy buscando un código de Arduino para controlar un motor de corriente continua utilizando un puente, H 43 A BTS 7960B,

  10. Hola,
    Estoy intentando programar,ARDUINO UNO,con el puente H 43A BTS 7960 B, y no consigo que funcione el motor,estoy, con el código, IBT-2, el código me lo acepta bien pero no funciona el motor,agradecería que alguien me pasara un código.

  11. HELLO SIR:
    if (sensorValue < 512)
    if (sensorValue = 512)


  12. Hi Dr. Rainer,

    I used these motor drivers and your recommendation to run a golf cart.

    After nine holes, the cart reduced in power. It seems the battery running out of juice. Yet when I measured the voltage of the battery, it is at 13v. And the heat sink is not even warm.

    Yet, when I get home, it was running fine again.

    Can you offer some insight to solve this problem?

    Thank you,

  13. This chip won’t switch higher than 40Hz. Just tried using it as the DC->AC component in a step up transformer and it can’t handle signals over 40Hz and still deliver the power it claims to deliver.

    1. Sorry for the late response. You are right, the motor and battery connections in my diagram were wrong. I hope I did not cause any harm. I just uploaded a corrected image.

  14. Hi.
    I used the same drivers with electrical model cars – wondering if anyone has an idea how to get it in wifi version?

  15. hi.
    How much voltaje is the maximum for the VCC pin in the IBT-2 H-BRIDGE because i have been connecting 9V to that pin and the IBT2 stop working, I am not sure if I burn it or the arduino is the one damage.

      1. Hi Daniel,

        i hooked up a wiper motor and it is still doing fine
        so 10 to 15 amps is still fine after wrong connection

      2. I was reading your pages while on a boat. This stuff is great. This website is like the cookies to my tasty soy milk. I just shared your article on Google Plus. When I started my browser this page was running.

  16. Dear Mr
    Dr Rainer Hessmer
    I want to make a sun tracker dual axis
    * I have arduino mega 2560 R3
    * I have 2 pcs BTS7960 (my motors are 24Vdc power suplly)
    * Analog sensors 4 photodiots array ( 4 serial for east-4 serial for west- 4 serial up -4 serial down)
    * 4 push button for manuel control (east-west-up-down)
    * 1 pcs wind speed sensor (output 0-5Vdc)
    * when sun set sistem will park in EAST
    need your help for codes
    Best regards

    1. did you ever get this figured out, if so would you please share your code, I’m trying to do the same thing.

    2. Hello Turgay –
      I do use the same ibt controller for my dual axis parabol-suntracker –
      It is not ready, until now – due to time’ and financial’ restrictions . But I am working on it…
      Last testing was to implememt a IR remote control that shall drive the motors to its direction ( die to them buttons of the remote ) or stopping them…
      I posted some years ago, already that project GiraSol on “Element14″…

      Maybe you might have a look on it ?
      wishing you a nice day !

  17. Dear Dr Rainer Hessmer,
    Can you please kindly help me for my project?
    Especially I would like to drive peltier with this motor driver. I only need to control voltage of peltier from 0 to 12 volts. What should be the pins (input pins) wiring. I dont need any reverse current. I would like to only give some pwm signals from raspberry pi with python and control output voltage. Thanks for your kind help.

  18. Good morning Mr Hessmer

    I have a strong doubt on the IBT-2, that is:

    I have a 12V DC motor which absorbs a current of 30A in S1 service (max 38A in S2 service).
    Can I safely use IBT-2 to operate the motor 30A?
    Someone said that IBT-2 is small for this use.

    I would use Arduino + potentiometer for feedback control.

    Thanks in advance and waiting for your answer

  19. Hi

    Im using the Motor Driver BTS7960 43A for a 24v dc motor 200watt, im using a raspberry pi to control the pwm. When I first set up I was using a frequency of 100htz, but when running the motor and motor controller got extremely hot!. So I change the frequency to 800htz. Its now running cool and smooth but could anyone tell me if this a good setting please?.

    Many thanks


  20. Thanks ! Can you give a clue on using the IS pin for current limiting/monitoring ?
    I don’t understand the datasheet for that pin.
    Thanks in advance

  21. Hi everybody!

    Thanks in advance for your attention
    I think i connected all OK, and burn the arduino UNO with the described code.

    But, I can’t get to move the motor.

    I have any doubt aboout the GND of 12 battery and the GND of arduino.
    Can I connect all GND?

    Thanks in advance!!


  22. Dear Dr Hessmer ,

    Thanks for your effort . IBT-2 was working in minutes and your explanation made things very easy to understand….

  23. How can I get the BTS6070 in the Fritzing software? I have been trying but I cant seem to find it.

  24. Dear Dr Hessmer,
    I have try this program code and its works fine…but how to change the input from VR (sensor A0) to read signal from the RC receiver…so i can control from the rc controller…tq.

  25. pourriez-vous me donner le code et le schema de branchement de deux ibt-2 avec arduino uno et commander par un joystick

  26. Hi Dr Hessmer
    Is power supply need to be same voltage as DC motor? Is there any step down module. What I mean is I have a 18v DC motor and 24v power supply will that burn the motor?

    1. There is no step down module. You could run the 18vdc motor on 24vdc for a while, but it’s not recommended. I’ve ran a 12vdc motor on 24vdc for a while (on accident) and it did not break down. Granted, it never recieved any pwm signal higher then 120 or so, but that’s still 24v peaks going trough it.
      These documents are also usefull if you want to take a closer look at how the h-bridge works:

      1. I signed up for your mailing list last week and I was wondering how often I’ll be receiving Emails from you. I really enjoyed your page. I amofficially impressed, I need to say. I have just learned new insights because of your article. Funny thing I thought I was a pro before reading your site but it turns out I am a dummy. This is helpful to everyone who reads it.

  27. Hello Dr. Hessmer

    Could you please tell me how to get the IBT-2 part to add it to a fritzing diagram?


  28. Hii I m Smith Mia, If you need guidance for and Roku issues then we are
    here to serve best and optima lsolution to solve your issues.

  29. I need to control a 12v DC motor using a BTS7960 motor driver on the basis of a digital input.
    such as the motor have to run clock wise when a digital pin is high and when that digital pin is low , the motor should run counter clock wise.

    what would be the code for performing this operation…?

  30. Hi,
    I can’t find on the web how to use side current alarm pins R_IS and L_IS.
    Is someone able to help me ?

  31. I get an error at line 27 when I Verify or Upload the code above as follows:
    “a function-definition is not allowed here before ‘{‘ token”
    (at the line after void loop)
    I am using Arduino IDE 1.8.5 with Windows 10
    Can anyone advise the problem, & how to fix this please?

  32. my arduino bts7960 connect with ibt-2 and hall sensor .problem i having with out moving hall sensor motor start working slowly please hellp me

    Kumara Fernando

  33. my arduino bts7960 connect with ibt-2 and hall sensor .problem i having with out moving hall sensor motor start working slowly please hellp me no im not

    Kumara Fernando

  34. hi…i connected this drive to a 12 v battery suddenly the battery burned with fire and smoke!!!!why this thing happened?i should say that the was no consumer attached to drive…no motors no actuator…dose reverse polarity connection of battery cause this?B+ of battery to B- of driver..and B- of battery to B+ of driver.is my driver burn down too?

    1. The mosfets used have ‘intrinsic’ built in reverse diodes. This just means that the fabrication of each transistor’s parts accidentally results in a diode between the drain part and the source part. This is good fo handling the ‘fly back’ pulse from an inductor (like an electric motor), BUT …

      If you connect a battery backwards it gets an almost dead short (~0.02R) through the diodes which can handle ~100A through a 2 volt drop = 200W – expect bad things to happen to the battery and/or mosfets.


  35. This product is much useful for drive motor. I just want to one thing that is Can I use this drive with JOYSTICK? If yes can you send code for that. Now I am using Arduino uno microcontroller. Please help me.

  36. hello, need to work with 2 dc motors, already done with wiring by following the posted diagram above but when I try to turn on (forward or reverse) motor 1, motor 2 GND pin is heating causing wire melt. how can this possibly be fix? please answer Thanks

  37. vorrei usare Using Motor Driver BTS7960 per sostituire una board L298N che è limitata in corrente e si blocca!!
    Nel mio esempio in arduino piloto il motorino dc con due interruttori NA per le due direzioni e un potenziometro per vel.
    Tuttavia uso solo tre pint di Arduino due digitali IN ad uno per il PWM!
    Ho appena comprato la nuova scheda ho cercato su internet ma non trovo risposte, come posso usare il Motor Driver BTS7960 per sostituire il L298N ?
    lo schetch è ottimizzato per i tre pin….
    ! grazie!

  38. what is the right board?I did not have it.I will change the IBM_2 board.
    I only have a IBM-2 and a arduino.

  39. I believe there is a typo in the image above for “Usage two:”
    I think what they are trying to say is:

    Usage 1:
    VCC to 5V power
    GND to arduino ground
    R_EN and L_EN shorted to 5V
    L_PWM connected to PWM signal for forward speed
    R_PWM connected to PWM signal for reverse speed

    Usage 2:
    VCC to 5V power
    GND to arduino ground
    L_EN to digital arduino pin for forweard
    R_EN to digital arduino pin for reverse
    L_PWM and R_PWM shorted to PWM signal for forward or reverse speed

    (Your choice would depend on if you wanted to use up 2 PWM pins + 1 digital pin, or 2 digital pins and 1 PWM pin on your arduino)

    1. Dear Mr. McWhinney,

      Much to my regret, I must inform you, usage 2 is not possible. The two enable-pins do not correspond to directions but to the two half bridge ICs (And then R and L are swapped). Unless both are activated, it won’t do anything. (Well, except changing the Voltage of the output to B- or to B+but there is no current flowing)

  40. hi my question is can i control two motors using single IBT-2 driver? i am making a wheel chair ,in order to rotate i must stop 1 and run the other one .any info about that??

  41. Hi, I followed your instructions to use IBT-2 to control a motor, used the same arduino sketch and circuit. 12V battery connected to -B&+B, arduino UNO/Nano VCC reads 4.75V (Chinese clone) connected to VCC and GND, but not success,

    Tested with an multimeter and found the the below
    When sensorValue0V to 10V.

    but (-B & +M )and (-B & -M) reads >0 to 10V, (changes according to pot value)

    and (+B & +M) or (+B & -M) reads 0v.

    I assume that +10V comes in both +M & -M.

    While sensorValue>512 voltage across
    +M & -M is 0V only, suppose to be >0 to 10v.

    but +B & -M or +B & -M reads >0 to 10V,
    I assume that both +M and -M is now negative or 0v.

    And further
    I used some simple sketch to make L_EN and R_EN HIGH and RPWM HIGH and LPWM LOW. The voltage reads same as above. Please note that while using 12V battery BTS9600 gets too hot, hence I used a 7.5lipo.

    Any advise please.


  42. Hi, please delete my previous post as it mistyped some info,
    I followed This instructions to use IBT-2 to control a motor, used the same arduino sketch and circuit. 12V battery connected to -B&+B, arduino UNO/Nano VCC reads 4.75V (Chinese clone) connected to VCC and GND, but not success,

    Tested with an multimeter and found the the below
    When sensorValue0V to 10V.

    but (-B & +M )and (-B & -M) reads >0 to 10V, (changes according to pot value)

    and (+B & +M) or (+B & -M) reads 0v.

    I assume that +10V comes in both +M & -M.

    While sensorValue>512 voltage across
    +M & -M is 0V only, suppose to be >0 to 10v.

    but +B & -M or +B & -M reads >0 to 10V,
    I assume that both +M and -M is now negative or 0v.

    And further
    I used some simple sketch to make L_EN and R_EN HIGH and RPWM HIGH and LPWM LOW. The voltage reads same as above.

    Any advise please.

  43. I’ll subscribe to that writer and his future books. The post is well organized, reminded me about
    https://usagrantsforsinglemothers.com/. I see the author has a real knack
    for this topic. I like that theme, and I’m in constant search of new bits and the most
    recent news. I really enjoyed that one, because
    it is filled with interesting facts and it is a kind of easygoing article.
    I spent only a few minutes reading and due to well-structured text, I understand
    it completely. Thanks!

  44. Yes, it certainly IS possible to use TWO of these half bridges to drive the TWO coils of a BIPOLAR (4 wire) STEPPER MOTOR. You can use EXISTING Arduino code without ANY editting (from the site below), if you use the same 4 Arduino DIGITAL pins as inputs to the TWO half bridges.

    See the excellent tutorial here: https://www.arduino.cc/en/Tutorial/StepperOneStepAtATime
    and specifically

    Wiring from the Arduino UNO to the TWO half bridge boards is as follows

    NOTE: this is to connect to a single BIPOLAR STEPPER MOTOR Bipolar (4 wire, 2 coils)
    Polarity of connection the coils doesn’t matter, so long as ONE coil is connected to M- and M+ on ONE half bridge output terminal, and the OTHER coil is connected M- and M+ on the OTHER half bridge output terminal. Inverting the polarity on either coil simply changes the motor rotation direction for a given stepper pulse. (and the stepper motor can be stepped in EITHER direction by changing the sign of the number of steps in the Arduino sketch.)

    suffixes _1, _2 indicate which of TWO half bridge boards (and which stepper coil) is involved

    CONNECTIONS to FIRST IBT-2 H-bridge module half bridge:

    VCC_1 to arduino +5V power (from Arduino UNO or similar)
    GND_1 to arduino ground
    L_EN_1 to arduino +5V power (ENABLE= TRUE)
    R_EN_1 to arduino +5V power (ENABLE= TRUE)
    L_PWM_1 = arduino digital pin 8
    R_PWM_1 = arduino digital pin 9

    B+_1 = Vm of STEPPER MOTOR SUPPLY (note Vm can be DIFFERENT from Arduino Vcc
    and supply needs enough current for motor (1A or more))
    M-_1 = one end of STEPPER MOTOR COIL_1
    M+_1 = other end of STEPPER MOTOR COIL_1 (invert M- & M+ still works but direction reverses)

    CONNECTIONS to SECOND IBT-2 H-bridge module half bridge:

    VCC_2 to arduino +5V power (from Arduino UNO or similar)
    GND_2 to arduino ground
    L_EN_2 to arduino +5V power (ENABLE= TRUE)
    R_EN_2 to arduino +5V power (ENABLE= TRUE)
    L_PWM_2 = arduino digital pin 10
    R_PWM_2 = arduino digital pin 11

    B+_2 = Vm of STEPPER MOTOR SUPPLY (note Vm can be DIFFERENT from Arduino Vcc
    and supply needs enough current for motor (1A or more))
    M-_2 = one end of STEPPER MOTOR COIL_2
    M+_2 = other end of STEPPER MOTOR COIL_2 (invert M- & M+ still works but direction reverses)

    NOTE: you can provide a suitably LOW voltage and HIGH current power supply to run the stepper motor (connected to B- and B+ on the half bridge output terminal). This supply is **separate** from the small +5V supply coming from the Arduino into each Vcc pin on each half bridge. You may need to insert a suitable high power low Ohm value resistor Rs (e.g., say a 1 Ohm 5 Watt resistor), in series with the stepper motor supply to limit the current, depending on the stepper motor coil resistance (and inductance, if you are running it fast).

    In my case, I was able to omit the Rs current limit, and simply use a direct connection of my particular motor to a **separate** high current Vm supply (which coincidentally ALSO was at +5V, but could have been chosen otherwise, depending on motor specs and torque requirements.)

  45. Dear Dr Hessmer ,

    Thanks for your effort and support. I am working on the design of a robot with 2 24V motors. I would like control motor speed remotely, using NODEMCU and smartphone BLYNK application. If I wire DC Motors with L298N driver, they works better but they stop when I give full PWM. If I replace L298N with IBT-2 its worst. Could you give me some help?

    1. code for motor Left , Right , reverse and stop using push botton for IBT2 driver
      I can’t understand how I can do my wheel chair right,left,stop and reverse It is going forward only.

  46. Code for motor Left , Right , reverse and stop using push botton for IBT2 driver
    I can’t understand how I can do my wheel chair right,left,stop and reverse It is going forward only.

  47. Hello,
    i am using an adruino and an IBT-2 for controlling ham radio antennas for satellite comunication. I have one issue, I would like to implement a hardware end switch for the motors. If i switch off EN_L or EN_R i am not able to run in the opposite direction. Do I have to switch off the PWM signal to get a hardware switch for one direction and I am then able to run the other direction?!

    Best regards,

  48. I found this all very interesting and extremely helpful. All of my current questions have been answered somewhere in this list of comments. I may have more in the future, but for now, thank you.
    Conrad R. Weston.

  49. Ich habe eim Attiny85 eingesetzt mit 8kz pwm. In das Austo eingebaut und nach 4-5 Stunden war der eine IC defekt geworden. Der Kühlk0rper wurde mit der Hauptgebse gekühlt-trotz dem.
    (Der Gebäsemotor ziht 8A bei voller Leistung) Schade!

Leave a Reply

Your email address will not be published. Required fields are marked *