
H-Bridge Setup
With this post I am going to show you how to use a SN754410NE Quad Half H-Bridge IC to control two 12 volt DC Motors. I have added a video so that you can see the Dual Motor in action. As you can see in the video, all the wires can be a little confusing to look at. To make things easier to view and understand as we go along, I have also created an illustration for you to refer to. You may also download a printable PDF file of this illustration. I have depicted an Arduino board in the illustration, if you already have one you are good to go, if not… you can do like I have and Build Your Own Arduino following another one of my tutorials.
Here is the recommended parts you will need in order to complete this project. I have provided sources where you can purchase items from and their prices.
- Arduino board – $29.95 at CuriousInventor.com or…
- Build Your Own Arduino – Total build cost $15.95 at ArduinoFun.com
- SN754410 Quad Half H-Bridge – $2.50 available at ArduinoFun.com
- 840 Tie Point Breadboard – $6.95 available at ArduinoFun.com
- Wire Jumper Kit – $12.95 available at ArduinoFun.com
- Two DC Motors – $3.99 ea. available at ArduinoFun.com

H-Bridge Pinout
As you are looking at the SN754410NE chip, you will notice a u-shaped notch at one end. This will help to identify pin 1.
Pins 1, 9, and 16 are +5V
Pin 8 is +12V and will run the +12V DC motors.
Pins 4, 5, 12, and 13 are for GND
DC Motors have two hook ups on them. If you hooked one up straight to the source power you would have one lead going to positive and one lead going to GND.
For our H-Bridge driver, you will hook the left motor leads to pin 3 & 6. The right motor leads will hook up to pins 11 & 14.
Connect h-bridge pin 2 to the Arduino digital pin 2, and h-bridge pin 7 to Arduino digital pin 3.
Connect h-bridge pin 10 to Arduino digital pin 8, and h-bridge pin 15 to Arduino digital pin 7
Once you have your h-bridge circuit completed, you can upload the sketch to your Arduino. The sketch will cycle back and forth on the dc motors driving them forward and backwards and then light an led connected to pin 13 on the arduino.
Arduino Sketch
-
// Use this code to test your motor with the Arduino board:
-
-
// if you need PWM, just use the PWM outputs on the Arduino
-
// and instead of digitalWrite, you should use the analogWrite command
-
-
// ————————————————————————— Motors
-
int motor_left[] = {2, 3};
-
int motor_right[] = {7, 8};
-
int ledPin = 13; // LED connected to digital pin 13
-
-
// ————————————————————————— Setup
-
void setup() {
-
Serial.begin(9600);
-
-
// Setup motors
-
int i;
-
for(i = 0; i < 2; i++){
-
pinMode(motor_left[i], OUTPUT);
-
pinMode(motor_right[i], OUTPUT);
-
pinMode(ledPin, OUTPUT);
-
}
-
-
}
-
-
// ————————————————————————— Loop
-
void loop() {
-
-
drive_forward();
-
delay(1000);
-
motor_stop();
-
Serial.println("1");
-
-
drive_backward();
-
delay(1000);
-
motor_stop();
-
Serial.println("2");
-
-
turn_left();
-
delay(1000);
-
motor_stop();
-
Serial.println("3");
-
-
turn_right();
-
delay(1000);
-
motor_stop();
-
Serial.println("4");
-
-
motor_stop();
-
delay(1000);
-
motor_stop();
-
Serial.println("5");
-
-
digitalWrite(ledPin, HIGH); // set the LED on
-
delay(1000); // wait for a second
-
digitalWrite(ledPin, LOW); // set the LED off
-
delay(1000); // wait for a second
-
-
}
-
-
// ————————————————————————— Drive
-
-
void motor_stop(){
-
digitalWrite(motor_left[0], LOW);
-
digitalWrite(motor_left[1], LOW);
-
-
digitalWrite(motor_right[0], LOW);
-
digitalWrite(motor_right[1], LOW);
-
delay(25);
-
}
-
-
void drive_forward(){
-
digitalWrite(motor_left[0], HIGH);
-
digitalWrite(motor_left[1], LOW);
-
-
digitalWrite(motor_right[0], HIGH);
-
digitalWrite(motor_right[1], LOW);
-
}
-
-
void drive_backward(){
-
digitalWrite(motor_left[0], LOW);
-
digitalWrite(motor_left[1], HIGH);
-
-
digitalWrite(motor_right[0], LOW);
-
digitalWrite(motor_right[1], HIGH);
-
}
-
-
void turn_left(){
-
digitalWrite(motor_left[0], LOW);
-
digitalWrite(motor_left[1], HIGH);
-
-
digitalWrite(motor_right[0], HIGH);
-
digitalWrite(motor_right[1], LOW);
-
}
-
-
void turn_right(){
-
digitalWrite(motor_left[0], HIGH);
-
digitalWrite(motor_left[1], LOW);
-
-
digitalWrite(motor_right[0], LOW);
-
digitalWrite(motor_right[1], HIGH);
-
}








Nice post. Thanks.
Do you need a capacitor from the 12v power supply? I am very new to electronics and trying to figure out exactly how to hook this up. I don’t want to fry anything. So, all I have to do for the external 12v to power the motors is to hook up a 12v wall plug power supply to a barrel jack on my board and feed that to the h-bridge? Does the h-bridge handle the emf from the motor, or do I have to build to anticipate that? Also, what about the constant voltage going to the h-bridge, do I need a flyback diode to keep it from overheating?
You can add a capacitor and the flyback diode. It work fine however with how I have it set up. I have run my robots using this set up. When I first got started with the Arduino I followed the ITP Physical Computing site at
http://itp.nyu.edu/physcomp/Labs/DCMotorControl
The IC can handle up to 36V, I am currently building a robot that uses a 12V motorcycle battery and this set up.
Hey there..
I tried this experiment and got it to work. I used a 9v supply instead of 12.
I think I burnt out the chip though because I might have accidentally switched the positive and negative leads on the supply. When I try to connect the battery now in the correct way, the chip heats up, very hot and the circuit does not work.
I just want to know where I might have gone wrong. Obviously switching the positive and negative can’t be good, but I just want to make sure it was that, and not something else.
Does the supply need to be 12 at a minimum? It looks like it could be a max of about 24V. The datasheet says that per drivier, the chip can handle about 1A of current. Is it possible that running two motors would burn the chip out? Or should it be able to handle this?
I added a couple extra chips for you for free to your order. Just in case
I have used 24 V on them before.
You can add some capacitors in there as well. I will have to update the schematic on the site.