×
L298N V3 4 Channel Driver Motor

L298N V3 4 Channel Motor Driver dan Arduino

Kali ini kita mau melakukan testing alat driver motor L298N V3 yang memiliki kemampuan kontrol 4 buah DC Motor sekaligus. Hal ini bisa dilakukan berkat adanya 2 buah IC L298N tertanam pada module ini. Sebenarmya masih ada fitur-fitur lainnya selain kontrol 4 buah dc motor sekaligus, namun kali ini kita hanya membahas sebatas penggunaan dengan DC Motor saja.

Kita simak dahulu spesifikasi daripada Driver Motor L298N V3 ini :

Driver Motor L298N 4 Channel Motor Controller

This dual L298N driver module, using ST’s L298N new original chip, and high stability SMT process, with high-quality electrolytic capacitors to make the circuit work stably. It can directly drive two 3~30V DC motor. and it provides a 5V output interface (the min input is 6V) to power for 5V single-chip circuit (low ripple factor). It also supports 3.3V MCU ARM control, you can easily control the speed and direction of DC motor, and control the 2-phase stepper motor, 5-wire 4-phase stepper motor.

Product Parameters:

  • Driver Chip: L298N dual H-bridge DC motor driver chip
  • Power Supply of Driving Terminal: + 5V~+ 30V (the range is + 6V~+30V if taking
    Internal power)
  • Peak Current of the Driving Part: 2A
  • Operating Current of Logical Part: 0 ~ 36mA
  • Control Signal Input Voltage (IN1 IN2 IN3 IN4):
  • Low level: -0.3V≤Vin≤1.5V
  • High level: 2.3V≤Vin≤Vss
  • Enable Signal Input Voltage (ENA ENB):
  • Low level: -0.3≤Vin≤1.5V (control signal is invalid)
  • High level: 2.3V≤Vin≤Vss (control signal is active)
  • Max Power Consumption: 20W (when the temperature T = 75 °c)
  • Storage Temperature: -25 °c ~ + 130 °c
  • Drive Board Size: 82 x 45 x 33mm (with fixed copper pillar and heatsink height)
  • Other Expansion: control direction indicator, logical part board internal taking power interface

Features:

  • This drive module integrates the two L298N chip, it can drive four DC motors (reversible, can use PWM to control speed) or two stepper motors.
  • It integrates LM2596 DC-DC voltage regulator chip (which can output 5V, can power for the SCM, servos, sensor, router. the battery can up to 2A).
  • In addition to the two pieces L298N chip on the board, and then integrate a ULN2003 can drive one more stepper motor, or four DC motors (start and stop, not reversible). For example, when making fire-fighting robot, it can control extinguishing fan, not need external circuit.
  • Integrated servo interface, leads to the signal terminal, it’s convenient to dock with SCM.
  • Integrated USB connector, which can be directly powered by plugging into the router.
  • Apply to W703N, WIFI car router modification. inserting USB, leading out the RXD TXD through pins, it is convenient to communicate with its own SCM.
  • 5V DC output leading-out terminal (terminal, pin), it’s convenient to power for the 5V external devices.

Pada kesempatan kali ini Klinik Robot akan menggunakan driveer motor ini sebagai penggerak DC Gearmotor #KR13042, berikut beberapa peralatan yang digunakan :

Setelah peralatan didapatkan, kita coba script pemrograman sederhana dibawah ini :

/*
  L298N V3 - 4 Channel Motor Driver

  created 13 Juli 2023
  by KlinikRobot.com
*/

  // Pengaturan PIN untuk IN1 dan IN2, menentukan arah putaran motor saja CW/ CCW
int motor1pin1 = 6; // dari pin 6 Arduino dihubungkan ke IN1 pada module L298N
int motor1pin2 = 7; // dari pin 7 Arduino dihubungkan ke IN2 pada module L298N

void setup() {
  
  pinMode(motor1pin1, OUTPUT);
  pinMode(motor1pin2, OUTPUT);

  pinMode(9, OUTPUT); //Pengaturan PIN Signal PWM - mengatur kecepatan putar dc motor
  // dari pin 9 Arduino dihubungkan ke pin ENA module L298N (jumper pada module dicabut)
}

void loop() {

  analogWrite(9, 90); // ENA pin 9, digunakan untuk mengatur kecepatan putar/ Signal PWM daripada Motor nilainya 0-255

  // Motor berputar Counter Clockwise/ CCW berlawanan arah putaran jarum jam
  digitalWrite(motor1pin1, HIGH);
  digitalWrite(motor1pin2, LOW);
  delay(8000);
  
  // Motor berputar Clockwise/ CW searah putaran jarum jam
  digitalWrite(motor1pin1, LOW); 
  digitalWrite(motor1pin2, HIGH);
  delay(8000);

  // Motor tidak berputar untuk kedua IN1 dan IN2 bernilai LOW, LOW maupun HIGH, HIGH
  digitalWrite(motor1pin1, LOW);
  digitalWrite(motor1pin2, LOW);
  delay(5000);
}

Bisa disimak video pengoperasian dan penjelasan lebih lanjut melalui video berikut ini