モータドライバ【MX1508】の使い方

データーシート

モータドライバ【MX1508】の使い方

外観

概要

MX1508はHブリッジが2つ入ったDCモータドライバ。簡単にDCモーターを2台動かすことができます。入力端子にPWMを入れることにより速度調節が可能。加熱保護回路付き。

性能

  • 動作電圧: DC 2-10V
  • 信号入力電圧: DC 1.8-7V
  • 単一動作電流: 1.5A
  • ピーク電流: 2.5A
  • スタンバイ電流: (less than 0.1uA)
  • Built-in common conduction circuit, the input terminal vacant, the motor does not malfunction
  • Size: 24.7 x 21 x 7mm
  • Mounting hole diameter: 2 mm

ピン配置

ライブラリ

GitHub - Saeterncj/MX1508: Arduino library for MX1508 dual DC motor driver
Arduino library for MX1508 dual DC motor driver. Contribute to Saeterncj/MX1508 development by creating an account on GitHub.

回路図

引用 KKHMF商品ページより

プログラミング例

ライブラリを使用する場合
#include <MX1508.h>

#define PINA 9
#define PINB 10
#define NUMPWM 2
#define PWM 100

/*
 * MX1508(uint8_t pinIN1, uint8_t pinIN2, DecayMode decayMode, NumOfPwmPins numPWM);
 * DecayMode must be FAST_DECAY or SLOW_DECAY,
 * NumOfPwmPins, either use 1 or 2 pwm. 
 * I recommend using 2 pwm pins per motor so spinning motor forward and backward gives similar response.
 * if using 1 pwm pin, make sure its pinIN1, then set pinIN2 to any digital pin. I dont recommend this setting because 
 * we need to use FAST_DECAY in one direction and SLOW_DECAY for the other direction.  
 */
 
MX1508 motorA(PINA,PINB, FAST_DECAY, NUMPWM);

void setup() {}

void loop() {
    motorA.motorGo(PWM);
}
ライブラリを使用しない場合
/*
  MX1508 DC MOTOR DRIVER MODULE
  modified on 25 Sep 2020
  by Saeed Olfat @ Electropeak
  Home
*/

void setup() {
  pinMode(8, OUTPUT); //IN2
  pinMode(9, OUTPUT); //IN1
}
void loop() {

// Full speed forward
  digitalWrite(8, HIGH);
  digitalWrite(9, LOW);


  delay(3000);

// Full speed backward
  digitalWrite(8, LOW);
  digitalWrite(9, HIGH);

  delay(3000);

// 0 to 100% speed in forward mode
  for (int i=0;i<256;i++)
  {   digitalWrite(8, HIGH);
      analogWrite(9, i);
      delay(20);      
      }

  delay(50);

  // 0 to 100% speed in backward mode
        for (int i=255;i<0;i--)
  {   digitalWrite(8, LOW);
      analogWrite(9, i);
      delay(20);      
      }

        delay(50);
}

引用 ElectroPeak

商品リンク

KKHMF 3個 2チャンネル直流モータードライブモジュール プラスとマイナスの回転 ダブルHブリッジステッピングモータミニドライブボード
KKHMF 3個 2チャンネル直流モータードライブモジュール プラスとマイナスの回転 ダブルHブリッジステッピングモータミニドライブボード

Fritzingのパーツ

見つかりませんでした。

タイトルとURLをコピーしました