Using advanced motor control

The previous driving circuits are not suitable for driving motors in more than one direction (as they only switch the motor on or off). However, using a circuit named an H-bridge, you can switch and control the motor's direction too. The switch combinations are shown in the following diagram:

Using advanced motor control

The direction of the motor can be controlled by different switch combinations

Using a different combination of switching, we can change the direction of the motor by switching the positive and negative supply to the motor (SW1 and SW4 activate the motor, and SW2 and SW3 reverse the motor). However, not only do we need four switching ...

Get Raspberry Pi for Python Programmers Cookbook - Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.