Hi all! I'm trying to drive the following:
- 3 bipolar stepper motors
- 4 DC motors
- some LEDs (maybe 6)
I bought a Arduino 2560 Mega and three TB6612 H bridges. In addition to the obvious like ground and Vm, I was under the impression that I could just send two PWM wires per stepper motor to the H bridge, but now as I read through documentation, it looks like I also need to send direction information.
Can I control one stepper motor through the H bridge with just 2 PWM signals from the Arduino? Or is the H bridge just there to allow a higher motor voltage than what the Arduino can provide?
Thanks!
The TB6612 (or any other h-bridge) is certainly not the easiest way to use stepper motors. A single TB6612 can control exactly one stepper motor, and it will require 4 pins on the microcontroller. An H-bridge like this requires the micro to handle the overlapping pwm signals to direct the rotor around for each step.
This is quite a bit more complicated than something like a TB6600 or DRV8825 (or the rest of that family: https://www.pololu.com/category/120/stepper-motor-drivers) whose minimal pin-requirements are simply a step pin and a direction pin off the micro.
With all that said, a TB6612 will certainly work for steppers, but it's a less clear choice than what it offers as an L298N-improvement for DC motors.
The TB6612 does offer some nice features to control 2 DC motors, but even there the requirement for two pins for direction control (per motor) is a little annoying.
Direction control is, however, usually something that you don't need to do constantly, and something like a 74x595 chip could let you control 4 sets of direction pins with 3-4 microcontroller pins.
"A resistor makes a lightbulb and a capacitor makes an explosion when connected wrong"
"There are two types of electrical engineers, those intentionally making antennas and those accidentally doing so."
@jker Thanks, I'll try out the TB6600s. Really appreciate your reply!