
Bu projeyi gerçekten kurmak istersen parçaları hobidevre.com'dan temin edebilirsin →
Build it for real
To build this project for real, get the parts from hobidevre.com → hobidevre.com →
More build guides: hobidevre.com/blog
Create a free account — save your progress and get more circuits →
Topic trackingWhat is it for?
To reverse a DC motor you must reverse the polarity of the voltage across its two terminals. Instead of a mechanical switch, this is done with a four-transistor circuit called an H-bridge. In this project the driver two direction inputs and one enable pin connect to the Arduino; the motor terminals go to the two driver outputs. When one direction input is HIGH and the other LOW the motor turns one way; swapping the states reverses it. If both direction inputs are pulled to the same logic level the motor brakes and stops. Motor power comes from a separate 12V supply and the driver logic from a 5V line. The driver ground, supply negative and Arduino GND meet at a common ground. This circuit is the basis of systems that need two-way motion, such as robot wheels and curtain motors.
Parts list
The following components are used to build this project:
- Arduino Uno × 1 — Generates the direction and speed control signals.
- H-bridge driver × 1 — Reverses polarity to change direction.
- DC motor × 1 — A load that turns in both directions.
- 12V motor supply × 1 — Separate power source for the motor.
- 5V supply line × 1 — Powers the driver logic side.
- Ground connection × 1 — Common reference for the power and logic sides.
Build it step by step
- Place the Arduino, driver and motor; connect GND to the common ground rail.Tip: always make the ground connection first.
- Connect the two motor terminals to the two driver outputs.Tip: swapping the terminals reverses the direction.
- Connect the 12V supply positive to the driver power pin and its negative to common ground.Tip: never take motor power from an Arduino pin.
- Connect the 5V line to the driver logic supply pin.Tip: without a logic supply the driver will not work.
- Connect the driver ground and supply negative to the common ground.Tip: power and logic grounds must meet at one point.
- Connect the two direction pins and the enable pin to the Arduino and upload the code.Tip: if both direction pins are the same the motor stops.
How it works
An H-bridge connects each end of the motor either to the supply or to ground using four switching elements. When a diagonal pair conducts, current flows through the motor in one direction; when the other pair conducts, it flows the other way and the rotation reverses. If the enable pin receives a PWM signal, speed can also be controlled. When both direction inputs are set to the same logic level, the motor terminals sit at equal potential and the motor brakes to a stop. The driver power side runs at 12V and the logic side at 5V. The grounds of these two sides must be commoned, otherwise the control signals have no reference and direction commands are unreliable.
Layout tip: the Arduino is on the left, the H-bridge driver in the middle and the motor on the right. The motor terminals go to the driver outputs; supply positive to the power pin and negative to ground. The 5V line feeds the logic pin and all grounds share one row.
What you learn
- Explains the structure and operation of an H-bridge.
- Applies how reversing polarity changes direction.
- Explains the brake state with a logic table.
- Correctly joins power and logic grounds.
Tips
- Stop the motor briefly before changing direction.
- Setting both direction pins HIGH brakes the motor.
- Do not mix up the power and logic supplies.
- Note the relationship between wire colour and direction.
Try it yourself
- Run forwards and backwards: Change the state of the direction pins to run the motor both ways. The motor direction changes with the direction command.
- Brake: Pull both direction pins to the same logic level to stop the motor. The motor stops quickly on the brake command.
Getting the parts
If you want to build this project in real life, you can get the parts from hobidevre.com.
hobidevre.com · more build guides
Frequently asked questions
What is this circuit for?
It reverses the rotation direction of a DC motor from an Arduino using an H-bridge driver.
How does the circuit work?
The H-bridge connects the motor ends to supply or ground in diagonal pairs to reverse current flow. PWM on the enable pin sets speed, and equal logic levels on the direction inputs brake the motor.
What is the expected result?
The motor runs forwards and backwards, stops on the brake command, and power, logic and ground connections are complete.