Controlling DC motors with Arduino and L293
Easy way to control DC motors.All you need is knowledge in electronics and programming
If you have any questions or problems you can contact me on my mail:[email protected]
All materials you need can be found on ebay or amazon.But if you any old electronics devices such as printers or something else you can get materials from there.
For this project you will need:
-motor driver L293D
-Arduino Mega 2560 or Uno
-9V battery case
-Green and red LED diodes
-two push buttons
-two 10k ohm resistors
Motor driver L293D
You can use this chip for controlling one or two different motors.It belongs in TTL family, that means it runs on 5V+.
It has 16 pins
Pin 1 no connect
Pin 2 is input
Pin 3 is output for motor
Pin 4 and 5 are connected to GND of battery
Pin 6 is second output for motor
Pin 7 is second input
Pin 8 is V+ from battery (9V)
On the other side is the same except :
Pin 16 is Vcc+
Pin 9 no connect
If you will have any problems with wiring you can help youself with the pictures.On top there is circuit for controlling 1 motor and down is circuit for controlling 2 motors.I made exemple with only one motor.
Digital input 2 is connected to ON button (button with blue cap)
Digital input 3 is connected to OFF button (button with red cap)
With this two buttons you can change direction of spinning
You need to connect 10k ohm resistor between GND from Arduino to push button pin.
Green LED diode is connected to digital output 5
Red LED diode is connected to digital output 4
Pin 1 no connect so you let it empty.
Next is Pin 2 which is connect to digital output on Arduino (you can choose any digital output from 2 to 53)
Pin 3 is connected directly to motor
Pin 4 and 5 are connected to battery GND
Pin 6 is connected directly to motor
Pin 7 is connecte to digital output on Arduino
Pin 8 is V+ from battery.I recommend you to use 9V battery so the motor will run smoothly
If you have need chance you can make circuit.
For more detail: Controlling DC motors with Arduino and L293