1,8 TFT Display EN
1,8 TFT Display EN
1,8 TFT Display EN
1
Table of Contents
Introduction 3
Specifications 4
Overview: 5
PIN function : 5
How does the 1.8 Inch Color TFT Display work? 6
1.8 Inch Color TFT Display Module Applications: 7
How to Use the Display Module ? 8
The Circuit wiring 10
Software installation 11
Library installation 16
Arduino Code 17
Setting up the Raspberry Pi and Python 19
Circuit Connection 20
Enable SPI 21
Library Installation 21
Python Example 22
2
Introduction
Thank you for purchasing Our AZ-Delivery 1.8 inch Spi TFT Display 128 x 160
pixels. The 1.8 Inch Color TFT Display Module is a small electronic component
that displays images and text in color. This lovely little display breakout is the
best way to add a small, colorful, and very bright display to any project. Since
the display uses 4-wire SPI to communicate and has its own pixel-addressable
frame buffer, it can be used with every kind of microcontroller. Even a very
small one with low memory and few pins available, The 1.8" display has
128x160 18-bit full color pixels and is driven by the ST7735 display controller.
On the following pages, we will introduce you to how to use and how to set-up
this handy device.
3
Specifications
IC Chip ST7735
Display area 32 x 38 mm
4
Overview:
PIN function :
PIN Description function
GND Ground
A0 Data/Command selection
5
How does the 1.8 Inch Color TFT Display work?
The 1.8 Inch Color TFT Display Module is a small electronic component that
displays images and text in color. It typically consists of a display panel, a driver
circuit, and a backlight system.
The display panel is made up of a thin film transistor (TFT) array, which controls
the color and brightness of each pixel on the screen. Each pixel is composed of
three sub-pixels, typically colored red, green, and blue (RGB), which combine to
produce a full-color image.
The backlight system is used to illuminate the display panel, allowing the
images and text to be visible. The backlight is typically made up of a series of
light-emitting diodes (LEDs) placed around the perimeter of the display panel.
To use the 1.8 Inch Color TFT Display Module, a microcontroller or other device
sends data to the driver circuit, which translates the data into signals that can
be understood by the display panel. The driver circuit then controls the refresh
rate and timing of the display, updating the image or text on the screen as
needed. The backlight system provides illumination, allowing the display to be
seen in various lighting conditions.
6
1.8 Inch Color TFT Display Module Applications:
The 1.8 Inch Color TFT Display Module has a wide range of applications, thanks
to its compact size, high resolution, and colorful display capabilities. Here are
some examples of its common applications:
7
How to Use the Display Module ?
The uses of this module are very simple. In this section of this article, we will
discuss how we can hook up a module and work with it, so first of all we need
a setup which described below:
Setup for Development environment, we need :
-Microcontroller board
8
-1.8 Inch Color TFT Display Module:
-Jumper Wire:
9
The Circuit wiring
connections:
Display Module Arduino
LED 3.3V
SCK Digital Pin 13
SDA Digital Pin 11
A0 Digital Pin 9
RESET Digital Pin 8
CS Digital Pin 10
GND GND
VCC 5V
10
Software installation
Download the latest version of Arduino IDE here:
https://www.arduino.cc/en/software
11
In the next step, different options can be selected for installation.
12
After successful installation, the installation programme can be terminated
via the "Finish" button.
13
The starting window:
14
Select the UNO Board:
15
Library installation
here are the steps to install the ST7735 library from the Arduino Library
Manager:
1 - Click on the "Sketch" menu and select "Include Library" -> "Manage
Libraries".
3- In the Library Manager, search for "Adafruit ST7735" using the search bar at
the top of the window.
4- Select the Adafruit ST7735 and ST7789 library from the search results.
5- Click the "Install ALL" button to install the library.
6- Wait for the installation to complete.
7- When the installation is finished, you should see a message indicating that
the library was successfully installed in the bottom console.
16
Arduino Code
#define TFT_CS 10
#define TFT_RST 8
#define TFT_DC 9
tft.fillScreen(ST77XX_BLACK);
drawtext("Hello! from \n AZ-delivery", ST77XX_RED);
delay(1000);
fillScreenBlink(ST77XX_WHITE, ST77XX_RED);
delay(500);
Serial.println("done");
delay(1000);
}
void loop() {
tft.invertDisplay(true);
delay(500);
tft.invertDisplay(false);
delay(500);
}
17
tft.setCursor(0, 50);
tft.setTextColor(color);
tft.setTextSize(2);
tft.setTextWrap(true);
tft.print(text);
}
void fillScreenBlink(uint16_t color1, uint16_t color2) {
tft.fillScreen(color1);
delay(1000);
tft.fillScreen(color2);
}
This code sets up The necessary libraries for graphics and hardware-specific
functions are included at the beginning of the code.
The pins used to communicate with the display (TFT_CS, TFT_RST, TFT_DC) are
defined, and an instance of the Adafruit_ST7735 class is created using these
pins.
The setup() function initializes the serial communication and the display, clears
the screen with black color, and prints "hello from AZ-DELIVERY" in red color
using the drawtext() function, after that screen will blink in white and red.
The loop() function repeatedly inverts the display with a delay of 500ms,
creating a blinking effect.
The drawtext() function sets the cursor position to (0,0) and prints the input
string in the specified color.
18
Setting up the Raspberry Pi and Python
For the Raspberry Pi, the operating system must first be installed, then
everything must be set up so that it can be used in headless mode. Headless
mode allows remote connection to the Raspberry Pi without the need for a PC
screen monitor, mouse or keyboard. The only things used in this mode are the
Raspberry Pi itself, power supply and internet connection. All this is explained
in detail in the free eBook:
19
Circuit Connection
connections:
Display Module Raspberry
VCC 3.3V
GND GND
CS GPIO 8 - CE0
RESET GPIO 24
A0 GPIO 25
SDA GPIO 10
LED 3.3 V
20
Enable SPI
sudo raspi-config
Choose Interfacing Options -> SPI -> Yes to enable SPI interface
Library Installation
1 - install ST7789 Library
sudo python3 -m pip install st7735
2 - install Dependencies
21
Python Example
import ST7735
WIDTH = disp.width
HEIGHT = disp.height
# display!
disp.display(img)
22
Circuit in Action :
pi@raspberry:~ $ touch st7735.py
// copy code content into st7735.py
You've done it, you can now use your module for your projects :)
Now it is time to learn and make the Projects on your own. You can
do that with the help of many example scripts and other tutorials,
which you can find on the internet.
If you are looking for the high quality microelectronics and
accessories, AZ-Delivery Vertriebs GmbH is the right company to get
them from. You will be provided with numerous application
examples, full installation guides, eBooks, libraries and assistance
from our technical experts.
https://az-delivery.de
Have fun!
Impressum
https://az-delivery.de/pages/about-us
23