User Manual
79
Lesson 11 How to Drive a DC Motor
Introduction
In this lesson, w e will learn to how to use L293D to drive a DC motor and make it rotate
clockwise and counterclockwise. Since the DC Motor needs a larger current, for safety
purpose, here we use the Power Supply Module to supply motors.
Components
- 1 * Raspberry Pi
- 1 * Breadboard
- 1 * L293D
- 1 * DC motor
- 1 * Power Module
-Jumper wires
Principle
L293D
L293D is a 4-channel motor driv er integrated by chip w ith high v oltage and high current. I t's
designed to connect to standard DTL, TTL logic lev el, and driv e inductive loads (such as relay
coils, DC, stepping motors) and power switching transistors etc. DC Motors are devices that
turn DC electrical energy into mechanical energy. They are w idely used in electrical driv e
for their superior speed regulation performance.
See the figure of pins below . L293D has two pins (Vcc1 and Vcc2) for power supply. Vcc2 is
used to supply power for the motor, w hile Vcc1 to supply for the chip. Since a small-sized DC
motor is used here, connect both pins to +5V. If you use a higher power motor, you need to
connect Vcc2 to an external pow er supply.
The following is the internal structure of L293D. Pin EN is an enable pin and only works w ith
high lev el; A stands for input and Y for output. You can see the relationship among them at
the right bottom. When pin EN is High lev el, if A is High, Y outputs high lev el; if A is Low, Y
outputs Low level. When pin EN is Low level, the L293D does not work.
SunFounder