Hardware Reference
In-Depth Information
An H-bridge circuit is used for bidirecional control of a DC motor using a microcontroller or
Raspberry Pi ( https://itp.nyu.edu/physcomp/labs/motors-and-transistors/dc-
motor-control-using-an-h-bridge/ ). The H-Bridge takes in 2 inputs for each motor. The
following table shows a logic table that dictates the control of a motor using an H-Bridge:
The SN754410 truth table
For example, if pin 1A is set to high while 2A is set to low and the leads of the motor are
connected to 1Y and 2Y respecively, the motor rotates in one direcion, while it rotates
in the opposite direcion when 1A is set to low and 2A is set to high.
Engage thrusters
1. We will get started with the tesing of the DC motors with a simple Python program.
We will get started by imporing the modules:
import RPi.GPIO as GPIO
import time
2.
We will declare the pins that will be used as output pins. We will connect the GPIO
pins, 8, 9, 10, and, 11 to motor driver pins, 1A, 2A, 3A, and 4A, respecively:
GPIO.setwarning(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(8,GPIO.OUT) #connected to 1A
GPIO.setup(9,GPIO.OUT) #connected to 2A
GPIO.setup(10,GPIO.OUT) #connected to 3A
GPIO.setup(11,GPIO.OUT) #connected to 4A
 
Search WWH ::




Custom Search