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.

Basic H-bridge

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.

Motor rotation in forward direction

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.

Forum Activity
pravin_35 Avatar
Posted By pravin_35
Thu Jul 31 2014, 01:49 AM
attach is the code for lcd may be need a little ch...
majoka Avatar
Posted By majoka
Wed Jul 30 2014, 02:45 PM
@ sermeteraythank you for sharing your experience ...
majoka Avatar
Posted By majoka
Wed Jul 30 2014, 02:38 PM
@ Peter_ParkerHC06 by default baud rate is 9600try...
majoka Avatar
Posted By majoka
Wed Jul 30 2014, 02:25 PM
attach is the code for lcd may be need a little ch...
majoka Avatar
Posted By majoka
Wed Jul 30 2014, 02:21 PM
@ pravin_35both compilers are almost sameif you ha...
pravin_35 Avatar
Posted By pravin_35
Wed Jul 30 2014, 07:38 AM
http://extremeelectronics.co.in/pic16f877a-tutoria...
NexusRevZ Avatar
Posted By NexusRevZ
Wed Jul 30 2014, 02:31 AM
Ok, I have edited the code, it's updated above wit...
NexusRevZ Avatar
Posted By NexusRevZ
Wed Jul 30 2014, 02:10 AM
Oh tahnk you so much for the reply. I will do imme...
ajay_bhargav Avatar
Posted By ajay_bhargav
Wed Jul 30 2014, 01:56 AM
You cannot move and read data from EEPROM immediat...
pravin_35 Avatar
Posted By pravin_35
Wed Jul 30 2014, 12:39 AM
Remove all power connections to the circuit at the...

Conversation

Thu Jul 31 2014, 04:32 PM
1
-1'
Thu Jul 31 2014, 04:32 PM
1
1
NexusRevZ
Tue Jul 29 2014, 09:32 PM
Anyone good in Asm lang?
ajay_bhargav
Mon Jul 28 2014, 12:34 AM
@ Anshu Raj sorry we do not take such requests.
Sun Jul 27 2014, 12:23 AM
Anshu Raj
sir plz send the automatic collage alram bells in 2 hrs bells ring. For microcontroller programme plz sir
ajay_bhargav
Thu Jul 24 2014, 01:06 AM
@R.ABHISHEK where? I dont see it. is it in forum?
Wed Jul 23 2014, 05:49 AM
R.ABHISHEK
sir,pls message on microcontroller 8051 assambly language new program
Wed Jul 23 2014, 05:47 AM
R.ABHISHEK
sir,pls message on 8051 microcontroller assambly language program new quastions
ajay_bhargav
Tue Jul 22 2014, 09:18 AM
@Pragya Android application is taken from google play. Only Author has its source with him. Application is only used in this project.
Tue Jul 22 2014, 04:58 AM
Pragya
plz send me 8051 code and android code for android based device controller via Bluetooth .Here in this project I am using Hc-06 Bluetooth module

Downloads

Comments

risko
Thu Jul 31 2014, 03:53 PM
ismaelfogaca
Thu Jul 31 2014, 10:50 AM
NexusRevZ
Tue Jul 29 2014, 09:29 PM
kritz22
Mon Jul 28 2014, 10:33 AM
Abbasans786
Mon Jul 28 2014, 03:15 AM
Imran.pk
Fri Jul 25 2014, 07:50 PM
PavanKh
Fri Jul 25 2014, 12:56 AM
vinosentinal
Mon Jul 21 2014, 08:28 PM

Online

Guests: 50, Members: 0 ...

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

Members: 37486
Newest member: risko