Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Component Documentation

How to Use H-bridge motor driver: Examples, Pinouts, and Specs

Image of H-bridge motor driver
Cirkit Designer LogoDesign with H-bridge motor driver in Cirkit Designer

Introduction

An H-bridge motor driver is an electronic circuit designed to control the direction and speed of DC motors. By enabling a voltage to be applied across a motor in either direction, it allows for forward and reverse motion. The "H" in its name comes from the arrangement of four switches (transistors or MOSFETs) in an "H" configuration. This versatile component is widely used in robotics, automation systems, and motorized devices.

Explore Projects Built with H-bridge motor driver

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
ESP32-Controlled Dual DC Motor Driver with H-Bridge
Image of ckt1: A project utilizing H-bridge motor driver in a practical application
This circuit features an ESP32 microcontroller connected to an H-bridge motor driver (ponte h) to control two DC motors. The ESP32 uses its GPIO pins (D25, D32, D33, D35) to send control signals to the H-bridge, which in turn drives the motors by switching their direction and speed. Power is supplied to the system through a DC power source connected to both the ESP32 and the H-bridge, with common ground.
Cirkit Designer LogoOpen Project in Cirkit Designer
ESP32-Controlled Multi-Axis Actuator System with Orientation Sensing and Light Detection
Image of Auto_Level_Table: A project utilizing H-bridge motor driver in a practical application
This circuit features an ESP32 S3 N32R8V microcontroller interfaced with multiple IBT-2 H-Bridge Motor Drivers to control several Linear Actuators, and it receives input from KY-018 LDR Photo Resistors and Pushbuttons. The ESP32 is powered by a 5V supply from an Adafruit MPM3610 5V Buck Converter, while the Linear Actuators and Motor Drivers are powered by a 12V 7Ah battery. Additionally, the ESP32 communicates with an Adafruit BNO085 9-DOF Orientation IMU Fusion Breakout for orientation sensing.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino-Controlled Line Following Robot with H-Bridge Motor Driver and IR Sensors
Image of seguidor de linea: A project utilizing H-bridge motor driver in a practical application
This circuit is designed to control two DC motors using an H-bridge (ponte h) connected to an Arduino UNO microcontroller. The Arduino receives input from two TCRT 5000 IR sensors to determine the path and controls the motors to move forward, backward, or turn left/right based on the sensor readings. The motors are powered by a 2x 18650 battery pack, and the entire system is intended for applications such as line following robots or automated guided vehicles.
Cirkit Designer LogoOpen Project in Cirkit Designer
Arduino UNO Controlled Battery-Powered Motor and Servo System with Pushbutton Interface
Image of GrĂșa: A project utilizing H-bridge motor driver in a practical application
This circuit is designed to control a DC motor and a servo motor using an Arduino UNO, with inputs from four pushbuttons and a rocker switch. The H-bridge motor driver is used to control the DC motor, while the servo motor is directly controlled by the Arduino. The circuit is powered by a 2x 18650 battery pack.
Cirkit Designer LogoOpen Project in Cirkit Designer

Explore Projects Built with H-bridge motor driver

Use Cirkit Designer to design, explore, and prototype these projects online. Some projects support real-time simulation. Click "Open Project" to start designing instantly!
Image of ckt1: A project utilizing H-bridge motor driver in a practical application
ESP32-Controlled Dual DC Motor Driver with H-Bridge
This circuit features an ESP32 microcontroller connected to an H-bridge motor driver (ponte h) to control two DC motors. The ESP32 uses its GPIO pins (D25, D32, D33, D35) to send control signals to the H-bridge, which in turn drives the motors by switching their direction and speed. Power is supplied to the system through a DC power source connected to both the ESP32 and the H-bridge, with common ground.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of Auto_Level_Table: A project utilizing H-bridge motor driver in a practical application
ESP32-Controlled Multi-Axis Actuator System with Orientation Sensing and Light Detection
This circuit features an ESP32 S3 N32R8V microcontroller interfaced with multiple IBT-2 H-Bridge Motor Drivers to control several Linear Actuators, and it receives input from KY-018 LDR Photo Resistors and Pushbuttons. The ESP32 is powered by a 5V supply from an Adafruit MPM3610 5V Buck Converter, while the Linear Actuators and Motor Drivers are powered by a 12V 7Ah battery. Additionally, the ESP32 communicates with an Adafruit BNO085 9-DOF Orientation IMU Fusion Breakout for orientation sensing.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of seguidor de linea: A project utilizing H-bridge motor driver in a practical application
Arduino-Controlled Line Following Robot with H-Bridge Motor Driver and IR Sensors
This circuit is designed to control two DC motors using an H-bridge (ponte h) connected to an Arduino UNO microcontroller. The Arduino receives input from two TCRT 5000 IR sensors to determine the path and controls the motors to move forward, backward, or turn left/right based on the sensor readings. The motors are powered by a 2x 18650 battery pack, and the entire system is intended for applications such as line following robots or automated guided vehicles.
Cirkit Designer LogoOpen Project in Cirkit Designer
Image of GrĂșa: A project utilizing H-bridge motor driver in a practical application
Arduino UNO Controlled Battery-Powered Motor and Servo System with Pushbutton Interface
This circuit is designed to control a DC motor and a servo motor using an Arduino UNO, with inputs from four pushbuttons and a rocker switch. The H-bridge motor driver is used to control the DC motor, while the servo motor is directly controlled by the Arduino. The circuit is powered by a 2x 18650 battery pack.
Cirkit Designer LogoOpen Project in Cirkit Designer

