Sei sulla pagina 1di 8

1|P ag e

L298 MOTOR DRIVER

An ISO 9001-2008 Certified Company Order Code RDL/HBL/13/001/V1.0

L298 Motor Driver


The L298 Driver is a high voltage, high current dual full bridge driver designed to accept standard TTL logic levels and drive inductive loads such relays, solenoids, DC and stepping motor. Two enable inputs are provided to enable or disable the device independently of the input signals. The emitters of the lower transistors of each bridge are connected together the corresponding external terminal can be used for the connection of an external sensing resistor .

Features
Low saturation voltage. Overtemperature protection. Four motor direction indicator LEDs. An onboard user accessable 5v low dropout regulator.

Applications
MCU controlled vehicle. Wheel robots.

Specifications
Parameter Operating Voltage DC Current Value Up to 46v 4A

www.researchdesignlab.com

2|P ag e
L298 MOTOR DRIVER

An ISO 9001-2008 Certified Company Order Code RDL/HBL/13/001/V1.0

Pin Details
Pin 1 2 3 4 5 6 7 8 Name gnd +12v IN1 IN2 ENA ENB IN3 IN4 Details Power supply ground Power supply input Direction of motor 1 Direction of motor 1 Controlling motor 1 Controlling motor 2 Direction of motor 2 Direction of motor 2

Working
The L298 integrates two power output stages (A ; B). The power output stage is a bridge configuration and its outputs can drive an inductive load in common or differential mode, depending on the state of the inputs. The current that flows through the load comes out from the bridge at the sense output : an external resistor (RSA ; RSB.) allows to detect the intensity of this current. INPUT STAGE Each bridge is driven by means of four gates the in-put of which are In1 ; In2 ; EnA and In3 ; In4 ; EnB. The In inputs set the bridge state when The En input is high ; a low state of the En input inhibits the bridge. All the inputs are TTL compatible.

www.researchdesignlab.com

3|P ag e
L298 MOTOR DRIVER

An ISO 9001-2008 Certified Company Order Code RDL/HBL/13/001/V1.0

A non inductive capacitor, usually of 100 nF, must be foreseen between both Vs and Vss, to ground, as near as possible to GND pin. When the large capacitor of the power supply is too far from the IC, a second smaller one must be foreseen near the L298. The sense resistor, not of a wire wound type, must be grounded near the negative pole of Vs that must be near the GND pin of the IC. Each input must be connected to the source of the driving signals by means of a very short path. Turn-On and Turn-Off : Before to Turn-ON the Supply Voltage and before to Turn it OFF, the Enable in-put must be driven to the Low state.

www.researchdesignlab.com

4|P ag e
L298 MOTOR DRIVER

An ISO 9001-2008 Certified Company Order Code RDL/HBL/13/001/V1.0

Sample Application

www.researchdesignlab.com

5|P ag e
L298 MOTOR DRIVER

An ISO 9001-2008 Certified Company Order Code RDL/HBL/13/001/V1.0

Code: Controlling the direction of DC motor using L298 driver.


/* * Project name: L298 MOTOR DRIVER * Copyright (c) Researchdesignlab.com * Description: * Test configuration: MCU: Dev.Board: Oscillator: Software: */ #include<reg51.h> #define LCD_PORT P2 sbit rs=P3^5; sbit en=P3^7; sbit D7=P2^7; sbit rw=P3^6; sbit IN1=P1^0; // IR sensor PIN connected P1.0 sbit IN2=P1^1; TR1=1; sbit IN3=P1^2; P1=0X00; sbit IN4=P1^3; while(1) AT89S52 8051 11.0592 MHz Keil uVision3 void main() { unsigned char CMD[]={0x38,0x01,0x0f,0x06,0x80},TEMP1 ,i,RX; for(i=0;i<5;i++) { TEMP1=CMD[i]; CMD_WRT(TEMP1); } TMOD=0X20; TH1=0XFD; SCON=0X50; void DATA_WRT(unsigned char); unsigned char SCI_ReceiveByte( void ); void busy(); //LCD busy

void CMD_WRT(unsigned char);

void LCD_WRT(unsigned char *); void DELAY();

www.researchdesignlab.com

6|P ag e
L298 MOTOR DRIVER

An ISO 9001-2008 Certified Company Order Code RDL/HBL/13/001/V1.0 IN1=1;

{ RX=SCI_ReceiveByte(); DELAY(); if(RX=='F') { IN1=1; IN2=1; IN3=0; IN4=0; CMD_WRT(0X01); CMD_WRT(0X80); LCD_WRT("MOTOR FORWARD"); DELAY(); } else if(RX=='B') { IN3=1; IN4=1; IN1=0; IN2=0; CMD_WRT(0X01); CMD_WRT(0X80); LCD_WRT("MOTOR BACKWARD"); DELAY(); } else if(RX=='L') {

IN3=1; IN2=0; IN4=0; CMD_WRT(0X01); CMD_WRT(0X80); LCD_WRT("MOTOR LEFT"); DELAY(); } else if(RX=='R') { IN2=1; IN4=1; IN1=0; IN3=0; CMD_WRT(0X01); CMD_WRT(0X80); LCD_WRT("MOTOR RIGHT"); DELAY(); } else if(RX=='S') { IN1=0; IN2=0; IN3=0; IN4=0;

www.researchdesignlab.com

7|P ag e
L298 MOTOR DRIVER

An ISO 9001-2008 Certified Company Order Code RDL/HBL/13/001/V1.0 rs=0; rw=0; en=1; en=0; } void DATA_WRT(unsigned char ch) { busy(); LCD_PORT = ch; rs=1; rw=0; en=1; en=0; } void LCD_WRT(unsigned char *string) { while(*string) DATA_WRT(*string++); } unsigned char SCI_ReceiveByte( void ) { unsigned char byte; while(RI!=1); byte = SBUF; RI=0; return byte; }

CMD_WRT(0X01); CMD_WRT(0X80); LCD_WRT("MOTOR STOP"); DELAY(); } } } void DELAY() { unsigned int X=800000; while(X--); } void busy() { D7=1; rs=0; rw=1; while(D7!=0) { en=0; en=1; } } void CMD_WRT(unsigned char val) { busy(); LCD_PORT=val;

www.researchdesignlab.com

8|P ag e
L298 MOTOR DRIVER

An ISO 9001-2008 Certified Company Order Code RDL/HBL/13/001/V1.0

Board Dimensions
55mm

48mm

To buy this product click the below link

http://researchdesignlab.com/index.php/interfacing-board/l298-motordriver.html

www.researchdesignlab.com

Potrebbero piacerti anche