How to Connect TFT LCD SPI Display with ST7735 to Arduino UNO
How to Connect TFT LCD SPI Display with ST7735 to Arduino UNO
This tutorial shows how to wire a 1.8 inch SPI TFT LCD module with ST7735 chip to Arduino UNO R3, including library installation and sample code for displaying text.
Required Components
- Arduino UNO R3 board
- 1.8 inch 7P SPI Full Color TFT LCD Module with ST7735
- 7 male-to-male jumper wires, 20 cm each
- Breadboard (optional, for wire organization)
Wiring Diagram
Connecting the TFT LCD to Arduino UNO is straightforward. Follow the table below exactly - the 7 display pins must connect to their designated Arduino pins, not interchangeable.
| Arduino UNO | ST7735 1.8” |
|---|---|
| GND | GND |
| 5V | VCC |
| Pin 13 | SCL |
| Pin 11 | SDA |
| Pin 10 | CS |
| Pin 9 | DC |
| Pin 8 | RES |
Installing Ucglib Library
For this TFT display module, the Ucglib library is recommended as it has good support for the ST7735 chip.
- Download the library file from the provided link (RAR format)
- Extract the file using WinRAR or WinZip
- Place the extracted folder in
Documents/Arduino/libraries - Close and reopen Arduino IDE to recognize the library
Sample Code for Displaying Text
After installing the library, upload the code below to test. This code displays sample text on the TFT screen.
#include <Ucglib.h>
// Define pins connected to ST7735 display
#define SCL 13
#define SDA 11
#define CS 10
#define DC 9
#define RES 8
// Create display object for ST7735
Ucglib_ST7735_18x128x160_HWSPI ucg(DC, CS, RES);
void setup(void) {
delay(1000);
// Initialize TFT display
ucg.begin(UCG_FONT_MODE_TRANSPARENT);
// Set background and text colors
ucg.clearScreen(UCG_COLOR_BLACK);
// Set font size
ucg.setFont(ucg_font_ncenR14r);
// Set text color to cyan
ucg.setColor(0, 255, 255);
// Display text at different positions
ucg.setPrintPos(10, 40);
ucg.print("Arduino");
ucg.setColor(0, 255, 0);
ucg.setPrintPos(10, 70);
ucg.print("TFT Display");
ucg.setColor(255, 255, 0);
ucg.setPrintPos(10, 100);
ucg.print("ST7735 SPI");
}
void loop(void) {
// Nothing to do in loop
}
Steps to Upload Code to Arduino
- Open Arduino IDE and paste the code above
- Select Board: Arduino UNO from Tools > Board menu
- Select the correct Port from Tools > Port menu
- Click the Upload button (right arrow) or select Sketch > Upload
- Wait for “Done uploading” message in the status bar
Reference Video
https://www.youtube.com/embed/51hqYWq2Diw
Summary
Using the ST7735 SPI TFT LCD with Arduino UNO is straightforward: connect 7 wires correctly, install the Ucglib library, and upload the sample code. When successful, you’ll see text displayed on the 1.8 inch screen. Once you understand the basics, you can expand to display temperature, humidity, or sensor data.
อยากทำโปรเจคแบบนี้?
รับทำโปรเจค Arduino / IoT จบงานไว ส่งงานครบ พร้อมสอน
If you need Arduino project service or urgent IoT development, see full service details on the home page
จ้างทำโปรเจคเลย