• L298 Dual H-Bridge Motor Driver

L298 Dual H-Bridge Motor Driver

This module is based on the very popular L298 Dual H-Bridge Motor Driver Integrated Circuit. The circuit will allow you to easily and independently control two motors of up to 2A each in both directions. It is ideal for robotic applications and well suited for connection to a microcontroller requiring just a couple of control lines per motor. It can also be interfaced with simple manual switches, TTL logic gates, relays, etc.

Quick Spec

  • Motor supply: 7 to 24 VDC
  • Control Logic: Standard TTL Logic Level
  • Output Power: Up to 2 A each
  • Enable and Direction Control Pins
  • Heatsink for IC
  • Power-On LED indicator
  • 4 Direction LED indicators

Pinouts

H-Bridge Example Code




// Motor 1
int dir1PinA = 2;
int dir2PinA = 3;
int speedPinA = 10; // Needs to be a PWM pin to be able to control motor speed

// Motor 2
int dir1PinB = 4;
int dir2PinB = 5;
int speedPinB = 9; // Needs to be a PWM pin to be able to control motor speed



void setup() {
  Serial.begin(115200);
  pinMode(dir1PinA,OUTPUT);
  pinMode(dir2PinA,OUTPUT);
  pinMode(speedPinA,OUTPUT);
  pinMode(dir1PinB,OUTPUT);
  pinMode(dir2PinB,OUTPUT);
  pinMode(speedPinB,OUTPUT);
  set_speed_motor(speedPinA,255);
  set_speed_motor(speedPinB);
}

void loop() {

  
  motor_off();
  motor_right_forward();
  delay(3000);
  motor_off();
  motor_right_back();
  delay(3000);
  motor_off();
  motor_left_forward();
  delay(3000);
  motor_off();
  motor_left_back();
  delay(3000);
  
}

void set_speed_motor(int pin, char speed_){
  analogWrite(pin, speed_);
}


void motor_right_forward(){
  digitalWrite(dir1PinA, LOW);
  digitalWrite(dir2PinA, HIGH);
}

void motor_right_back(){
  digitalWrite(dir1PinA, HIGH);
  digitalWrite(dir2PinA, LOW);
}

void motor_left_forward(){
  digitalWrite(dir1PinB, HIGH);
  digitalWrite(dir2PinB, LOW);
}

void motor_left_back(){
  digitalWrite(dir1PinB, LOW);
  digitalWrite(dir2PinB, HIGH);
}

void motor_off(){
  digitalWrite(dir1PinA, LOW);
  digitalWrite(dir2PinA, LOW);
  digitalWrite(dir1PinB, LOW);
  digitalWrite(dir2PinB, LOW);
}


Resources

Shipping List

  • 1 x L298 Dual H-Bridge Motor Driver


L298 Dual H-Bridge Motor Driver

  • Brand: Generic
  • Product Code: L298-MOD
  • Stock

    Warehouse Stock Status Location
    Centurion In Stock K5-02
    Stellenbosch In Stock 190
  • R145.00 (Inc Tax: R166.75)


Related Products

Dual Motor Controller 1.2A per Channel

Dual Motor Controller 1.2A per Channel

Dual Motor Controller 1.2A per Channel This breakout board uses the powerful Texas DRV8833 dual motor driver can deliver 1.2 A per channel continuously (2 A peak) to a pair of DC motors. With an op..

R145.00 (Inc Tax: R166.75)

SparkFun Qwiic Motor Driver

SparkFun Qwiic Motor Driver

SparkFun Qwiic Motor Driver The SparkFun Qwiic Motor Driver takes all the great features of the Serial Controlled Motor Driver (SCMD) and miniaturizes them, adding Qwiic ports for plug and play fun..

R298.00 (Inc Tax: R342.70)

Tags: Dual h-bridge, h-bridge, motor, motor driver, driver l298N, dual, drivers