top of page

L298N Info sheet

L298n.jpg

The L298N Motor Driver is a controller that uses an H-Bridge to easily control the direction and speed of up to 2 DC motors. This tutorial will show you how to use it.

1.

The controller can take up to 2 motors. Plug one motor into the terminal labelled OUT1 and OUT2. Plug the second motor into the terminal labelled OUT3 and OUT4:

L298n Motors.png

2.

The row of pins on the bottom right of the L298N control the speed and direction of the motors. IN1 and IN2 control the direction of the motor connected to OUT1 and OUT2. IN3 and IN4 control the direction of the motor connected to OUT3 and OUT4. Here I plugged them into pins 6, 9, 10, and 11 on the Arduino.

ARDUINO controller pins.png

Pin6------In4

Pin9------In3

Pin10----In2

Pin11----In1

}

}

MOTOR A

MOTOR B

ArduinoConnections

3.

You can power the L298N with up to 12V by plugging your power source into the pin on the L298N labelled "12V". The pin labelled "5V" is a 5V output that you can use to power your Arduino. Here are some ways to wire it depending on your use case:

a.

Wire this way if you are going to power the Arduino off of the battery that the L298 module is connected to.

vin ARDUINO.png

b.

Wire this way if you are going to power the Arduino off of its own power source.

Gnd ONLY ARDUINO.png
PowerConnections

4.

Software:

Github_edited.png

Setting IN1 to 255, and IN2 to 0, will cause the left motor to turn a direction.

Setting IN1 to 0, and IN2 to 255, will cause the left motor to spin the other direction. The same applies to IN3 and IN4.

Speed:

You can change the speed by choosing a number 0-255, anywhere 255, is located in the code.

Code

More Info coming soon!

bottom of page