L293D Motor Driver Integrated Circuit (Student Version) ******************************************************** Description ============ L293D is an integrated circuit (IC) that is used as a motor driver. It allows the user to drive the motors in two directions, clockwise and counter-clockwise. Controlling the rotation of the motor in two directions is done by reversing the current. L293D allows the user to do that. It can operate two motors at one time independently. L293D also allows us to connect an external power supply to operate the motors. Materials Needed: ================= - Raspberry Pi with micro SD card and Raspbian - One or two 6V simple DC motors - 4*1.5V batteries - IC 293D - Jumper wires - Breadboard Diagram ======================== .. image :: _static/L293D/image2.png :align: center *Figure 1: shows a labeled diagram of the pins on IC L293D* Please note that the Vs is connected to the positive pole of the external power supply, the Vss to the 5V Vcc pin of the Raspberry Pi. The ground pins on the IC need to be commonly connected to the ground of the Raspberry Pi and the external power supply. Please refer to the schematic diagrams, figures 2 and 3 below for more details. Circuitry: ---------------------------- .. image :: _static/L293D/image3.png :align: center *Figure 2: The diagram above shows the wiring of the L293D* .. warning:: Proper attention should be given to the wiring of the IC L293D. Make sure to follow the diagram above. In addition, changing the polarity of the battery will cause the current to reverse. This will lead to the overheating and damage of the IC. If this happens, the battery needs to be disconnected. Avoid touching the IC as it might cause skin burn. .. image :: _static/L293D/image4.png :align: center *Figure 3: The diagram above shows the connections of L293D to the Raspberry Pi, the external power supply, and one or two motors.* Programming ------------------------------ The script below can be used to control one motor: **Controlling One Motor:** .. literalinclude:: ../examples/L293D/ControlOneMotor.py *Controlling Two Motors:** .. literalinclude:: ../examples/L293D/ControlTwoMotors.py