OpenSmart

Stepper Motor Controller Module

Item No.: ST1112


1. Introduction

    Double H driver module uses ST L298N dual full-bridge driver, an integrated monolithic circuit in a 15- lead Multiwatt and PowerSO20 packages. It is a high voltage, high current dual full-bridge driver designed to accept standard TTL logic levels and drive inductive loads such as relays, solenoids, DC and stepping motors. Two enable inputs are provided to enable or disable the device independently of the input signals. The emitters of the lower transistors of each bridge are connected together and the corresponding external terminal can be used for the con-nection of an external sensing resistor. An additional supply input is provided so that the logic works at a lower voltage.

 Specification:

·         Driver: L298N

·         Driver power supply: +5V~+35V

·         Driver Io: 2A

·         Logic power output Vss: +5~+7V (internal supply +5V)

·         Logic current: 0~36mA

·         Controlling level: Low -0.3V~1.5V, high: 2.3V~Vss

·         Enable signal level: Low -0.3V~1.5V, high: 2.3V~Vss

·         Max power: 25W (Temperature 75 cesus)

·         Working temperature: -25C~+130C

2. Pin Instruction



3. Example

  This module can drive 2 channel DC motor or 2 phase stepper motor.


For 2 channel DC motor, connection and code as below:

Connection:

      IN1==========13;

      IN2==========12;

      IN3==========11;

      IN4==========10;

int in1=13;
int in2=12;
int in3=11;
int in4=10;

int speedPinA=6;
int speedPinB=5;

void setup()
{
  pinMode(in1,OUTPUT);
  pinMode(in2,OUTPUT);
  pinMode(in3,OUTPUT);
  pinMode(in4,OUTPUT);
  
  digitalWrite(in1,HIGH);
  digitalWrite(in2,HIGH);
  digitalWrite(in3,HIGH);
  digitalWrite(in4,HIGH);
}
void loop()
{

  _mRight(in1,in2);
  _mRight(in3,in4);

  int n=analogRead(A0)/4;
  _mSetSpeed(speedPinA,n);
  _mSetSpeed(speedPinB,n);
}
void _mRight(int pin1,int pin2)
{
  digitalWrite(pin1,HIGH);
  digitalWrite(pin2,LOW);
}
void _mLeft(int pin1,int pin2)
{
  digitalWrite(pin1,LOW);
  digitalWrite(pin2,HIGH);
}
void _mStop(int pin1,int pin2)
{
  digitalWrite(pin1,HIGH);
  digitalWrite(pin2,HIGH);
}
void _mSetSpeed(int pinPWM,int SpeedValue
{
  analogWrite(pinPWM,SpeedValue);
}



For 2 phase stepper motor the connection and code as below:


Connection:

       IN1=======8;

       IN2=======9;

       IN3=======10;

       IN4=======11;

#include 
 
#define STEPS 100
 
Stepper stepper(STEPS, 8, 9, 10, 11);
 
int previous = 0;
 
void setup()
{
  stepper.setSpeed(90);
}
 
void loop()
{
  int val = analogRead(0);
  stepper.step(val - previous);
   previous = val;
}





2018-10-16 21:19:49

_mSetSpeed?

Comment