Arduino Practical Workshop: L298N Motor Driver Board

by ickey in Circuits > Arduino

5 Views, 0 Favorites, 0 Comments

Arduino Practical Workshop: L298N Motor Driver Board

图片9.png
图片1.png

【Arduino】168 types of sensor module experiments (data code + simulation programming + graphical programming)

Experiment : L298N motor driver board module DC stepper motor intelligent robot car module

The L298N is an H-bridge driver IC known for its higher output current and power handling compared to the L293D. It delivers up to 2A per channel and peaks at 4A, with a maximum operating voltage of 50V, making it ideal for driving inductive loads like high-power DC motors, stepper motors, and solenoids. Its input terminals can connect directly to a microcontroller, facilitating easy control. The L298N enables forward and reverse rotation of DC motors by changing the logic levels at its inputs and effectively controls stepper motors as well.

The L298N chip can drive two bipolar motors or one four-phase motor, with an output voltage of up to 50V adjustable via the power supply. It easily interfaces with a microcontroller's IO port and features a simple circuit design for ease of use.

The L298N can accept standard TTL logic level signals, with VSS handling voltages from 4.5V to 7V. Pin 4 (VS) connects to the power supply, supporting VIH between +2.5V and 46V. It delivers up to 2A output current, suitable for driving inductive loads. Pins 1 and 15 have separate emitter connections for current sensing resistors to create a sensing signal. The L298N can drive two motors, with OUT1-OUT2 and OUT3-OUT4 connected to them. In our experiment, we'll drive a single motor. Pins 5, 7, 10, and 12 manage input control levels for motor direction, while EnA and EnB connect to enable terminals to stop the motor.

图片2.png
图片3.png
图片4.png
图片5.png
图片6.png
图片7.png

L298N Characteristics

  1. Type: Half Bridge
  2. Input Type: Non-Inverting
  3. Number of Outputs: 4
  4. Current - Output / Channel: 2A
  5. Peak Output Current: 3A
  6.  Supply Voltage: 4.5V~46V
  7. Operating Temperature: -25°C~130°C
  8. Mounting Type: Through Hole
  9. Package / Case: MulTIwatt-15 (Vertical, Bent and Staggered Leads)
  10. Supplier Device Package: 15-MulTIwatt
  11. Packaging: Tube
  12. Device Model: L298N
  13. Manufacturer: STMicroelectronics
  14. Product Model: MotionMotorControl


图片8.png

Parameters of L298N Motor Driver Module

  1. Driver Chip: L298N Dual H-Bridge DC Motor Driver Chip
  2. Power Supply Range for the Driver Section Terminals Vs: +5V to +35V; If power supply is needed internally on the board, the power supply range is Vs: +7V to +35V
  3. Peak Current for the Driver Section Io: 2A
  4. Power Supply Range for the Logic Section Terminals Vss: +5V to +7V (can be supplied internally at +5V)
  5. Operating Current Range for the Logic Section: 0 to 36mA
  6. Control Signal Input Voltage Range: Low Level: -0.3V ≤ Vin ≤ 1.5V High Level: 2.3V ≤ Vin ≤ Vss
  7. Enable Signal Input Voltage Range: Low Level: -0.3V ≤ Vin ≤ 1.5V (control signal invalid) High Level: 2.3V ≤ Vin ≤ Vss (control signal valid)
  8. Maximum Power Consumption: 20W (temperature T = 75℃)


图片9.png

Schematic diagram of L298N motor driver board module


图片10.png

Product features

This module utilizes ST's L298N as the primary driver chip, known for its strong driving capability, low heat output, and high anti-interference properties. The 15-pin package supports up to 46V operating voltage, with a peak current of 3A and continuous current of 2A, rated at 25W. It includes two H-bridges capable of driving DC motors, stepper motors, relay coils, and other inductive loads using standard logic level signals. Two enable control terminals allow or disable operation without input signal interference. The logic power input allows low-voltage internal circuit operation and can connect to an external detection resistor for feedback. The chip can drive a two-phase or four-phase stepper motor and two DC motors. It operates from the drive power supply via the built-in 78M05, but if the drive voltage exceeds 12V, use an external 5V logic supply to protect the regulator. The module enhances reliability with large-capacity filter capacitors and freewheeling protection diodes..

图片11.png

Performance characteristics of L298N motor driver module:

1: Can achieve motor forward and reverse rotation as well as speed control.

2: Good starting performance with high starting torque.

3: Operating voltage can reach 36V, supporting up to 4A.

4: Capable of simultaneously driving two DC motors.

5: Suitable for applications in robot design and intelligent car design.


Scenario 1:In a circuit using the L298N to drive two DC geared motors, Pins A and B allow for PWM control. For straightforward robot motion, connect IN1, IN2 and IN3, IN4 to high and low levels, respectively. This setup requires only two microcontroller ports to output PWM signals to the enable terminals A and B, enabling actions such as moving straight, turning, accelerating, and decelerating.

Scenario 2: To control a two-phase stepper motor using the L298, connect IN1, IN2, and IN3, IN4 to specific microcontroller ports and output continuous pulse signals. The signal frequency sets the motor speed, while altering the sequence of winding pulse signals allows for bidirectional rotation.

图片12.png

Precautions:


  1. With a driving voltage of 7-12V (labeled as 12V input), you can use the onboard 5V logic supply. Do not apply voltage to the +5V input; however, you can use the 5V output externally. (This is the standard application!)
  2. For driving voltages over 12V and up to 24V (though the chip supports up to 35V, it's safer to cap at 24V), such as with an 18V motor, remove the jumper for the onboard 5V output. Connect an external 5V to the 5V output port; this acts as a control signal. The motor drive module will output current only when this signal is active and the power supply is normal. This powers the L298N's internal logic circuit. (This is a non-standard application for high-voltage driving!)
  3. If the 5V for the L298N comes from a different power source than the microcontroller, connect the microcontroller's GND to the module's GND to ensure a common reference point for logic signals. This step is crucial.


图片13.png

Product User Manual

  1. When the driving voltage is between 7V and 12V (labeled as 12V input), connect the 12V motor drive terminal to the power supply, and use the jumper cap to activate the onboard 78M05 chip for logic power. The indicator will light up, negating the need for an external logic supply. Do not input voltage to the +5V terminal; however, you can utilize the 5V output externally. (Standard application)
  2. For driving voltages over 12V up to 24V (though up to 35V is mentioned, 24V is conservative), such as with an 18V motor, remove the jumper enabling the onboard 5V output, turning off the indicator and ceasing use of the 78M05. Instead, supply 5V externally to the L298N's logic circuit via the 5V port. (Non-standard high-voltage application)
  3. The 5V enable signal is a control signal at 5V. When valid and power is normal, the module outputs current; otherwise, no current flows despite normal power.
  4. For PWM speed control, use the L298N enable terminal (active high, typically jumpered to VCC). Remove the jumper for PWM use, connect ENA and ENB to PWM signals, and set IN1, IN2, IN3, and IN4 to high or low to control motor direction or stop.


图片14.png

Wiring diagram for L298N motor driver module experiment


图片15.png

Experiment open source code


图片16.png

Experimental field diagram


图片17.png

Open-source graphical programming experiments (such as Mind+, Mixly, and EdBlocks).

图片18.png
图片19.png

TAG: L298N;Motor drive board;Design of electronic products