Atlassian uses cookies to improve your browsing experience, perform analytics and research, and conduct advertising. Accept all cookies to indicate that you agree to our use of cookies on your device. Atlassian cookies and tracking notice, (opens new window)
Confluence
/
H-Bridge

H-Bridge

Oct 19, 2022

Analytics

Loading data...

German Version

A H-bridge is an integrated circuit that can control the direction of DC current. This makes it perfect to control the direction of DC motors. Unlike using a transistor as switch, with an H-bridge we are able to make the motor turn in one direction or the other. There are different types of H-bridges, which differ slightly in their characteristics - especially in power. However, the pin assignment is the same for most H-bridges. The most used H-Bridges are the SN754410 (datasheet) or L293D (datasheet). In the following illustration, you can see the example of an SN754410.

One motor can be controlled on each side of the H-bridge. First, however, all connections for the power supply should be connected. These are GND for ground, VCC1 for the 5V supply and VCC2 for an external voltage source (observe motor specifications). Pins 1A, 2A, 3A and 4A are used to set the direction of rotation (direction of flow of the voltage). The logic is: If 1A HIGH and 2A LOW, then the motor turns in one direction, if 1A LOW and 2A HIGH, then the motor turns in the other direction. The same goes for pins 3A and 4A. The motor itself is connected to pins 1Y, 2Y or 3Y, 4Y. The H-bridges can be switched on or off by using pins 1,2 EN and 3,4 EN. A PWM signal (see Pulse Width Modulation) can also be applied here to influence the speed of the motor.

Another benefit can be the use of an H-bridge to control a stepper motor. This tutorial shows how to do this.

Example

1x Arduino
1x H-Bridge SN754410 (Datasheet)
1x DC Motor 

Example Motor Expand source
#define MOTOR_PIN_A 5
#define MOTOR_PIN_B 6
void setup() 
{
  pinMode(MOTOR_PIN_A, OUTPUT);
  pinMode(MOTOR_PIN_B, OUTPUT);
}
void loop() 
{
  //One direction
  digitalWrite(MOTOR_PIN_A, HIGH);
  digitalWrite(MOTOR_PIN_B, LOW);
  delay(5000);
  
  //The other direction
  digitalWrite(MOTOR_PIN_A, LOW);
  digitalWrite(MOTOR_PIN_B, HIGH);
  delay(5000);
}

Exercise

1. Use a push button to change the running direction of the motor.

2. Add a way of controlling the speed as well as direction, such as a potentiometer. 

Further Information:

H-Bridge - Wikipedia


Using Two Motors

Here is an example with two motors. Remember, you can supply 9 volts to the VIN pin on the Arduino to run everything with the 9-volt battery. 


 

, multiple selections available,
For you

Electrical Engineering
Results will update as you type.
  • Aesthetic elements in Eagle
  • Actuators and Outputs
  • Aktuatoren (DE)
  • Analog Input
  • Analog Sensors
  • Arduino Grundlagen
  • Arduino Programmieren
  • Arduino und Processing
  • Shift Registers
  • Carvey
  • Capacitors
  • Bread Boards
  • Digitaler Input
  • Digitaler Output
  • Eagle
  • Energy Harvesting
  • H-Bridge
  • I2C (en)
  • Interrupt Service Routine
  • Mosfet Transistor
  • LED
  • PCBs Herstellen
  • Pololu Servo Controller
  • Relays as Switches
  • Pulse Width Modulation
  • RFiD
  • Schrittmotorentreiber
  • SD Karten
  • Signal Filtering
  • Transistors as Switches
  • Widerstand
  • PCB Manufacturing
  • PlatformIO
  • Lynx Smart Motion Servo
  • Electronics Basics (EN)
  • Arduino Basics (en)
  • Arduino Programming (EN)
  • Digital Outputs (en)
  • Digital Input (en)
  • Serial Communication (en)
  • Pulse Width Modulation (en)
  • Resistors (en)
  • Arduino and P5.js
  • Arduino and ml5.js
  • Project box 2021
  • Servo Motors
  • H-Bridge (DE)
  • Networking
  • Bit Shifting
  • C++ (Arduino) Variables
  • Stepper Motor Drivers
  • Interrupt Service Routine (en)
  • Common Arduino Problems
  • Finite State Machine
  • Voltage Regulators
  • Arduino USB HID (Human Interface Devices)

{"serverDuration": 15, "requestCorrelationId": "e0886950988949b5a73ad6bee49f5f32"}