Control H Bidge Gear Motor Control [P003]



https://www.youtube.com/watch?v=BvaAhAsRyBo


*GitHubhttps://github.com/rdiot/rdiot-p003.git


* Parts

- Arduino Uno R3

- L298N Dual Motor Driver H Bridge (L298N) [B005]

- TT Motor Car Gear Motor [S142]

 

 

* Contents

- Connect

ENA ----- D9

IN1 ----- D2

IN2 ----- D3

ENB ----- D10

IN3 ----- D4

IN4 ----- D5


- Key Code

int dir1PinA = 2;

int dir2PinA = 3;


int dir1PinB = 4;

int dir2PinB = 5;


int speedPinA = 9;

int speedPinB = 10;


int speed1;

int dir;


void setup()

{


  pinMode(dir1PinA,OUTPUT); // IN1

  pinMode(dir2PinA,OUTPUT); // IN2

  pinMode(speedPinA,OUTPUT); // ENA


  pinMode(dir1PinB,OUTPUT); // IN3

  pinMode(dir2PinB,OUTPUT); // IN4

  pinMode(speedPinB,OUTPUT); // ENB


  speed1 = 200;

  dir = 1;


  delay(1000);


}


void loop()

{


  //analogWrite(speedPinA, speed1); // 200 -> ENA 

  if(dir == 1)

  {

    digitalWrite(speedPinA, HIGH);

    digitalWrite(speedPinB, HIGH);

    

    digitalWrite(dir1PinA, LOW);

    digitalWrite(dir2PinA, HIGH);


    digitalWrite(dir1PinB, LOW);

    digitalWrite(dir2PinB, HIGH);

    

    delay(5000);


    digitalWrite(speedPinA, HIGH);

    digitalWrite(speedPinB, HIGH);

    

    digitalWrite(dir1PinA, HIGH);

    digitalWrite(dir2PinA, LOW);

    

    digitalWrite(dir1PinB, HIGH);

    digitalWrite(dir2PinB, LOW);

    

    delay(5000);


  }

}

Posted by RDIoT
|

L298N Dual Motor Driver H Bridge (L298N) [B005]



https://www.youtube.com/watch?v=ZqJwD5tuFbE


* GitHubhttps://github.com/rdiot/rdiot-b005.git

* Specs

Description:

Using L298N as the control chip,the module has such characteristics as strong driving ability,low calorific value and strong anti-interference ability. This module can use built-in 78M05 for electric work via a driving power supply part. But to avoid the damage of the voltage stabilizing chip, please use an external 5V logic supply when using more than 12V driving voltage. Using large capacity filter capacitor, this module can follow current to protect diodes,and improve the reliability.


Feature:

L298N Double H Bridge Motor Driver Module Control chip: L298N Logical voltage: 5V Drive voltage: 5V - 35V Logical current: 0mA - 36mA Drive current: 2A(MAX single bridge) Storage temperature: -20°C to +135°C Max power: 25W Size: 43 x 43 x 27mm


* Contents

- Connect

12V ------ 9V VCC

GND ----- 9V GND, Arduino GND

5V ----- Arduino 5V


ENA ----- D9

IN1 ----- D2

IN2 ----- D3


OUT1 ----- Motor +

OUT2 ----- Motor -


- Key Code 

#include <Wire.h> 

#include <LiquidCrystal_I2C.h>


LiquidCrystal_I2C lcd(0x27,20,4);  // LCD2004


int dir1PinA = 2;

int dir2PinA = 3;

int speedPinA = 9;

int speed1;

int dir;


void setup()

{

  lcd.init();  // initialize the lcd 

  lcd.backlight();

  lcd.print("start LCD2004");


  pinMode(dir1PinA,OUTPUT); // IN1

  pinMode(dir2PinA,OUTPUT); // IN2

  pinMode(speedPinA,OUTPUT); // ENA

  speed1 = 200;

  dir = 1;


  delay(1000);


  lcd.clear();

}


void loop()

{

 

  lcd.setCursor(0,0);

  lcd.print("B005:L298N Driver");


  //analogWrite(speedPinA, speed1); // 200 -> ENA 

  if(dir == 1)

  {

    digitalWrite(speedPinA, HIGH);

    digitalWrite(dir1PinA, LOW);

    digitalWrite(dir2PinA, HIGH);

    lcd.setCursor(0,1);

    lcd.print("ENA=" + (String)speedPinA + " HIGH");   

    lcd.setCursor(0,2);

    lcd.print("IN1=" + (String)dir1PinA + " LOW ");

    lcd.setCursor(0,3);

    lcd.print("IN2=" + (String)dir2PinA + " HIGH ");

    delay(5000);


    digitalWrite(speedPinA, HIGH);

    digitalWrite(dir1PinA, HIGH);

    digitalWrite(dir2PinA, LOW);

    lcd.setCursor(0,1);

    lcd.print("ENA=" + (String)speedPinA + " HIGH");   

    lcd.setCursor(0,2);

    lcd.print("IN1=" + (String)dir1PinA + " HIGH ");

    lcd.setCursor(0,3);

    lcd.print("IN2=" + (String)dir2PinA + " LOW ");

    delay(5000);


    digitalWrite(speedPinA, LOW);

    lcd.setCursor(0,1);

    lcd.print("ENA=" + (String)speedPinA + " LOW ");   

    

    lcd.setCursor(0,2);

    lcd.print("IN1= STOP  ");   

  

    lcd.setCursor(0,3);

    lcd.print("IN2= STOP  ");   


    dir = 0;

  }

}



Posted by RDIoT
|

6~28V 3A Motor Speed Controller [B056]



https://www.youtube.com/watch?v=hdwnlHRdqRk


* Specs

This DC Motor Speed Controller allows controlling the direction of a DC motor using a Pulse-Width-Modulated (PWM) DC voltage with a Duty Cycle fully adjustable from 0%-100%. 

The motor speed controller can easily provide a continuous current of3A to your DC motor or other DC load. 

Main technical parameters: 

Input supply voltage:6V-28VDC 

The maximum output power: 80W 

The maximum continuous output current :3A 

Duty Cycle adjustable:0%-100% 


Operating instruction: 

1. Connect your DC motor (or DC load) to the motor terminals as indicated on the wiring diagram. 

2. Connect a voltage of 10V-36V DC to the circuit making sure of the correct polarity of the connection. Note that the voltage applied to the motor will be supply voltage applied to the circuit. It is recommended to add an appropriately rated fuse inline with the positive supply in order to protect the circuit from any possible short circuits. 

3. You can now control the speed of the motor through potentiometer.

Posted by RDIoT
|