- L298n Motor Driver Pdf
- L298n Motor Driver Code
- Motor Driver L298n Troubleshooting
- Motor Driver L298n Ic
Usage:
The L298 is an integrated monolithic circuit in a 15-lead Multiwatt and PowerSO20 packages. It is a high voltage, high current dual full-bridge driver designed to accept standard TTL logic levels and drive inductive loads such as relays, solenoids, DC and stepping motors. Description: This is a getting started tutorial on how to use the L298N motor driver and control the forward, left, right, and reverse movement. In this tutorial you will also learn how to use the pulse width modulation to control the speed of a dc motor. L298N Motor Drive Controller Dual H-Bridge Robot Stepper Motor Control Module And Smart Car Tire With DC Motor For Arduino UNO R3 Mega Smart Car Power.
The L298N is an integrated monolithic circuit in a 15- lead Multiwatt and PowerSO20 packages. It is a high voltage, high current dual full-bridge driver de-signed to accept standard TTL logic level sand drive inductive loads such as relays, solenoids, DC and stepping motors. Features of L298 motor driver L298N is an integrated circuit multi watt 15 package and capable of giving high voltage. It is a high current dual full-bridge driver which is designed as to accept standard TTL logic levels. It can drive inductive loads e.g relays, solenoids, motors (DC and stepping motor) etc.
H-Bridge's are typically used in controlling motors speed and direction, but can be used for other projects such as driving the brightness of certain lighting projects such as high powered LED arrays.
How it works:
An H-Bridge is a circuit that can drive a current in either polarity and be controlled by *Pulse Width Modulation (PWM).
* Pulse Width Modulation is a means in controlling the duration of an electronic pulse. In motors try to imagine the brush as a water wheel and electrons as a the flowing droplets of water. The voltage would be the water flowing over the wheel at a constant rate, the more water flowing the higher the voltage. Motors are rated at certain voltages and can be damaged if the voltage is applied to heavily or if it is dropped quickly to slow the motor down. Thus PWM. Take the water wheel analogy and think of the water hitting it in pulses but at a constant flow. The longer the pulses the faster the wheel will turn, the shorter the pulses, the slower the water wheel will turn. Motors will last much longer and be more reliable if controlled through PWM.
Pins:
- Out 1: Motor A lead out
- Out 2: Motor A lead out
- Out 3: Motor B lead out
- Out 4: Mo (Can actually be from 5v-35v, just marked as 12v)
- GND: Ground
- 5v: 5v input (unnecessary if your power source is 7v-35v, if the power source is 7v-35v then it can act as a 5v out)
- EnA: Enables PWM signal for Motor A (Please see the 'Arduino Sketch Considerations' section)
- In1: Enable Motor A
- In2: Enable Motor A
- In3: Enable Motor B
- In4: Enable Motor B
- EnB: Enables PWM signal for Motor B (Please see the 'Arduino Sketch Considerations' section)
Specifications:
L298n Motor Driver Pdf
- Double H bridge Drive Chip: L298N
- Logical voltage: 5V Drive voltage: 5V-35V
- Logical current: 0-36mA Drive current: 2A (MAX single bridge)
- Max power: 25W
- Dimensions: 43 x 43 x 26mm
- Weight: 26g
*Built-in 5v power supply, when the driving voltage is 7v-35v
In this project, we will see how to control a DC Motor using Arduino and L298N Motor Driver. There are different ways to control a DC Motor but the Arduino DC Motor Control using L298N Motor Driver is becoming quite popular for many reasons.
Overview
A DC Motor is the simplest of motors that beginners and hobbyists encounter. It is very simple to operate: connect the two leads of the motor to the two terminals of a battery and voila! Your motor starts rotating.
If you switch the leads i.e. reverse the polarity, the motor will rotate in reverse direction. It is as simple as that.
If you want to control the speed of rotation of a simple DC Motor, then there is a technique called PWM DC Motor Control. The Pulse Width Modulation or PWM signal generated by this technique will allow us to control the average voltage that is being delivered to the DC Motor.
Speed Control of DC Motor using PWM
Using PWM technique, the average value of the voltage that is applied to the DC Motor is controlled by turning the power on and off at a very high rate. The frequency of this switching will be in the order of few tens of kilo Hertz.
Now, the average voltage applied to the DC Motor will depend on what is called as the Duty Cycle of the PWM Signal. Duty Cycle of a PWM Signal is nothing but the ratio of the time for which the signal is ON or HIGH to the total time period of the signal i.e. sum of ON time and OFF time.
Duty Cycle is usually expressed in percent and the following figure represents different PWM Signals of a 12V supply with different duty cycles of 0%, 25%, 50%, 75% and 100% respectively.
L298n Motor Driver Code
Now that we have controlled the average voltage that is to be supplied to a DC Motor, how do we apply this voltage to the motor? Here comes the use of Transistor.
The PWM Signal from any source like Arduino in this example, can be given to the gate of a MOSFET and depending on the duty cycle of the PWM Signal, the speed of the DC Motor will vary.
The following image shows a simple circuit diagram, where a PWM output from Arduino is given to a MOSFET and the 12V DC Motor is connected through the MOSFET.
In Woolf’s last novel, the action takes place on one summer’s day at a country house in the heart of England, where the villagers are presenting their annual pageant. A lyrical, moving valedictory. Virginia Woolf The Years Virginia Woolf Mrs Dalloway in Bond Street Virginia Woolf The Mark on the Wall Oscar Wilde The Canterville Ghost. ![A haunted house by virginia woolf sparknot… A haunted house by virginia woolf sparknot…](/uploads/1/2/4/8/124858309/668672030.jpg)
![A haunted house by virginia woolf sparknot… A haunted house by virginia woolf sparknot…](/uploads/1/2/4/8/124858309/668672030.jpg)
The code for this circuit is given below. Using this code, the Arduino will vary the speed of a DC Motor in a fading fashion i.e. gradually increases the speed to peak and then gradually decreases the speed to halt.
Code
This circuit is good for controlling the speed of the motor but not an effective way to change the direction of rotation. For changing the direction of rotation without reversing the leads of the motor every time, you need to use a special circuit called H-Bridge.
DC Motor Control using H-Bridge
An H-Bridge is a simple electronic circuit consisting of four switching elements like transistors (BJT or MOSFET) that can drive a motor in both the directions without switching the leads.
The name “H-Bridge” refers to the look of the connection consisting of four transistors and a motor in the center forming the letter “H”.
A simple H-Bridge connection using four transistors and a motor is shown below. By activating two particular transistors at the same time, we can control the flow of current through the motor and hence the direction of rotation.
The two control inputs A and B in the above circuit will determine the direction of rotation of the motor. If A is LOW and B is HIGH, transistors Q1 and Q4 will be turned on and allow current to flow through the motor in a particular direction.
If the control input A is made HIGH and B is LOW, then transistors Q2 and Q3 will turn on and the flow of current through the motor is reversed and so the direction of the rotation.
By combining both the features i.e. PWM technique for speed control and H-Bridge connection for direction control, you can have a complete control on a DC Motor.
It is tedious to use transistors for making an effective H-Bridge connection. For this purpose, there are dedicated H-Bridge Motor Driver IC available in the market and the two common IC’s are L293D and L298N.
We have already seen how to control the speed of a DC Motor using L293D in an earlier project. In this project, we will focus on the more advanced L298N Motor Driver and see Arduino DC Motor Control using L298N Motor Driver using PWM technique.
Also read DC MOTOR CONTROL WITH ARDUINO AND L293D
A Brief Note on L298N Motor Driver
L298N Motor Driver IC is a 15-lead high voltage, high current Motor Driver IC with two full bridge drivers. The logic levels of L298N IC are compatible with standard TTL and IC can be used to drive different inductive loads like DC Motors, Stepper Motors, Relay, etc.
The following image shows the Pin Diagram of the L298N IC in Multiwatt Package (Multi Leaded Power Package).
Since the L298N Motor Driver IC is a dual full bridge driver IC, you can control two motors at the same time with individual inputs. The logic supply voltage is 5V but the motor supply voltage can be as high as 45V. The peak output current per channel is 2A.
Generally, L298N Driver is available as modules that contains all the necessary components and connectors for controlling two DC Motors. One such module is shown below. I’ll explain few important components on this module.
The L298N Motor Driver Module consists of two 2-pin screw terminal blocks for connecting two motors. It also has six pin male headers for connecting the two enable inputs and the four input pins (two for each motor).
There is a 3-pin screw terminal block through which you need to give the supply voltage to the motor. If the motors used are rated for 12V or less, then the 12V supply is given through this screw terminal and the onboard 5V regulator will provide the 5V logic supply to the L298N IC.
You can also access this regulated 5V through the third pin in the 3-pin screw terminal block. The jumper provided near the 3-pin screw terminal must be engaged for supply voltages up to 12V as this jumper will enable the onboard regulator. The 5V output from the third pin of the 3-pin screw terminal is available only when the jumper is engaged i.e. supply voltage is 12V. This 5V output can be used to power your Arduino Board.
If the supply voltage is greater than 12V, then remove the jumper as it might damage the regulator. In this case, the logic supply of 5V to the L298N IC is given through the third pin of the 3-pin screw terminal.
Arduino DC Motor Control using L298N
We will now see a simple circuit where we control the speed and direction of a DC Motor using Arduino and L298N IC. You need few additional components for this project and the complete list is given below. In the Arduino DC Motor Control using L298N Project, we will control both the functionalities of a simple DC Motor i.e. speed and direction of rotation using a combination of PWM Signal and L298N (H-Bridge).
![L298n motor driver pdf L298n motor driver pdf](/uploads/1/2/4/8/124858309/935639188.jpg)
Circuit Diagram
Components Required
- Arduino UNO [Buy Here]
- L298N Motor Driver Module [Buy Here]
- 12V DC Motor [Buy Here]
- 100KΩ Potentiometer [Buy Here]
- Push Button [Buy Here]
- 12V Power Supply [Buy Here]
- Breadboard [Buy Here]
- Connecting Wires [Buy Here]
Code
Motor Driver L298n Troubleshooting
Applications
Motor Driver L298n Ic
- Arduino DC Motor Control using L298N Motor Driver project can be the beginning step of many advanced projects.
- Almost all robots have wheels and we need to control the motors connected to those wheels. Hence, any Arduino based robot can implement this type of motor control using L298N.
- Some of the Robotic Applications of L298N Motor Driver are Hand Gesture Controlled Robot, Line Follower Robot, Obstacle Avoiding Robot, etc.