Motor Control With Arduino Using L298n Dual H-Bridge Motor Driver
by shakeeldhanushka in Circuits > Arduino
1360 Views, 5 Favorites, 0 Comments
Motor Control With Arduino Using L298n Dual H-Bridge Motor Driver
L298n Dual H-Bridge Motor Driver can use to control dc motors with Arduino.it will control the direction and also speed of the dc motor. It can control 2 dc motors.(can control 4 motors but it is not recommend to controlling 4 dc motors with this type controllers.). L298n Dual H-Bridge Motor Driver called as H-Bridge through out this project .
Supplies
Arduino Uno * 1
Dual H-Bridge Motor Driver * 1
Dc motor * 2
12v power supply
Jumper wires
Introduction of L298n Dual H-Bridge Motor Driver and Connects to the Motors
Two motors can control using pin1,pin2 and pin3,pin4(these are the output pins). IN1,IN1 and IN3,IN4 are the input pins
H-Bridge can control up to 12v (but can control up to 35v and it is not recommended) and there is a (2v) voltage drop between power in and output pins(10v). hence, keep the power supply voltage higher (12v) than the output(10v) voltage. If not ,it will not able to give enough output voltage to operates dc motors.
Connect motor 1 into pin1,pin2 and motor 2 into pin3,pin4 in the H-Bridge. The direction and speed of the motor 1 and motor 2 will controls by pins labeled as IN1,IN1 and IN3,IN4 respectively.
IN1--> low(0) IN2--> low(0) motor --> off
IN1--> low(0) IN2--> high(1) motor--> backward
IN1--> high(1) IN2--> low(0) motor --> forward
IN1--> high(1) IN2--> high(1) motor--> off
H-Bridge is able to supply +5v voltage output using +5v pin on the H-Bridge and it can be used to powered up Arduino Uno Board.
Connect Control Pins Into Arduino Uno
Connect motor 1 control pins IN1,IN2 into digital pin5,pin4 and motor 2 control pins IN3,IN4 into digital pin3,pin2 in the Arduino Uno board.
NOTE : remember to connect control pins into the output pins which can do pulse width modulation (PWM) marked with ~ (tilde mark)
Connecting to the Power Supply
The motors and Arduino Uno board can powered up using separate power sources or using on single power source .If you powered up with separate power sources then remember to connect Ground of the power source
(-Vcc) into GND pin in the Arduino Uno board (make it as common ground ).
Always remember to give 2v(volt) voltage greater than the voltage which the motor operate it's maximum level ( maximum speed).
Using single power source
connect +12v pin in the H-Bridge into the +Vcc of the power source and connect GND in the H-Bridge and GND in the Arduino Uno board and connect into -Vcc of the power source. Arduino Uno board can powered up by connecting the +5v pin in the H-Bridge and the Vin pin in the Arduino Uno board together .