Series: Tried Using Touch Panel TFT Display GT-SP with Arduino

How to Display Data Using GT-SP Graph – Part 4

How to Display Data Using GT-SP Graph – Part 4

DownloadDownload sample project & program (for GT Design Studio & Arduino)

Hello everyone, I’m @kissaten, a beginner in electronics. In this series, I’m explaining the process of connecting a 7-inch touch display (GT-SP series “GTWV070S3A00P”) to an Arduino and working on various projects.

In this installment, we’ll use a potentiometer (variable resistor) to change the graph displayed on the GT-SP screen in real-time.

Graph Used in This Project

For this project, we’ll use the following graph type:

  • BAR_STACK

Set Style > Chart Item Count to “1”.

In the Setting tab, set Max. Range to 1023, which matches the upper limit of the potentiometer reading.

In the Setting tab, set Max. Range to 1023, which matches the upper limit of the potentiometer reading.

 

Connecting the Potentiometer

A potentiometer is a type of variable resistor whose resistance changes based on rotation or sliding movement. It allows voltage control and can be used to influence signals in an electronic circuit.

By connecting it to an Arduino, we can easily read analog signals and use those values to control other devices or systems.

In this project, we connected the OUTPUT pin of the potentiometer to A1 on the Arduino.
We also connected the VCC and GND pins appropriately.

Picture by [Fritzing (CC BY-SA)]

 

When you rotate the potentiometer, the Arduino reads values between 0 and 1023.
These values are then sent via serial communication to the GT-SP display and visualized as a graph on the screen.

By default, the potentiometer we used increases its value when rotated to the left.
To make the operation more intuitive, we inverted the value in the Arduino code so that the value increases when turned to the right.

Arduino Program

When a potentiometer is connected to pin A1 of the Arduino Uno, you can use analogRead() to get values between 0 and 1023.
We then send those values to the GT-SP display using Serial.print() for communication.

Here’s the actual code:

DownloadDownload sample project & program (for GT Design Studio & Arduino)

In this program, analogRead() reads the voltage from the potentiometer.
We use the map() function to convert the value to a percentage (0–100), and then send it to the graph component using gtsp_ObjPrpSet_val().

The 0x40 here must match the component ID assigned to the graph part in GT Design Studio.

By turning the potentiometer, you’ll see the height of the graph change in real time.

Summary

In this project, we created a simple system to visualize potentiometer values in real time using Arduino and the GT-SP display.

In the next article, we’ll use a temperature sensor to create a graph that logs temperature changes over time.

 

 

Series: Tried Using Touch Panel TFT Display GT-SP with Arduino

Series: Tried Using Touch Panel TFT Display GT-SP with Arduino