I was recently looking for a brushed DC motor controller for some small motors and came across four controllers that seem to account for the majority of those available from online stores. I had to compare them before making my decision, so here is my summary of their specifications and how they would be controlled from your software.
There are 2 practical low-cost choices for hobby motors – brushed DC motors and stepper types. For both types there is often additional gearing to reduce the motor output rotational speed and increase the torque available for practical applications.
The context of the 4 motor controller below are discussed in the context of providing reversible rotation with speed control for Brushed DC (BDC) motors even if they could be used for stepper control.
Simple Motor Control
Motors cannot be connected and directly from the output pin on a microcontroller, so the simplest way to achieve control of a motor is to connect an output pin to a transistor or MOSFET to act as a switch for the higher voltages and currents needed. Speed control can be implemented using Pulse Width Modulation (PWM – see this explanation), but this arrangement is only good for motors that always rotate in one direction.
The most common solution to achieve changes in directional control is to implement an H-Bridge (see this explanation) with PWM for speed control. This now increases the number of output pins to control one motor to at least two (Forward, Reverse, PWM).
It should be noted that the concepts of ‘forward’ and ‘reverse’ direction are relative – they are just opposites of each other. The direction of motor spin in any specific application depends on the orientation of the motor, how the gearbox works, and the way the motor is wired.
The simplest way to work out the wiring for a specific application is to temporarily make the connections between motor and controller and use test software and drive the motor ‘forward’. If it spins in the wrong direction, reverse the wiring at the motor, the logic in the software or the control pin connections at the processor to fix the problem.
The L298 Controller
The L298 Motor Driver Module is a higher power motor driver module for driving DC and Stepper Motors.
This module consists of an L298 motor driver IC with a big heatsink attached. Some modules also include 78M05 5V regulator which can be used to power the Arduino Board, with a jumper to enable this IC.
The L298 is comes in several form factors, but by far the most common is the L298N Multiwatt vertical package shown in the photo above. This IC is based on old transistor technology and not very efficient – there is at least 1V dropped through the IC for the motor power supply (which is given off as heat!). This module can supply a constant 2A current.
The L298 Module can control up to 4 DC motors, or 2 stepper motors, with directional and speed control. The module uses the ENA/ENB inputs for PWM speed control for Motor A and Motor B respectively. The IN1/IN2 and IN3/IN4 signals are direction control pins for Motor A and Motor B, and the motor terminals are connected to OUT1/OUT2 and OUT3/OUT4.
An external supply up to 46V can be connected to the screw connectors to supply power for the motors. If the 7805 voltage regulator is present, this voltage can also be used to feed 5V to the Arduino processor board. If the processor has its own 5V supply of the motor voltage is a lot above 5V, then the ‘5V Enable’ jumper can be removed to disable thvoltage regulator.
A feature of these modules is that they all come with screw terminals which simplifies the wiring process. A big downside is the size of the module compared to the others discussed here.
Controlling this module requires 3 microcontroller pins per motor – EN as a PWM speed control and INx and INy for rotation direction – according to the switching matrix below.
|HIGH||HIGH||HIGH||Fast Motor Stop (braking)|
|HIGH||LOW||LOW||Fast Motor Stop (braking)|
|LOW||–||–||Free Running Stop|
The way the PWM controls speed is by switching EN on and off. While HIGH, the motor will be ‘kicked’ in the direction dictated by INx and INy. While it is LOW the motor will coast. The frequency and duration of the HIGH part of the signal will determine how fast the motor spins.
The L293 Controller
The L293 is another commonly available 16-Pin Motor Driver Module to drive small motors. A single L293 IC is capable of running two DC motors at the same time with independent direction and speed control.
This control IC is also used in the Arduino Motor Shield.
This module is considerably smaller than the L298. It can switch motor voltages up to 36V at 1A continuous current. The most common L293D variant is only rated at 600mA.
The required signals, switching matrix and control logic are the same as the L298, so to a software application these modules look identical to the L298 controller and the L293 could be considered a smaller, but less capable, drop-in replacement for the L298.
The DRV8833 Controller
The DRV8833 is a low voltage single stepper or dual brushed DC motor driver in a very tiny package.
Motor voltage can be up to 10.8V at 1.5A continuous current. However, the two motor outputs and control inputs can be wired in parallel to provide double the current (3A) to a single motor.
The DRV8833 H-Bridge is implemented using MOSFET technology, so there is a minimal voltage drop across the motor power supply.
Each motor has two IN signals (IN1/IN2 and IN3/IN4) which determine the spin direction for Motor A and Motor B. These pins also double as PWM speed control pins. The motors are connected to OUT1/OUT2 and OUT3/OUT4.
The DRV8833 has an output status pin to signal fault mode (Overcurrent, Thermal Shutdown or Undervoltage Lockout) and an hard wire input to put the device into ‘sleep’ mode for very low power consumption applications.
To operate the motors the microcontroller needs 2 PWM enabled pins from the microcontroller, switched according to the table below.
|HIGH||PWM||Forward (fast stop)|
|PWM||HIGH||Reverse (fast stop)|
|HIGH||HIGH||Fast Stop (brake)|
The MX1508 Controller
The MX1508 Motor Driver Module is also sold as “mini L298” or “beyond L298” controller and is the least costly of the four discussed.
The only data sheets available are in Chinese, but it has the look-and-feel of a lower cost/lower specification functional copy of the DRV8833 IC without sleep or fault signals.
The MX1805 module can control up to 2 DC motors, with directional and speed control. Motor voltage is up to 9.6V at 1.5A continuous output. Unlike the DRV8833, outputs cannot be wired in parallel.
The required signals, switching matrix and control logic are the same as the DRV8833, so for a motor controlling application these modules look identical to the the DRV8833.
So which is best?
As usual the answer is that it depends on the application.
For small mechatronic applications, the DRV8833, seems to have a lot in its favour – small size with up to 3A continuous output. If a lower motor current is acceptable then the MX1805 seems a reasonable low cost option.
The L298 is good for higher voltage applications where the transistor voltage losses are less obvious. The downside is the bigger size of the module and extra control pin rerquired.