###### Table of Content

Whenever a robotics hobbyist talk about making a robot, the first thing comes to his mind is making the robot move on the ground. And there are always two options in front of the designer whether to use a DC motor or a stepper motor. When it comes to speed, weight, size, cost... DC motors are always preffered over stepper motors. There are many things which you can do with your DC motor when interfaced with a microcontroller. For example you can control the speed of motor, you can control the direction of rotation, you can also do encoding of the rotation made by DC motor i.e. keeping track of how many turns are made by your motors etc. So you can see DC motors are no less than a stepper motor.

In this part of tutorial we will learn to interfacing a DC motor with a microcontroller. Usually H-bridge is preffered way of interfacing a DC motor. These days many IC manufacturers have H-bridge motor drivers available in the market like L293D is most used H-Bridge driver IC. H-bridge can also be made with the help of trasistors and MOSFETs etc. rather of being cheap, they only increase the size of the design board, which is somtimes not required so using a small 16 pin IC is preffered for this purpose.

### Working Theory of H-Bridge

The name "H-Bridge" is derived from the actual shape of the switching circuit which control the motoion of the motor. It is also known as "Full Bridge". Basically there are four switching elements in the H-Bridge as shown in the figure below.

As you can see in the figure above there are four switching elements named as "High side left", "High side right", "Low side right", "Low side left". When these switches are turned on in pairs motor changes its direction accordingly. Like, if we switch on High side left and Low side right then motor rotate in forward direction, as current flows from Power supply through the motor coil goes to ground via switch low side right. This is shown in the figure below.

Similarly, when you switch on low side left and high side right, the current flows in opposite direction and motor rotates in backward direction. This is the basic working of H-Bridge. We can also make a small truth table according to the switching of H-Bridge explained above.

Truth Table
High Left High Right Low Left Low Right Description
On Off Off On Motor runs clockwise
Off On On Off Motor runs anti-clockwise
On On Off Off Motor stops or decelerates
Off Off On On Motor stops or decelerates

As already said, H-bridge can be made with the help of trasistors as well as MOSFETs, the only thing is the power handling capacity of the circuit. If motors are needed to run with high current then lot of dissipation is there. So head sinks are needed to cool the circuit.

Now you might be thinkin why i did not discuss the cases like High side left on and Low side left on or high side right on and low side right on. Clearly seen in the diagra, you don't want to burn your power supply by shorting them. So that is why those combinations are not discussed in the truth table.

So we have seen that using simple switching elements we can make our own H-Bridge, or other option we have is using an IC based H-bridge driver. Both of them are discussed in the next section of the tutorial.

#### Conversation

Fri Dec 19 2014, 11:31 AM
1
-1'
Fri Dec 19 2014, 11:30 AM
1
1
Fri Dec 12 2014, 04:38 AM
Wed Dec 10 2014, 06:41 PM
Abdul BAsit
I am working on smoke detector using AT89S52 and dont know how its wors..kindly send me circuit diagram and code for its hardware & software implementation
Tue Dec 09 2014, 11:30 AM
Irinel
Please send me the content of that cd-rom (embedded c - michael j pont. Thank you.
Tue Dec 09 2014, 02:45 AM
kmyo
please give me the operation of 12v trickle charger
Sun Dec 07 2014, 07:50 AM
hidawi
we need the circuit diagrom of the remote control of iduction motor by android appliction
Tue Dec 02 2014, 10:30 AM
I have no idea... I'm new to micro controllers
Tue Dec 02 2014, 08:35 AM
samarnath dev
how can usb key bord interfasing to dot matrx led moving, by asm51 ?
Tue Dec 02 2014, 08:32 AM
samarnath dev
how can usb key bord interfasing to 8051 by asm code?

### Recent

naimish324
Wed Dec 17 2014, 04:48 AM
sathish177
Tue Dec 16 2014, 06:43 PM
djnokey
Sat Dec 13 2014, 12:12 PM
sai9113
Tue Dec 09 2014, 07:23 AM
alexlomol
Fri Dec 05 2014, 12:06 AM
chandujonty
Thu Dec 04 2014, 10:11 AM
fantasy1214
Mon Dec 01 2014, 01:45 PM
vumbelino
Sat Nov 29 2014, 04:43 PM

#### Online

Guests: 53, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 37560
Forum Activity
##### Posted By sankalp_s
Sat Dec 20 2014, 05:31 PM
For what you want,it is easier to not use interrup...
##### Posted By ExperimenterUK
Fri Dec 19 2014, 09:58 PM
For what you want,it is easier to not use interrup...
##### Posted By sankalp_s
Fri Dec 19 2014, 06:04 PM
This version works.Edit it to use either method. ...
##### Posted By muhibraza
Fri Dec 19 2014, 08:05 AM
##### Posted By software_developer
Fri Dec 19 2014, 04:54 AM
Which files i have to use?Please give me .zip fold...
##### Posted By ExperimenterUK
Fri Dec 19 2014, 12:21 AM
This version works.Edit it to use either method. ...
##### Posted By sankalp_s
Thu Dec 18 2014, 08:40 PM
SIR THIS CODE IS NOT WORKING.. ORG 000H ; starting...
##### Posted By sankalp_s
Thu Dec 18 2014, 08:36 PM
i've tried this code but faced a syntax error on l...
##### Posted By sankalp_s
Thu Dec 18 2014, 08:32 PM
SIR THIS CODE IS NOT WORKING.. ORG 000H ; starting...
##### Posted By ajay_bhargav
Thu Dec 18 2014, 04:24 AM
Code is all ok.. just change EXT0 to EX0... By mis...