
DC Motor Polarity Control | ACE-Lab Operate · O04 · Control Engineering
DC Motor Polarity Control
Use a DC motor driver to safely interface an Arduino Uno with a motor, reverse direction by changing the applied polarity, and vary the motor drive using PWM.
Contents
Key Learning Outcomes
By the end of this section, you should be able to:
01 Identify the Arduino Uno, Maker Drive motor driver, DC motor, external supply and wiring needed for motor actuation.
02 Connect the motor circuit safely using an external motor supply and a common electrical ground.
03 Explain how an H-bridge reverses the polarity applied across a DC motor to change rotational direction.
04 Implement manual direction and speed commands in Simulink using logic states and PWM values.
Why a DC Motor Driver is Required
An Arduino Uno can generate the logic and PWM commands needed for motor control, but the DC motor requires a separate power stage. In this exercise the Maker Drive motor driver sits between the Arduino and the motor. The Arduino provides the control signals; the motor driver supplies the higher current demanded by the motor.
A separate 9 V battery powers the motor side of the circuit. The Arduino, motor driver and battery must share a common ground so that the control voltages have the same reference.
Important: connect the motor to the motor-driver output terminals, not directly to an Arduino I/O pin. Check the motor supply polarity and wiring before power is applied.Figure 1: Hardware Set Up for DC Motor Polarity Control Hardware Set-Up
The required hardware is an Arduino Uno, Maker Drive motor driver board, DC motor, 9 V battery and clip, breadboard, breadboard wires and USB cable.
Connect the DC motor to one Maker Drive motor channel, for example M1A and M1B.Connect the positive terminal of the 9 V battery to the motor-power input on the driver.Connect the battery negative terminal to the Maker Drive ground.Connect Maker Drive ground to an Arduino GND pin to create the common reference.Connect suitable Arduino digital/PWM pins to the selected Maker Drive input pins.Check the wiring carefully. The motor must be connected to the driver, not directly to the Arduino.Connect the Arduino to the computer using the USB cable.H-Bridge Polarity Control
An H-bridge changes the direction of current through the motor by changing which side of the motor is driven high and which side is driven low. Reversing these states reverses the polarity across the motor and therefore reverses the direction of rotation.
Motor state IN1 IN2 Result Clockwise HIGH LOW One polarity is applied across the motor. Counterclockwise LOW HIGH The motor polarity is reversed. Stop LOW LOW No drive command is applied. Stop / braking state HIGH HIGH Both inputs are driven to the same logic state. Combining Direction Control with PWM
The direction logic determines the polarity applied to the motor, while pulse width modulation (PWM) provides a way to vary the effective power delivered to it. In the source exercise, PWM commands in the range 0 to 255 are used and example gain values of 150 and 255 are explored.
00% PWM command150Example reduced command255Maximum 8-bit command8-bit256 command levelsKey distinction: the H-bridge logic determines direction; the PWM value determines the commanded magnitude of motor drive.Simulink Implementation
The exercise uses manual switch logic in Simulink to select HIGH/LOW input states and PWM gain values. Scope blocks are then used to inspect the signals sent to the motor driver.
Practical investigation: switch between clockwise, counterclockwise and stop states and observe the corresponding signals in the Simulink scopes. Then vary the PWM command and observe how this affects the rotational speed of the DC motor.Figure 2: Simulink Diagram for Manual Polarity Control of a DC Motor using an H-bridge Reflective Questions
Click on a question block to reveal the suggested answer.
Suggested answer: The Arduino provides logic-level control but cannot supply the current demanded by the motor. The motor driver provides the power interface between the microcontroller and the motor.Suggested answer: The polarity across the motor reverses, so the direction of current through the motor reverses and the motor rotates in the opposite direction.Suggested answer: It gives the control signals a shared voltage reference. Without a common reference, the motor driver may not interpret the Arduino logic levels correctly.Suggested answer: The H-bridge input logic controls the applied polarity and therefore direction. The PWM duty-cycle command controls the effective drive magnitude and therefore influences speed.Useful Resources
Cytron Maker Drive with Arduino
A practical Maker Drive / MDD3A guide covering Arduino wiring and forward/reverse PWM motor control.
Open resourceMathWorks Arduino PWM Block
Reference for the Simulink Arduino PWM block, including the 0–255 input range and duty-cycle behaviour.
Open resourceArduino Arduino Uno Rev3
Official Uno hardware information, including the ATmega328P platform and 8-bit PWM-capable pins.
Open resourceConcluding Remarks
This section has introduced the power interface between the Arduino Uno and a DC motor. The Maker Drive provides the H-bridge required to reverse motor polarity, while PWM provides a variable motor-drive command.
The exercise establishes the practical relationship between digital direction commands, PWM, the H-bridge power stage and the resulting DC motor behaviour.

