Motor speed control Using IBT-2 and Arduino

Motor speed control Using IBT-2 and Arduino

Motor speed control Using IBT-2 and Arduino
Motor speed control Using IBT-2 and Arduino project Final image

 

Motor speed control Using IBT-2 and Arduino

In this article we will learn how to make Motor speed control Using IBT2 and Arduino.

In the last post we will learn how to make MPU 6050 working specification circuit Arduino proteus Library. You can visit our website,
I hope you appreciate my work, let’s discuss about today’s project.

 

 

 

 

 

 

 

Table of Content:

1.    Components

2.    What is IBT-2

3.    Amazon Links

4.    How IBT-2 Works

5.    IBT-2 Pin out

6.    Circuit Connection

7.    Usages

8.    Programming Code

 

Components:

  1. Arduino Uno
  2. Battery (9V)
  3. Motor driver (IBT-2)
  4. DC motor
  5. Jumper wires

What is IBT-2 module?

The IBT-2 module is a type of dual-channel motor driver commonly used in robotics and electronics projects. It’s designed to control two DC motors bidirectional, allowing them to move forward, backward, or brake. This module can handle moderate currents and voltages, making it suitable for various applications where motor control is required, such as in small robots, RC vehicles, and other electromechanical systems. Its features often include PWM speed control, over current protection, and a straightforward interface for connecting to microcontrollers or other control systems.

How IBT-2 Works?

The IBT2 is a dual-channel H-bridge that can control the speed and direction of a DC motor.

Controlling motor speed using an IBT2 H-bridge motor driver and an Arduino is a common and straightforward project.

Amazon Links: 

Arduino Nano

Arduino UNO

IBT-2 motor Driver 

DC motor

Other Tools and Components: 

Super Starter kit for Beginners

Digital Oscilloscopes

Variable Supply

Digital Multimeter

Soldering iron kits

PCB small portable drill machines

IBT-2 motor Driver Pin out:

Motor speed control Using IBT-2 and Arduino
IBT-2 motor Driver Pin out Diagram

The IBT-2 motor driver is a popular dual-channel H-bridge motor driver often used to control DC motors or stepper motors.

Its Pinout typically includes the following:

IN1, IN2:

These pins control the direction of the first motor. By applying different logic levels (HIGH or LOW) to these pins, you control the motor’s rotation direction.

IN3, IN4:

Similar to IN1 and IN2, these pins control the direction of the second motor (if you’re using both channels).

ENR, ENL:

These pins are used to enable or disable the motor driver. Applying a PWM signal to these pins allows you to control the motor’s speed.

OUT1, OUT2:

Output terminals for the first motor. The motor connections are made here.

OUT3, OUT4:

Output terminals for the Power Supply.

Circuit Connection:

  • Connect –ve terminal of Battery with B- terminal of IBT-2 Driver
  • Connect +ve terminal of Battery with B+ terminal of IBT-2 Driver
  • Connect –ve terminal of DC motor with M- terminal of IBT-2 Driver
  • Connect +ve terminal of DC motor with M+ terminal of IBT-2 Driver
  • Connect VCC pin of IBT-2 motor Driver with the VCC pin of the Arduino
  • Connect GND pin of IBT-2 motor Driver with the GND pin of Arduino
  • Connect TX pin of Arduino with the R-IS pin of IBT-2 Driver
  • Connect pin 2 of Arduino with the R-EN pin of IBT-2 Driver
  • Connect pin 3 of Arduino with the pin RPWM pin of IBT-2 Driver
  • Connect pin 4 of Arduino with the pin L-IS of IBT-2 Driver
  • Connect pin 5 of Arduino with the pin L-EN of IBT-2 motor Driver
  • Connect pin 6 of Arduino with the pin LPWM of IBT-2 Driver

Circuit Diagram:

Motor speed control Using IBT-2 and Arduino
Motor speed control Using IBT-2 and Arduino circuit Diagram

Usage of IBT-2…

The IBT2 motor driver is a popular dual H-bridge motor driver module often used in robotics and electronics projects.

Here are some common applications where the IBT2 motor driver can be use.

  1. Robotic Projects

IBT-2 is utilized for controlling motors in various robotic platforms, including wheeled robots, robotic arms, and drones.

It’s employed in building motorized vehicles like RC cars, tanks, or other remote-controlled machines.

  1. Automation Systems

It can be used into home automation systems to control various mechanisms like door locks, curtains, or window shutters.

It’s also can be Used in conveyor belt systems, automated machinery, and production lines.

  1. Educational Projects

It’s a popular choice in educational projects, teaching students about motor control and basic robotics principles.

  1. Prototyping

Engineers and developers use IBT-2 for prototyping and testing motor control in their projects before integrating more complex motor drivers.

Programming Code:

[dt_code]

// BTS7960 motor driver sketch

 

int R_IS = 1;

int R_EN = 2;

int R_PWM = 3;

int L_IS = 4;

int L_EN = 5;

int L_PWM = 6;

 

int buttonForward = 8; // Digital pin for the forward button

int buttonBackward = 9; // Digital pin for the backward button

 

void setup() {

// put your setup code here, to run once:

pinMode(R_IS, OUTPUT);

pinMode(R_EN, OUTPUT);

pinMode(R_PWM, OUTPUT);

pinMode(L_IS, OUTPUT);

pinMode(L_EN, OUTPUT);

pinMode(L_PWM, OUTPUT);

 

pinMode(buttonForward, INPUT_PULLUP); // Enable internal pull-up resistor

pinMode(buttonBackward, INPUT_PULLUP); // Enable internal pull-up resistor

 

digitalWrite(R_IS, LOW);

digitalWrite(L_IS, LOW);

digitalWrite(R_EN, HIGH);

digitalWrite(L_EN, HIGH);

}

 

void loop() {

// put your main code here, to run repeatedly:

 

// Read the state of the forward button

int forwardState = digitalRead(buttonForward);

 

// Read the state of the backward button

int backwardState = digitalRead(buttonBackward);

 

// Check the state of the forward button

if (forwardState == LOW && backwardState == HIGH) {

motorControl(255, 0); // Move forward at full speed

}

// Check the state of the backward button

else if (backwardState == LOW && forwardState == HIGH) {

motorControl(0, 255); // Move backward at full speed

}

// Stop the motors if no button is pressed

else {

motorControl(0, 0);

}

}

 

// Function to control the motors based on PWM values

void motorControl(int pwmR, int pwmL) {

analogWrite(R_PWM, pwmR);

analogWrite(L_PWM, pwmL);

delay(500);

}

[/dt_code]