The direction that the motors turn is controlled using the IN1, IN2, IN3 and IN4 input pins on the motor driver board. We recommend always using a PWM duty cycle of 90% or less. The longer the PWM duty cycle is, the faster the motor will turn. By using PWM, you are turning power on and off very quickly to adjust the speed of the motor. When these pins are HIGH, power is output to the motor. The ENA pin controls Motor A and the ENB pin controls Motor B. The speed of the motors can be adjusted by connecting PWM outputs from your robot’s microcontroller to the ENA and ENB input pins on the motor driver board. Leave the jumper connected when not using current sense. To use the current sense feature, remove the jumpers and attach to the header pins. Note: The CSA and CSB current sense feature is disabled when the jumpers are present. Header pin assignmentsĮnable Motor A input pin IN2 pull-up resistor (10K)Įnable Motor B input pin IN3 pull-up resistor (10K)Įnable Motor B input pin IN4 pull-up resistor (10K) Do not enable the onboard 5V regulator if you are supplying more than 16V to motors on pin 3 or the regulator will burn out. Otherwise you must input 5V regulated power at pin 5 so that the circuit can operate properly. Note that the 5V regulated power on pin 5 above is an output when the 5V_EN jumper is in place. Hardware Details Screw terminal pin assignments As you can see the diagram below, Red, Green, Yellow, and Blue are connected into the l298n board pin. Place the jumper included with the L298n Module over the pin. Connect the A+,A-, B+ and B- wires from the stepper motor to the module connection OUT 1, OUT 2, OUT3, and OUT4 or A1, A2, B3, and B4. The stepper motor has 200 steps per revolution and can operate at 60RPM.
In this example we will going to use the 14HM Series 2 Phase Hybrid Stepper Motor
if you want to learn more about Stepper Motor download the reference below. This characteristic makes it very suitable for digital interfaces integrates with a microcontroller. Since the stepper motor does move in discreet movement, we can say that a stepper motor is actually a digital motor. In the example below you may notice that there are 4 distinct steps for the rotor to make a complete 360 degree rotation. The stepper motor moves is distinct steps during its rotation.
How to control a Stepper Motor with L298n Modules.Ī digital electric motor that moves one step at a time and each step is defined by a step angle. All of this devices are same functions and features. There are many model of l298n boards in the market, see the photo below for examples.
It can also be interfaced with simple manual switches, TTL Logic gates and relays. It is excellent for robotics applications and well fit to a microcontroller. This module has ease to connect and drive a dc motor or stepper motor allows you to easily and intently control two motor up to 2A each in both direction or one stepper motor. Additional supply input is provided so that the logic works at lower voltage. The emitters of the lower transistors of each bridge are connected together and the corresponding external terminal can be use for the connection of external sensing resistor. Two enabled inputs are provided to enable or disable the device independently of the input signals.
It is a high voltage and high current full dual bridge driver designed to accept standard TTL logic level and drive inductive loads such as relays, solenoids and DC stepper motor. The l298 is an integrated monolithic circuit in a 15 lead multi-watt and power S020 package. So far as how to place the stepper wires, if you trust your ‘sketch’ then just swap them around till it starts rotating jack-rigging it like that won’t take it down.The L298 Dubai H Bridge is base on l298 Chip manufacture by ST Semiconductor. The motor supply is called V S, just to keep things confusing. The L298’s “logic supply” (the 5V) is called, by them and absurdly, V SS. If you’re supplying 5V, from an external source, I suppose that that should be pulled out. The placement of “5V Enable” shunt isn’t shown on the ebay schematic. Voltage in the interface +5V power supply, but you can lead the 5V for external use. It can enable the onboard 5V logic power supply after the power supply, don’t input This module is integrated with a built-in 5V power. But to avoid the damage of the voltage stabilizing chip, please use an external 5V logic supply when using more than 12V driving voltage. Chip_Partner makes two contradictory statements in his ebay presentation:Ģ.This module can use built-in 78M05 for electric work via a driving power supply part.