
- Suggested Learning Resources
- ACE-Lab Shop
- …
- Suggested Learning Resources
- ACE-Lab Shop
- Suggested Learning Resources
- ACE-Lab Shop
- …
- Suggested Learning Resources
- ACE-Lab Shop
DC Motor Polarity Control Exercise | ACE-Lab DC Motor Polarity Control
This exercise shows how an Arduino Uno can control a DC motor through a Maker Drive motor driver. The Arduino provides the control signals, while the motor driver supplies the higher current required by the motor. By changing the H-bridge input signals, the polarity across the motor is reversed, allowing clockwise and counterclockwise rotation. PWM values are also used to investigate motor speed control.
Introduction video for the DC Motor Polarity Control exercise, supporting the practical work with the Arduino Uno, Maker Drive motor driver, and Simulink model.1. Learning Outcomes
After completing this exercise, learners should refer back to these outcomes and check that they can explain the hardware, wiring, H-bridge polarity control, and Simulink-based motor control workflow.
Identify the main hardware componentsRecognise the Arduino Uno, Maker Drive motor driver, DC motor, 9V battery, breadboard, breadboard wires, and USB cable used to control the motor.
Connect the motor circuit safelyBuild the circuit using an external power supply for the motor and a common ground between the Arduino, motor driver, and battery.
Explain H-bridge polarity controlDescribe how changing the H-bridge input signals reverses the polarity across the DC motor and changes the direction of rotation.
Control direction and speed in SimulinkUse digital signals and PWM values in Simulink to manually control the direction and speed of a DC motor.
2. Hardware Set-Up
This hardware set-up uses an Arduino Uno to control a DC motor through a Maker Drive motor driver. The Arduino sends control signals to the motor driver, while the driver supplies the higher current needed by the motor. A separate 9V battery powers the motor side of the circuit. The Arduino, motor driver, and battery must share a common ground so that the control signals work correctly.
Required hardware:
- Arduino Uno
- Maker Drive motor driver board
- DC motor
- 9V battery and clip
- Breadboard
- Breadboard wires, various
- USB cable
Important safety note
The motor should be connected to the Maker Drive motor output terminals, not directly to the Arduino. The motor driver provides the current required by the motor, while the Arduino provides low-power control signals only.
Figure 1: Hardware set-up for DC Motor Polarity Control, showing the Arduino Uno, Maker Drive motor driver, DC motor, 9V battery, breadboard wiring, and common ground connection. 1Connect the DC motor wires to one motor output channel on the Maker Drive, such as M1A and M1B.
2Connect the 9V battery positive wire to the Maker Drive motor power input, usually labelled VIN, VM, or +.
3Connect the 9V battery negative wire to the Maker Drive GND terminal.
4Connect the Maker Drive GND to one of the Arduino GND pins. This creates the common ground required for reliable control signals.
5Connect the Arduino control pins to the Maker Drive input pins. For example, connect Arduino digital/PWM pins to the motor input pins for speed and direction control.
6Check all wiring carefully before powering the circuit. Make sure the motor is connected to the motor driver and not directly to the Arduino.
7Connect the Arduino to the computer using the USB cable.
3. Simulink Set-Up and Results
The Simulink block diagram is used for manual polarity control of a DC motor using an H-bridge. The model contains switch logic for forward and reverse motion, PWM blocks on Arduino pins 9 and 10, gain values for PWM speed control, and scopes for viewing the changing signals.
Figure 2: Simulink diagram for manual polarity control of a DC motor using an H-bridge. The model uses manual switches, gain values, PWM outputs, and scopes to inspect the forward and reverse control signals. Simulink testing steps
Open the Simulink model
Open the supplied polarity control model and confirm that the Arduino hardware settings match the connected Arduino Uno.
Review the manual switches
The model uses manual switches to select the signal states that drive the H-bridge inputs for forward, reverse, or stop behaviour.
Observe the signal scopes
Change the switches using the H-bridge logic table and view the scopes to explore how the PWM and direction signals change.
Investigate motor speed
The PWM values operate between 0 and 255. The example model initially uses gain values of 150 and 255. Change the numbers in the gain blocks to investigate how PWM affects motor speed.
Consider real-time implementation
To implement the behaviour on a physical system in real time, the switches would need to be external, or the switching logic would need to be built into Simulink using appropriate logic or saturation blocks.
H-bridge control logic
Based on the circuit set-up, polarity control is achieved by changing the IN1 and IN2 signal states. One high and one low input drives the motor in one direction. Swapping the states reverses the polarity and changes the direction of rotation.
Motor action IN1 IN2 Clockwise motion High Low Counterclockwise motion Low High Stop motion Low Low Stop motion High High Testing video for the DC Motor Polarity Control exercise. Use this at the end of the Simulink section to compare the expected motor behaviour with your own circuit.4. Advanced Additional Exercises
These extension tasks are intended for learners who have completed the basic direction and speed tests. They require changes to the Simulink logic and encourage safer, more structured motor control.
1Build an enable and direction controllerReplace the two manual H-bridge switches with an Enable input and a Direction input. Design the logic so that Enable = 0 always stops the motor, while Enable = 1 allows Direction to choose clockwise or counterclockwise rotation. Test all four input combinations and record the resulting IN1 and IN2 values.
2Add protection against rapid reversalExtend the Simulink logic so that when the requested direction changes, the motor is first commanded to stop for a short delay before reversing. Explain why this protection is useful for the motor driver, power supply, and mechanical load.
5. Concluding Remarks
This exercise demonstrated how an Arduino Uno and Maker Drive motor driver can be used to control the direction and speed of a DC motor. By changing the H-bridge input signals, the polarity across the motor can be reversed to produce clockwise or counterclockwise rotation.
The use of PWM also allows the motor speed to be adjusted. This provides a practical introduction to motor driver circuits, polarity control, and real-time control implementation using Simulink.
Advancing automatic control engineering (ACE) education through global collaboration
Powered By

