In this project, we will learn how to drive a simple Toy Hobby Motor using the integrated circuit L293D.
Why do we need the L293D?
The Arduino cannot provide enough current to drive a motor directly from its pins (it will burn out!). The L293D acts as a "switch": it takes commands from the Arduino and supplies current from an external battery to the motor.
What you will need:
- 1x Arduino Uno
- 1x DC Motor (Type 130)
- 1x L293D motor driver integrated circuit
- 1x Battery Holder (e.g., 4xAA for 6V)
- Breadboard & Wires
The Wiring (The Circuit)
Place the L293D on the breadboard. The semicircle (notch) indicates the "top" side (Pins 1 and 16).
Power Connections:
Pin 16 (VCC1): To the 5V of the Arduino (chip power supply).
Pin 8 (VCC2): To the (+) of the Battery (motor power supply).
GND (Pins 4, 5, 12, 13): Connect all together to the ground (GND) of the Arduino AND to the (-) of the Battery. Attention: They must share a common ground!
Control Connections (Arduino):
Pin 1 (Enable 1,2): To Pin 9 of the Arduino (for speed control with PWM).
Pin 2 (Input 1): To Pin 3 of the Arduino.
Pin 7 (Input 2): To Pin 4 of the Arduino.
Motor Connections:
Pin 3 (Output 1): To one wire of the Motor.
Pin 6 (Output 2): To the other wire of the Motor.