Common Applications and Use Cases

  • Robotics: Controlling the movement of robot wheels or arms.
  • Automation: Driving conveyor belts or actuators.
  • Remote-controlled vehicles: Enabling forward and reverse motion.
  • Motorized toys: Providing directional control for DC motors.
  • Industrial machinery: Operating motors in automated systems.

Technical Specifications

Below are the general technical specifications for a typical H-bridge motor driver. Specific values may vary depending on the model (e.g., L298N, L293D, or DRV8833).

Key Technical Details

  • Operating Voltage: 5V to 35V (varies by model)
  • Output Current: 1A to 2A per channel (continuous), up to 3A peak
  • Logic Voltage: 3.3V or 5V (for control signals)
  • Number of Channels: 1 or 2 (single or dual motor control)
  • PWM Support: Yes (for speed control)
  • Thermal Protection: Built-in (varies by model)
  • Overcurrent Protection: Built-in (varies by model)

Pin Configuration and Descriptions

Below is a typical pinout for the L298N H-bridge motor driver:

Pin Name Description
IN1 Input pin to control motor direction (logic HIGH or LOW).
IN2 Input pin to control motor direction (logic HIGH or LOW).
ENA Enable pin for motor A (connect to PWM for speed control).
OUT1 Output pin connected to one terminal of motor A.
OUT2 Output pin connected to the other terminal of motor A.
IN3 Input pin to control motor direction for motor B (logic HIGH or LOW).
IN4 Input pin to control motor direction for motor B (logic HIGH or LOW).
ENB Enable pin for motor B (connect to PWM for speed control).
OUT3 Output pin connected to one terminal of motor B.
OUT4 Output pin connected to the other terminal of motor B.
VCC Power supply for the motors (e.g., 12V).
GND Ground connection.
5V Logic voltage supply (optional, depending on the model).

Usage Instructions

How to Use the Component in a Circuit

  1. Power Connections:

    • Connect the motor power supply to the VCC pin and ground to the GND pin.
    • If required, connect a 5V logic supply to the 5V pin (check your specific model's datasheet).
  2. Motor Connections:

    • Connect the motor terminals to the OUT1 and OUT2 pins for motor A, or OUT3 and OUT4 for motor B.
  3. Control Pins:

    • Use the IN1 and IN2 pins to control the direction of motor A.
    • Use the IN3 and IN4 pins to control the direction of motor B.
    • Connect the ENA and ENB pins to a PWM signal for speed control.
  4. Logic Control:

    • Apply HIGH or LOW signals to the input pins (IN1, IN2, etc.) to set the motor's direction.
    • Enable the motor by setting the ENA or ENB pin HIGH.

Important Considerations and Best Practices

  • Power Ratings: Ensure the motor driver can handle the voltage and current requirements of your motor.
  • Heat Dissipation: Use a heat sink if the motor driver gets hot during operation.
  • Flyback Diodes: Some H-bridge drivers include built-in diodes to protect against voltage spikes. If not, add external diodes.
  • PWM Frequency: Use an appropriate PWM frequency (e.g., 1 kHz to 20 kHz) for smooth motor operation.
  • Avoid Short Circuits: Never set both input pins (e.g., IN1 and IN2) HIGH simultaneously, as this can cause a short circuit.

Example Code for Arduino UNO

Below is an example of how to control a DC motor using an L298N H-bridge motor driver with an Arduino UNO:

// Define motor control pins
const int IN1 = 7;  // Motor A direction control pin 1
const int IN2 = 8;  // Motor A direction control pin 2
const int ENA = 9;  // Motor A speed control (PWM) pin

void setup() {
  // Set motor control pins as outputs
  pinMode(IN1, OUTPUT);
  pinMode(IN2, OUTPUT);
  pinMode(ENA, OUTPUT);
}

void loop() {
  // Move motor forward
  digitalWrite(IN1, HIGH);  // Set IN1 HIGH
  digitalWrite(IN2, LOW);   // Set IN2 LOW
  analogWrite(ENA, 128);    // Set speed to 50% (PWM value: 128 out of 255)
  delay(2000);              // Run for 2 seconds

  // Stop motor
  digitalWrite(IN1, LOW);   // Set IN1 LOW
  digitalWrite(IN2, LOW);   // Set IN2 LOW
  delay(1000);              // Wait for 1 second

  // Move motor backward
  digitalWrite(IN1, LOW);   // Set IN1 LOW
  digitalWrite(IN2, HIGH);  // Set IN2 HIGH
  analogWrite(ENA, 128);    // Set speed to 50% (PWM value: 128 out of 255)
  delay(2000);              // Run for 2 seconds

  // Stop motor
  digitalWrite(IN1, LOW);   // Set IN1 LOW
  digitalWrite(IN2, LOW);   // Set IN2 LOW
  delay(1000);              // Wait for 1 second
}

Troubleshooting and FAQs

Common Issues Users Might Face

  1. Motor Not Running:

    • Check power connections to the motor driver and motor.
    • Ensure the ENA or ENB pin is set HIGH or connected to a PWM signal.
    • Verify that the input pins (IN1, IN2, etc.) are receiving the correct logic signals.
  2. Motor Running in the Wrong Direction:

    • Swap the logic levels of the input pins (e.g., set IN1 LOW and IN2 HIGH for reverse motion).
  3. Overheating:

    • Ensure the motor driver is not exceeding its current rating.
    • Add a heat sink or cooling fan if necessary.
  4. Noisy Motor Operation:

    • Use a higher PWM frequency to reduce audible noise.
    • Check for loose connections or damaged wires.

Solutions and Tips for Troubleshooting

  • Use a multimeter to verify voltage levels at the motor driver pins.
  • Test the motor driver with a smaller motor to ensure it is functioning correctly.
  • Consult the datasheet of your specific H-bridge motor driver for detailed information on pin configurations and limitations.