Through this article, you will learn all about L298 Dual Full Bridge Driver. In this blog, we will be covering:

  • What is L298
  • Characteristics
  • L298 Pin-out
  • L298n Motor Driver
  • How does it work?
  • Application of L298n Motor Driver
  • Comparison with other Motor Drivers

What is L298

  • L298 is a high voltage and high current motor drive chip which receives TTL logic signals.
  • They are mostly used when
    • It is needed to operate different loads like motors and solenoid etc where a H-Bridge is required.
    • High power motor driver is required.
    • Control unit can only provide TTL outputs.
    • Current control and PWM operable single chip device is needed.
  • It has two enable inputs to enable or disable the particular device attached at its output independently.

Characteristics

The main features of the L298n Module are:

  • High working voltage – can reach up to 46v
  • Large output current
    • Instantaneous peak current can reach 3A
    • Continuous working current can reach 2A
  • 25W Rated Power
  • High-Voltage and Current full-bridge driver with 2 H-bridges used to drive inductive loads like DC and Stepper Motors.
  • Controlled with standard logic level signals
  • 2 enable control terminals to enable or device without inputting signals.
  • Able to drive a two-phase stepper motor, four-phase stepper motor or two DC motors
  • Has a high-capacity filter capacitor and freewheeling diode to protect devices from the reverse current of an inductive load.
  • Built-in stabilivolt tube 78M05 can be used to obtain 5v from power supply. (Must be used with an external 5v logic supply when drive voltage is greater than 12v to protect the chip)

L298 Pin-out

The pin functions are:

Pin-NumberName of PinDescription
1
15
Sense A
Sense B
Used to connect the sense resistor through
this pin to the ground to control the current
of the load.
2
3
Out 1
Out 2
Output of bridge A, which is the current that flows
through between these two pins which is
monitored at pin 1
4VsSupply voltage during power output stages
(non-inductive 100nF capacitor must be connected
between pin and ground)
5
7
Input 1
Input 2
TTL compatible inputs of Bridge A
6
11
Enable A
Enable B
TTL Compatible Enable Input
8GNDGND (Point where all voltages can be measured
from)
9VssSupply Voltage for Logic Blocks
(non-inductive 100nF capacitor must be connected
between pin and ground)
10
12
Input 3
Input 4
TTL Compatible Inputs of Bridge B
13
14
Out 3
Out 4
Outputs of the Bridge B. Current that flows through
here are monitored at pin 15

L298n Motor Driver

The L298 module are mostly used to design motor drivers. Here at Seeed we do offer various L298n Motor Drivers.

L298 Dual H-Bridge Motor Driver

  • Double H driver module uses ST L298N dual full-bridge driver, 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.

Motor Driver L298 Module – .NET Gadgeteer Compatible

  • This motor driver module controls the speed and direction on 2 DC motors, up to 40V 3A.
  • The module itself is powered and controlled from a gadgeteer mainboard but the motors are powered from a separate power source.

Grove – I2C Motor Driver

  • It directly controls Stepper Motor or DC Motor. Its heart is a dual channel H-bridge driver chip(L298N)that can handle current up to 2A per channel, controlled by an Atmel ATmega8L which handles the I2C communication with platforms such as Arduino.
  • Both motors can be driven simultaneously while set to a different speed and direction. It can power two brushed DC motors or one 4-wire two-phase stepper motor. 

How does it work?

The schematic diagram below shows L298n Motor Driver internal structure and working flow:

  • The control mode and state of motor A is shown in the table below:
Motor 1 (IN1), Motor 2 (IN3)Motor 1(IN2), Motor 2 (IN4) Motor
Rotation
00Stop Rotation
01Clockwise
10Anticlockwise
11Stop Rotation
  • As seen from the table, the rotation direction are controlled by the control pin IN1 and IN2 for motor 1 while control pin IN3 and IN4 for motor 2.
  • When enabled signal = 1
    • IN1 and IN2 are 00 or 11 it means the motor is in brake state
    • IN1 is 0 and IN2 is 1 it means motor A will rotate clockwise
    • IN1 is 1 and IN2 is 0 it means motor A will rotate anticlockwise
    • Motor B control method is the same as motor A
  • Motor speed can also be controlled by the module PWM control pin (ENA for Motor 1, ENB for motor 2)
    • When regulating speed, IN1 and IN2 rotational direction must be first confirmed and output PWM pulses for enabled terminals.

Application of L298n

L298n Motor Drivers are used everywhere in our everyday life ranging from vending machines to robots. You can also play around with the L298n to control DC motors right at home with the tutorial below

Controlling DC Motors with Arduino

With the L298n dual H-bridge, it allows you to switch direction of the current which means with a motor, you can make it spin in both directions. In addition, with PWM input, you can use an Arduino to make it spin at any speed.

  • Step 1- Set the address by dial switch which is a new function added to our new I2C motor driver
Setting address using the dial switch
  • Step 2 – Connect Grove – I2C Motor Driver V1.3 to port I2C of Grove-Base Shield.
  • Step 3 – Plug Grove – Base Shield into Seeeduino.
  • Step 4 – Connect Seeeduino to PC via a USB cable
  • Step 5 – Download Grove_I2C_Motor_Driver_v1_3 Library from Github.
  • Step 6 – Refer How to install library to install library for Arduino
  • Step 7 – Copy the code into Arduino IDE and upload. If you are unsure how to upload the code, please check how to upload code.

Code

Functions to control DC motors

  • With the speed function – you can drive one motor at the speed you want
    • motor_id represents which motor to use (MOTOR1/2)
    • _speed represents the speed you can set. It can be -100 to 100, when speed is >0 DC motor will run clockwise while if speed <0, DC motor will run anticlockwise. The bigger the value, the faster it is.
  • With stop function – you can choose to stop running a DC motor
    • motor_id represents which motor to use (MOTOR1/2)

There you go! You now have your very own DC motor controlled using the Seeeduino with a I2C motor driver!

Sample Hardware Installation

Interested in doing more with your L298 motor driver? You can click here to learn how to drive a stepper motor and play with Codecraft using the L298n Motor Driver: Seeedstudio Wiki – Grove – I2C Motor Driver V1.3

Comparison with other Motor Drivers

With so many motor drivers currently such as Servo Motors and stepper motors, what really are the differences between the motor drivers and which one to choose? No worries, as we have crafted a table just for you to compare the various motor drivers so you know which motor driver fits the best for your project.

Type Motor Drivers Chip Actuator Working Voltage Working Current
Grove Grove – I2C Motor Driver L298n 2 DC motor or 1 Stepper 6v to 15v 2.0A each (Max)
Grove – I2C Motor Driver (TB6612FNG) TB6612FNG 2 DC Motor or 1 Stepper 2.5v to 13.5v (5 Avg, 15v Max) 1.2A (Avg) to 3.2A (Max)
Grove – I2C Mini Motor Driver DRV8830 2 DC Motor 2.75v to 6.8v 0.2A to 1A each
Shield Motor Shield V2.0 L298n 2 DC motor or 1 Stepper 6v to 15v 2.0A each (Max)
4A Motor Shield MC33932 2 DC Motor 6v to 28v 5.0A each (Max)
Brushless Motor Shield (TB6605FTG) TB6605FTG 1 DC Brushless Motor 9v to 24v

Summary

With all the knowledge of L298n motor driver in your hands, you can now start building your very own robotic projects! You can check out the L298n data sheet for more detailed information on the L298 over here: L298 Datasheet

Please follow and like us:
error