Home Chapter 13 Maxuino/Arduino motor with the H-Bridge MAX MSP

Site Search

GTranslate

Chinese (Simplified) French German Italian Portuguese Russian Spanish
Maxuino/Arduino motor with the H-Bridge MAX MSP

In this lesson, you will use the Maxuino interface and Arduino UNO board and MAX MSP and Jitter to drive a motor. H-Bridges are wonderful electronic control boards that allow you ramp motors up and down in speed as well as reverse their direction dynamically.

Code to control DC gearhead motor with Maxuino/Arduino UNO and a 1AMP H-Bridge.

Englarged H-Bridge image from Sparkfun

Link to purchase H-Bridge Motor Driver 1A Dual TB6612FNG

Copyright Ken Rinaldo

The H-bridge motor control board used in this demonstration was a prebuilt unit and can handle peak loads up to 1 Amp. The TB6612FNG motor driver controls up to 2 x DC motors at varying speeds based on PWM.

Two input signals (IN1 and IN2) can be used to control the motor in one of four function modes - CW, CCW, short-brake, and stop. The two motor outputs (A and B) can be separately controlled, the speed of each motor is controlled via a PWM input signal with a frequency up to 100kHz.

The STBY pin should be pulled high to take the motor out of standby mode.

For a more powerful H-Bridge to drive larger motors that require more Amps to drive this one is recommended and the lesson that follows is for how to solder one like it together, though keep in mind while the chipset is the L298 the pins may be different in the Sparkfun Product.

L2298 H-Bridge board with the circuit board and parts.

L298 Motor H-Bridge available from Sparkfun

Features:

  • Motor supply: 6 to 35 VDC
  • Control Logic: Standard TTL Logic Level
  • Output Power: Up to 2 Amps each
  • Current Sense Outputs
  • Onboard Power Resistors Provided for Current Limit
  • Enable and Direction Control Pins
  • External Diode Bridge Provided for Output
  • Heatsink for IC
  • Power-On LED indicator
  • 4 Direction LED indicators
Here is a PDF for this product to see the particulars. 

Now there are many popular boards that can just fit on top of your Arduino such as the Qunqi l298 Motor Drive Sheild that can be purchased from Amazon.

These boards are called Shields and match the header pins on the Arduino to make connections quite easy. Be sure to check which outputs you are using from your Arduino and keep in mind they require an external power supply to provide the necessary voltage to both the motors and the shield.

 

  • The L293D is a monolithic integrated, high voltage, high current, 4-channel driver
  • Basically, this means using this chip you can use DC motors and power supplies of up to 12 Volts
  • The H-Bridge is typically an electrical circuit that enables a voltage to be applied across a load in either direction to an output, e.g. a motor.
  • That's some pretty big motors and the chip can supply a maximum current of 600mA per channel, the L293D chip is also what's known as a type of H-Bridge.
  • Can drive 4 DC motors or 2 stepper motors or 2 Servo.