() 해외배송 가능
판매가 | |
---|---|
소비자가 | 0원 |
적립금 |
|
무이자할부 | |
제조사 | 자체제작 |
원산지 | |
상품코드 | P0000JQX |
수량 | |
국내/해외배송 | |
SNS 상품홍보 | |
QR코드 | |
QR코드 보내기 |
재고부족시 3 ~ 7일정도 입고기간(수입상품)이 소요됩니다.
양해부탁드립니다.
-아두이노 예제코드
#define M_IN1 4 // 모터제어 입력 핀 IN1을 Digital4번핀으로 설정
#define M_IN2 5 // 모터제어 입력 핀 IN2을 Digital5번핀으로 설정
#define M_IN3 13 // 모터제어 입력 핀 IN3을 Digital13번핀으로 설정
#define M_IN4 12 // 모터제어 입력 핀 IN4을 Digital12번핀으로 설정
int motorA_vector = 1; // 모터의 회전방향이 반대일 시 0을 1로
// 1을 0으로 바꿔주시면 모터의 회전방향이 바뀜.
int motorB_vector = 1; // 모터의 회전방향이 반대일 시 0을 1로
// 1을 0으로 바꿔주시면 모터의 회전방향이 바뀜.
void setup() { // 초기화
pinMode(M_IN1, OUTPUT); // Digital4번핀 출력 핀 설정
pinMode(M_IN2, OUTPUT); // Digital5번핀 출력 핀 설정
pinMode(M_IN3, OUTPUT); // Digital13번핀 출력 핀 설정
pinMode(M_IN4, OUTPUT); // Digital12번핀 출력 핀 설정
}
void loop() { // 무한루프
// 모터 A 정회전
digitalWrite(M_IN1,motorA_vector); // IN1번에 HIGH(motorA_vector가 0이면 LOW)
digitalWrite(M_IN2,!motorA_vector); // IN2번에 LOW(motorA_vector가 0이면 HIGH)
// 모터 B 정회전
digitalWrite(M_IN3,motorB_vector); // IN3번에 HIGH(motorB_vector가 0이면 LOW)
digitalWrite(M_IN4,!motorB_vector); // IN4번에 LOW(motorB_vector가 0이면 HIGH)
delay(5000); // 5초간 정회전 유지
// 모터 A 정지
digitalWrite(M_IN1,motorA_vector); // IN1번과 IN2번의 값이 같으면 모터A 정지
digitalWrite(M_IN2,motorA_vector);
// 모터 B 정지
digitalWrite(M_IN3,motorB_vector); // IN3번과 IN4번의 값이 같으면 모터B 정지
digitalWrite(M_IN4,motorB_vector);
delay(2000); // 2초간 정지
// 모터 A 역회전
digitalWrite(M_IN1,!motorA_vector); // IN1번에 LOW(motorA_vector가 0이면 HIGH)
digitalWrite(M_IN2,motorA_vector); // IN2번에 HIGH(motorA_vector가 0이면 LOW)
// 모터 B 역회전
digitalWrite(M_IN3,!motorB_vector); // IN3번에 LOW(motorB_vector가 0이면 HIGH)
digitalWrite(M_IN4,motorB_vector); // IN4번에 HIGH(motorB_vector가 0이면 LOW)
delay(5000); // 5초간 역회전
제품소개
-L298N 듀얼 H-브릿지 모터 드라이버 모듈
-2상스테핑모터, DC모터 제어 가능
-PWM 제어를 통해 모터속도 제어 가능
제품특징
-동작전압 DC 5V
-동작전류 0mA ~ 36mA
-모터입력전압 DC 5V ~ 35V
-모터허용전류 2A (MAX)
-최대소비전력 25W
-PCB사이즈 43mm X 43mm X 27mm
This module is integrated with a built-in 5V power.When the drive voltage is 7V-35V, it can enable the onboard 5V logic power supply;after the power supply,
don't input voltage in the interface+5V power supply,but you can lead the 5V for external use.
when ENA enable IN1 IN2 control OUT1 OUT2
when ENB enable IN3 IN4 control OUT3 OUT4
Applied cases:
1 Driving stepper motor
The connection of driving a common 4 line 2 phase electric motor is shown in below figure
after enable ENA ENB
Input the following driving timing from IN1-IN4,then the speed and direction of the stepper
motor can be controlled
Driving DC motor
Because the module is drived by double H bridge,it can drive two motors simultaneously.
The connecting method is shown inbelow figure
after enable ENA ENB
You can imput the speed and direction of PWM signal drive motor 1 from IN1 IN2
You can imput the speed and direction of PWM signal drive motor 2 from IN1 IN2
The signal is shown in the figure