Comments: TB6612FNG Hookup Guide


Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • Diez66 / about 3 years ago / 1

    I don't buy directly from you as I am in Spain and importing, anything is an ARGH! Mind you, if you are registered for EU VAT/IVA maybe I will try. I do buy your products from local distributors. Just want to say, thanks for this guide. I have taken it slowly and manually made the motor run under "Breadboard" control (actually moving the wires to set low and high). Worked first time, thanks. Now I simply need to program up the small Python prog' on the Pi, wire it up and YAY! Thanks P.S. The wee note about STBY being high was timely.

  • Member #1489326 / about 3 years ago / 1

    I have tried different TB6612FNG libraries but none will allow me to upload code to ESP 32. Not even <SparkFun_TB6612.h> allows me to upload to an ESP 32 or a Lolin 32. This is the only library which I am having trouble with.

  • Member #1277297 / about 6 years ago * / 1

    the spec sheet says to design circuit to provide back EMF protection when controlling inductive device (as this motor controller always is, Duh!). If current from controller to motor was unidirectional, this could be done with a snubber diode as you do with a relay. But this device outputs motor current in both directions normally (for reversing), so diode(s) won't work.

    BUT: It also seems to show that when the In1 and In2 (either channel) are in H/H or any H/L config except L/L, or PWM drops to L (I guess that means near 0 for your pulse width), the motor output goes to L/L, i.e. shorted to gnd, same as 'brake'. So that should keep any back EMF from damaging the MOSFETs, right? Thus, if you always code for PWM to drop to 0, OR set both inputs to H, momentarily, just before you 'stop' or reverse, that should protect the device? Or is this actually not a problem you even need to consider -- because the schematic on p. 3 of the data sheet shows protection diodes already present inside the IC?

    • I was wondering the same thing. The datasheet refers to dead time when switching modes under "H-SW Operating Description " and shows a waveform indicating this dead time exists at the rise and fall of the output PWM. If this happens using the internal diodes, then I think we're safe. To confirm here's what I did:

      • Modified the Sparkfun-provided library to work with mbed (I may have newer changes by the time you read this, so check that out if you're interested)
      • Programmed an ST board to drive at 50% duty forward then immediately switch to 50% duty backwards
      • Wired up the ST, motor driver, and 4.5V supply from my benchtop PSU (no other components)
      • Bravely connected my oscilloscope between motor output AO1 and GND
      • Made some observations


      • The supply to the motor (A01 and A02) uses PWM at 50Hz with rise times around 50ns and overshoot of roughly 0.7V
      • No spikes or dips like you'd see using a simpler circuit like this one

      I guess the built-in protection diodes provide at least some level of protection; although, I'm not sure how robust they are. Note that my observations were using a single motor - using two motors may change the results. It might be a good idea to switch to "stop" or "braking" mode before reversing directions, and I guess it's a good idea to keep an eye on temperatures for long-duration or high output rides.

If you've found an issue with this tutorial content, please send us your feedback!