You are currently viewing L298 Motor-Controller using TFT display

L298 Motor-Controller using TFT display

Description

In electronics projects, creating an interface between user and system is very important. This interface could be created by displaying useful data, a menu, and ease of access. A beautiful design is also very important. There are several components to achieve this like TFT Displays. For more information Click Here.

Create your own GUI by just visiting STONE Technologies in an instance and Click Here.

TFT LCD is a variant of a liquid-crystal display (LCD) that uses thin-film-transistor (TFT) technology to improve image qualities such as addressability and contrast. This can be achieved by TFT display provided by STONE Technologies. They are a professional manufacturer of HMI (Human-Machine Interface) Intelligent TFT LCD module. Their core TFT LCD display modules integrate a CPU, flash memory, and touch screen in the hardware unit. Paired with an easy-to-use free GUI design software and complete instruction set for more click here.

For building and owning the same same components used in the project visit Stone Technologies.

Contents

1.Description

2.Circuit Diagram

3. Working

4. Code

5. Video

Circuit Diagram

Working

About L298N driver motor :-

This L298N Motor Driver Module is a high power motor driver module for driving DC and Stepper Motors. This module consists of an L298 motor driver IC and a 78M05 5V regulator. L298N Module can control up to 4 DC motors, or 2 DC motors with directional and speed control.

About the project :-

The L298N Motor Driver is a controller that uses an H-Bridge to easily control the direction and speed of up to 2 DC motors.  The controller can take up to 2 motors. Plug one motor into the terminal labelled OUT1 and OUT2. Plug the second motor into the terminal labelled OUT3 and OUT4. The row of pins on the bottom right of the L298N control the speed and direction of the motors. IN1 and IN2 control the direction of the motor connected to OUT1 and OUT2. IN3 and IN4 control the direction of the motor connected to OUT3 and OUT4. Here pins are into pins 2, 3, 4, and 5 on the Arduino. You can power the L298N with up to 12V by plugging your power source into the pin on the L298N labelled “12V”. The pin labelled “5V” is a 5V output that you can use to power your Arduino.

The TFT display can be mounted on the breadboard using the connection diagram above.

For GUI purpose please scroll above for reference or Click Here. All the component used in the project are available please click Here

For a detailed overview and attached documents like code, Component, and video Click Here.

Code

#include <SoftwareSerial.h>
SoftwareSerial max232(2,3);
 
char data; 
String mystring;
 
int l1 = 9; 
int l2 = 10; 
int l3 = 11; 
 
void setup()
{
Serial.begin(115200);
max232.begin(115200);
pinMode(l1, OUTPUT);
digitalWrite(l1, LOW); 

pinMode(l2, OUTPUT);
digitalWrite(l2, LOW);

pinMode(l3, OUTPUT);
digitalWrite(l3, LOW);
}
 
 
void loop()
 
{
 
if (max232.available()>0)
{
data = max232.read();
mystring = mystring + byte(data) ; 
delay(10);
}
/////////////////////
if (mystring.endsWith("101"))
  {
  mystring = ""; 
  analogWrite(l1,90);
  }
if (mystring.endsWith("102"))
  {
  mystring = ""; 
  analogWrite(l1,150);
  }
if (mystring.endsWith("103"))
  {
  mystring = ""; 
  analogWrite(l1,200);
  }

if (mystring.endsWith("104"))
  {
  mystring = ""; 
  analogWrite(l1,240);
  }
  ////////////////////////////
if (mystring.endsWith("105"))
  {
  mystring = ""; 
  digitalWrite(l3,HIGH);
  digitalWrite(l2,LOW);
  }
if (mystring.endsWith("106"))
  {
  mystring = ""; 
  digitalWrite(l2,HIGH);
  digitalWrite(l3,LOW);
  }






  
}

Video

For any doubts please comment and visit Stone Technologies for buying such exciting components.