Part of a line follower project

This post forms part of my Line Following Robot project and will serve as my research for how to accurately control the speed and direction of the line follower.

What is an h-bridge?

This circuit is called an h-bridge because of it’s construction – notice the capital H formed by the diode connections in the center of the diagram below (Thank you to Circuits Today for the diagram).  As you can see the elements used to drive the motor are two NPN and two PNP transistors, four diodes and four 1K ohm resistors.


H-bridge circuit diagram

Controlling the motor

As you can see from the table below, by using the digital outputs on a microcontroller, the speed and direction of the motor can be controlled by switching the outputs to digital zero (0V) or to digital 1 (5V). on A, B, C or D respectively.

Some pointers to keep in mind:

  • an H-bridge can be bought off the shelf (more about that further down) or built on a Vero Board
  • The maximum collector current of the 2N2222 transistor is 800mA and 600mA for the 2N2907.
  • Depending on the voltage rating of the motor being used, +Vcc can be anything between 3 to 15V DC.
  • Connecting terminal D to ground and C to +Vcc same time, will result in short circuit (not recommended).
  • The same goes for connecting terminal B to ground and C to +Vcc at same time (not recommended).
  • Resistors R1 to R4 limit the base current of the corresponding transistors. Change their values to control the motor current.

Off the shelf H-bridge packages

You should be able to get an H-bridge package from any of your preferred electronics suppliers that stock Arduino, Pololu to name a couple (there are many more).  I will list a few suppliers in South Africa below.

DRV8833 dual motor driver carrier, bottom view with dimensions
DRV8833 dual motor driver carrier, 
bottom view with dimensions

I am considering using a “dual motor driver carrier” (DRV8833) package from +Pololu Robotics and Electronics which is available through Micro Robotics in Centurion, Pretoria for R145.00.  Click on DATASHEET to view it.

This motor driver breakout board operates on 2.7 – 10.8Vdc and produces a continuous current of 1.2A per channel (peak 2A).

Below is an image of the minimum wiring required for using this driver carrier with a microcontroller:


Minimal wiring diagram for connecting a microcontroller to a DRV8833 dual motor driver carrier.
Minimal wiring diagram for connecting a microcontroller to a DRV8833 dual motor driver carrier.

From this image it should be simple to produce the code needed to drive the motors and I will share the code in the final post of my line follower project.

SA stockists

Here is a list of SA stockists of h-bridge packages:

I am sure there may be other stockists as well, but these are the ones I know of.

Thank you for vising THE STEM BLOG SA
Click on Subscribe, share or simply look me up on any of these networks:

Facebook YouTube Twitter Google+ 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.