You are currently viewing LED brightness controller  using TFT display

LED brightness 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.

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.

There is a model which I have used in this project you can check all the detail about this 5” TFT Display Check it now

Contents

1.Description

2.Circuit Diagram

3. Working

4. Code

5. Video

Circuit Diagram

Working

Firstly we design a graphical user interface using the images designed by your software like (Photoshop, etc.). Here we can learn how to use the button function, data variable function, Hardware parameter function and how to use the Drag adjustment, and Slider Scale function for controlling the screen brightness. The details of the GUI will be later shared in another post . For more information related to the GUI (Click Here). Stone technologies makes this task very easy and smooth.

This Intelligent TFT touchscreen module ( Click Here) using the UART Serial communication. Readers can get more information about how to form project using stone hmi display (Click).

In this the LED is controlled using the HMI TFT LCD Display Module and Arduino Uno. The control commands are sent serially from the HMI Touchscreen display Module through the max232 board to the Arduino. The Arduino then Turns ON and Turns OFF the desired LED depending on the command. Using the slider you can change the intensity of the LED as shown in the project.

For details regarding the project working (Click Here).

Code

include

SoftwareSerial max232(2,3);

define Sensor1_H 0x00

define Sensor1_L 0x86

define Sensor2_H 0x00

define Sensor2_L 0x96

String mystring;

int load1 = 4;
int load1f = 0;

unsigned char sensor1_send[8]= {0xA5, 0x5A, 0x05, 0x82, Sensor1_H, Sensor1_L, 0x00, 0x00};
unsigned char sensor2_send[8]= {0xA5, 0x5A, 0x05, 0x82, Sensor2_H, Sensor2_L, 0x00, 0x00};

void setup()

{

Serial.begin(115200);
max232.begin(115200);
pinMode(9,OUTPUT);
pinMode(load1, OUTPUT);
digitalWrite(load1, LOW);
digitalWrite(9, LOW);
}

void loop()

{
int val,x;

if (max232.available()>0)
{
x=max232.read();
mystring = mystring + byte(x) ;
Serial.println(x);
}
val = map(x, 0, 255, 0, 255);

analogWrite(9, val);
if (max232.available()==49)
{
digitalWrite(10,HIGH);
}

if (max232.available()==48)
{
digitalWrite(10,HIGH);
}

if (max232.available() == 0)
{
//Serial.println(mystring);

load1control();

mystring = “”;
}
}

void load1control()
{

if (mystring.endsWith(“101”)&& (load1f == 0))
{
mystring = “”;
if(digitalRead(load1) == LOW)
{

digitalWrite(load1,HIGH);
Serial.println(“load1 High”);
}
load1f = 1;
}

if (mystring.endsWith(“101”) && (load1f == 1))
{
mystring = “”;
if(digitalRead(load1) == HIGH)
{
digitalWrite(load1,LOW);
Serial.println(“load1 LOW”);
}
load1f = 0;
}

}

This is the code for the project below is the video representation for better understanding.

Video representing the project.

For more such articles visit electrocircuit.net and comment below your queries.

If you have any question about the product details and any doubt in gui software you can visit forum of Stone-hmi click here