aerobotics

L298N motor driver

 
Overview

L298N is a high-voltage, high-current motor driver chip produced by ST Company. The chip is packaged in a 15- pin package. The main features are: high working voltage, the maximum working voltage can reach 46V ; large output current, the instantaneous peak current can reach 3A , the continuous working current is 2A ; the rated power is 25W . A high-voltage and high-current full-bridge driver containing two H- bridges, which can be used to drive DC motors, stepper motors, relay coils and other inductive loads; it adopts standard logic level signal control; it has two enable control terminals. There is a logic power input terminal to allow or disable the device to work without being affected by the input signal, so that the internal logic circuit part works at a low voltage; an external detection resistor can be connected to feed back the change to the control circuit. Use the L298N chip to drive the motor. This chip can drive a two-phase stepper motor or a four-phase stepper motor, or two DC motors.

A brief description:

1. Size: 80mmX45mm

2. Main chips: L298N , optocoupler

3. Working voltage: control signal DC 5V ; motor voltage DC 3V~46V (it is recommended to use below 36V )

4. Maximum working current: 2.5A

5. Rated power: 25W

Features: 1. With signal indication.

              2. The speed is adjustable

              3. Strong anti-interference ability

              4. With over-voltage and over-current protection

              5. Can control two DC motors independently

              6. Can control a stepper motor independently

              7. PWM pulse width smooth speed regulation

              8. Can realize forward and reverse rotation

              9. Use photoelectric isolation

The stepper motor rotates 1.8 degrees every time you press it

#include<reg52.h>  

/****************************************************** ****************/

/*Suppose the last four digits of the program, 1111, correspond to ABCD, and 0000 is abcd. Then the stepper motor can be subdivided into the following combinations

 

Abcd》aBcd》abCd》abcD The corresponding array is 0x08,0x04,0x02,0x01

 

The corresponding array of ABcd》aBCd》abCD》AbcD is 0x0C,0x06,0x03,0x09

 

ABcd》aBcd》aBCd》abCd》abCD》abcD》AbcD》AbcD The corresponding array is 0x0C,0x04,0x06,0x02,0x03,0x01,0x09,0x08

 

As long as the power is turned on in the order of ABCD, various combinations of products can be produced.

 

/****************************************************** ****************/ 

code unsigned char run[8]={0x03,0x0b,0x09,0x0d,0x0c,0x0e,0x06,0x07}; 

unsigned char a,s,i,j,k;

sbit ANJIAN=P2^0;

void delay(i)//delay function

{

for(j=0;j<i;j++)

for(k=0;k<250;k++);

}

main()

{

unsigned char z,y;

y=10;     //Define the delay time. The longer the time, the slower the motor speed and vice versa.

a=0;

while(1)

{

if(ANJIAN==0)

{

 a++;

while(!ANJIAN);

//delay(y);

 

switch(a)

{

case 1:P1=run[0];delay(y);break;//P1=run[1];delay(y);break;

case 2:P1=run[2];delay(y);break;//P1=run[3];delay(y);break;

case 3:P1=run[4];delay(y);break;//P1=run[5];delay(y);break;

case 4:P1=run[6];delay(y);break;//P1=run[7];delay(y);break;

case 5:P1=run[0];delay(y);break;//P1=run[1];delay(y);break;

case 6:P1=run[2];delay(y);break;//P1=run[3];delay(y);break;

case 7:P1=run[4];delay(y);break;//P1=run[5];delay(y);break;

case 8:P1=run[2];delay(y);break;//P1=run[3];delay(y);break;

case 9:P1=run[0];delay(y);break;//P1=run[1];delay(y);break;

case 10:P1=run[6];delay(y);break;//P1=run[7];delay(y);break;

case 11:P1=run[4];delay(y);break;//P1=run[5];delay(y);break;

case 12:P1=run[2];delay(y);break;//P1=run[3];delay(y);break;

case 13:P1=run[0];delay(y);break;//P1=run[1];delay(y);break;

case 14:a=0;break;

 

default:break;

}

 

}

 }

 

 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-08 15:27:07
  • 2110 output PWM problem
  • LPC1500 Experience-(ADC+DAC Combination Experience)
  • Advantages of FRAM in Automobile Driving Recorder
  • Urgently looking for senior electronic design/IC design engineer
  • SHT10 Information
  • DE1SOC Linux system supports image and audio

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号