In this post I will discuss about the simulation of L298 motor driver in Proteus. In the previous posts I have discussed about the Bluetooth module simulation in Proteus and also have discussed important sensors and actuators in Proteus. This post will be oriented around the L298 motor driver and its simulation in Proteus.
After reading this post the reader will be able to learn about the basics of the L298 motor controller, working of the L298 motor controller, the principle of the L298 motor controller, circuit for L298 motor controller, interfacing of the Arduino microcontroller development board with L298 motor driver in Proteus. So sit back, keep reading and enjoy learning.
L298 Motor driver:
L298 is basically the Integrated Circuit chip that is used to drive the DC motors. The chip is designed in such a way so as to control two DC motors simultaneously and in addition control the direction of rotation of each motor, I will go into detail about this later in this post. The L298 chip looks like the one in the following image:
The L298 IC is a high current, high voltage full bridge driver designed to accept the standard TTL (Transistor-Transistor Logic) logic. The chip is optimized to drive the inductive loads such as relays, solenoids and DC motors. The Block diagram of the L298 motor driver IC is as shown in the following image:
As can be see that there are four input pins and four output pins along them two Enable pins are also available in chip. The working of each of the pin will be discussed in the following section.
Pin Configuration of the L298 Motor Driver IC:
The pinout of the chip is as shown in the following table:
The above table describes the functionality of the pins of the L298 motor driver IC. Let us learn about each bridge of the IC and its pins in some more detail. In order to understand the working of each bridge of the IC consider the following circuit:
The circuit in the above figure is called the H-Bridge circuit and is used to control the direction of rotation of the motor. Each input of the bridge lets the motor to rotate in either clockwise or counter-clockwise rotation.
The enable pin of the motor driver IC that is the ENA and ENB enables the bridge inside the IC.
Why need the L298 Motor Driver?
A question arises that why do we need the Motor Driver in fact we can drive the motor by Arduino or any other microcontroller? The answer to this question is very simple that the Arduino or any other microcontroller cannot supply enough current to drive the motors so we need the separate circuit that drives the motor itself.
L298 motor driver module:
As we saw in the previous discussion that the L298 is the motor driver IC but usually it is available in the modular form which is ready to plug and play. The module of L298 motor driver looks like the one in the following image:
The control pins, output pins and the power pins are available at the connectors of the module. Let us consider the working if each pin in detail.
This pin along with the INPUT2 pin is used to control the direction of the motor 2.
This pin along with the INPUT1 pin is used to control the direction of the motor 2.
This pin along with the INPUT4 pin is used to control the direction of the motor 1.
This pin along with the INPUT3 pin is used to control the direction of the motor 1.
This pin is used to enable the driver of the motor 2. This pin is made HIGH by default in module with the help of the jumper.
This pin is used to enable the driver of the motor 1. This pin is made HIGH by default in module with the help of the jumper.
Two power supplies with common ground is used to power up the module. One of the powers is logic supply and should be 5V and the other could be 12 volt ir according to requirement. See datasheet for detail.
L298 Simulation in Proteus:
The discussion in the previous sections describes the working of the L298 bridge motor driver. Let us now simulate the behavior of the L298 module in the Proteus. It is important here to mention that it is always beneficial to simulate the circuit before actually implementing the hardware. By simulating the system the designer can look for the glitches in the code or errors in the circuit. So it saves both time and money. It is important to note here that if you want to simulate the behavior of any circuit it is necessary that the simulation models of all of the electronic components that are used in the circuit should be present in the library of the software used for simulation. If the simulation model of the component is not present in the library of the software the software will be unable to simulate the behavior of the entire circuit. The simulation model of the L298 chip is already available in the Proteus. Bit I am using the modular simulation model of the L298 motor driver. You need to download the files containing the simulation models of the motor driver and place them in the library of the Proteus, Go through my post on Ultrasonic sensor I have discussed the whole procedure there.
Place all the components in the workspace of the Proteus as shown in the following figure:
Now connect the circuit as shown in the following figure:
As can be seen in the figure that the all the control pins are connected to the digital input / output pins of the Arduino microcontroller board.
Attach the HEX file of the code of the Arduino in Proteus as shown in the following figure:
Hit the simulation button to initiate the animation:
That is all for now I hope this post would be helpful for you. In the next post I will come up with more interesting applications and simulations of the Proteus. Till then stay connected, keep reading and enjoy learning.