The ST7735 is a popular single-chip controller driver for small TFT LCD displays, typically found in 1.8-inch and 1.44-inch color modules. It supports a resolution of 128x160 pixels and communicates via the SPI interface, making it ideal for microcontroller projects using Arduino, ESP32, or STM32. With its low power consumption and ability to display 262,000 colors, the ST7735 is widely used in DIY electronics, wearable devices, and embedded systems. This guide covers everything from pinout details to wiring, library installation, and example code.

1、ST7735 pinout
2、Arduino ST7735 library
3、ST7735 wiring diagram
4、1.8 inch TFT display Arduino
5、ST7735 SPI interface
6、ST7735 color depth
7、ST7735 troubleshooting

1、ST7735 pinout

Understanding the ST7735 pinout is essential for correctly connecting the display to your microcontroller. Most ST7735-based TFT modules come with 8 pins: VCC, GND, CS, RESET, DC, MOSI, SCK, and LED. VCC typically accepts 3.3V, though some modules have a built-in voltage regulator allowing 5V input. GND connects to the common ground. CS is the chip select pin, used to enable or disable communication with the display. RESET resets the display controller; it can be tied to the microcontroller reset or controlled via a digital pin. DC (Data/Command) selects whether the data sent is a command or pixel data. MOSI (Master Out Slave In) and SCK (Serial Clock) are the SPI data and clock lines. LED controls the backlight; it can be connected to a PWM pin for brightness control or to 3.3V for full brightness. Some modules also include an optional MISO pin for reading data from the display, though it is rarely used. Always double-check the pin labels on your specific module, as manufacturers sometimes use alternative naming like SDA for MOSI or SCL for SCK. Incorrect wiring can damage the display or the microcontroller, so verify each connection with a multimeter if possible. For beginners, it is recommended to use a breadboard and jumper wires to test connections before soldering. The ST7735 pinout is standardized across most 1.8-inch and 1.44-inch modules, but variations exist, especially in pin order. Refer to the datasheet or seller documentation for exact pin mapping. Once you have identified the pins, you can proceed to wire the display to your Arduino or other board.

2、Arduino ST7735 library

The Arduino ST7735 library provides a simple way to control the display using familiar functions like fillScreen, drawPixel, drawLine, and print. The most commonly used library is the Adafruit ST7735 library, which works with the Adafruit GFX library for graphics primitives. To install it, open the Arduino IDE, go to Sketch Menu, Include Library, Manage Libraries, and search for ST7735. Install the Adafruit ST7735 library along with the Adafruit GFX library and the Adafruit BusIO library if prompted. Alternatively, you can download the library from GitHub and manually add it to your Arduino libraries folder. Once installed, include the necessary header files at the top of your sketch: #include lt;Adafruit_GFX.hgt; and #include lt;Adafruit_ST7735.hgt;. Then create an object for the display, specifying the CS, DC, and RESET pins. For example: Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, rst);. In the setup function, call tft.initR(INITR_BLACKTAB) for most 1.8-inch displays, or tft.initR(INITR_144GREENTAB) for 1.44-inch ones. The library supports rotation, color fill, text rendering, and bitmap display. You can also use the setRotation function to change the orientation. Many example sketches are included with the library, such as the classic graphicstest and spitftbitmap. These examples demonstrate how to draw shapes, display text, and show images. If you encounter compilation errors, ensure you have the latest versions of all required libraries. The Arduino ST7735 library is actively maintained and works with both AVR-based Arduinos like the Uno and ARM-based boards like the Due. For ESP32 or STM32 boards, you may need to adjust the SPI pins or use hardware SPI for faster performance.

3、ST7735 wiring diagram

A proper ST7735 wiring diagram is critical to avoid fried components or garbled display output. The standard connection for an Arduino Uno to an ST7735 TFT module is as follows: VCC to 3.3V or 5V (depending on module), GND to GND, CS to digital pin 10, RESET to digital pin 9, DC to digital pin 8, MOSI to digital pin 11 (ICSP pin 4), SCK to digital pin 13 (ICSP pin 3), and LED to 3.3V through a 100-ohm resistor or directly to 3.3V. For Arduino Mega, use pin 52 for SCK and pin 51 for MOSI. For ESP32, typical pins are: VCC to 3.3V, GND to GND, CS to GPIO 5, RESET to GPIO 17, DC to GPIO 16, MOSI to GPIO 23, SCK to GPIO 18, and LED to 3.3V. Always connect the backlight LED pin to a current-limiting resistor to prevent excessive current draw. Some modules have the resistor built-in, but it is safer to add one externally. When wiring, keep the SPI lines as short as possible to reduce signal noise. Use a common ground plane and avoid running wires near high-current or switching circuits. If your display shows nothing or white screen, check that the CS, DC, and RESET pins are correctly mapped in your code. A multimeter can verify continuity and voltage levels. For breadboard prototyping, use solid-core wires for reliable connections. Once the wiring is verified, upload a simple test sketch like the graphicstest.ino from the Adafruit library. If the display shows colors and shapes, your wiring is correct. If not, recheck each connection and ensure the power supply can deliver enough current (typically 80-120mA for the backlight and controller).

4、1.8 inch TFT display Arduino

The 1.8 inch TFT display Arduino combination is one of the most popular setups for hobbyist projects. These displays, often based on the ST7735 driver, offer a compact 128x160 pixel resolution with a wide viewing angle and vibrant colors. They are commonly used in weather stations, game consoles, data loggers, and smart home interfaces. To get started, connect the display to your Arduino as described in the wiring diagram section. Then install the Adafruit ST7735 library and run one of the example sketches. The graphicstest example will draw lines, circles, rectangles, and text to verify functionality. You can also display bitmap images stored in program memory using the drawBitmap function. For text, use the setCursor and print methods. The 1.8 inch TFT display Arduino projects often involve reading sensor data and displaying it in real time. For example, a DHT22 temperature and humidity sensor can show readings on the screen. Another common project is a simple digital clock using an RTC module. The display can also show menu systems for controlling relays or motors. Because the ST7735 uses SPI, it leaves many digital pins free for other sensors or actuators. However, the SPI bus must be shared carefully if using multiple SPI devices. To improve performance, you can use hardware SPI instead of software SPI by using the dedicated MOSI and SCK pins. The 1.8 inch screen size is ideal for handheld devices due to its low weight and power consumption. With proper code optimization, the display can refresh at 30 frames per second or more. Many online tutorials provide step-by-step instructions for specific projects, making it easy for beginners to replicate. Always ensure your Arduino board can supply enough current; for Uno, a separate 3.3V regulator is recommended if powering both the display and other components.

5、ST7735 SPI interface

The ST7735 SPI interface is the primary communication method between the display controller and the microcontroller. SPI stands for Serial Peripheral Interface and uses four main lines: MOSI, MISO, SCK, and CS. In the case of the ST7735, the MISO line is often omitted or unused because the display rarely sends data back to the controller. The SPI interface allows high-speed data transfer, typically up to 20 MHz, enabling fast screen updates. To use the ST7735 SPI interface with Arduino, you must configure the SPI pins correctly. On an Arduino Uno, the hardware SPI pins are on the ICSP header: pin 11 (MOSI), pin 12 (MISO), and pin 13 (SCK). The CS and DC pins can be any digital I/O pins. The RESET pin can also be any digital pin or tied to the microcontroller reset. In your code, you can either use the hardware SPI library (SPI.h) or a software bit-banging method. Hardware SPI is faster and more reliable, especially for complex graphics. The Adafruit ST7735 library automatically uses hardware SPI if you pass the CS, DC, and RESET pins to the constructor. If you need to use different pins for MOSI and SCK, you can use software SPI by calling the constructor with additional parameters, but this slows down performance. The ST7735 SPI interface supports both 4-wire and 3-wire modes, but the 4-wire mode is standard. In 4-wire mode, the DC line distinguishes between command and data bytes. When DC is low, the next byte is interpreted as a command; when DC is high, it is data. This allows the display to accept both configuration commands and pixel data over the same SPI line. To initialize the display, you send a series of commands via SPI to set the color mode, memory layout, and display orientation. The ST7735 SPI interface is robust and works well even with long wires if proper shielding and decoupling capacitors are used. For wireless or battery-powered projects, the SPI interface can be put into low-power mode when not in use.

6、ST7735 color depth

The ST7735 color depth is 16 bits per pixel, supporting up to 65,536 colors, but the controller can also display 262,000 colors using an internal mapping table. The actual color depth depends on the mode selected during initialization. The most common mode is RGB565, where 5 bits are used for red, 6 bits for green, and 5 bits for blue. This provides a good balance between color quality and memory usage. For a 128x160 pixel display, the frame buffer would require 128 * 160 * 2 = 40,960 bytes of RAM if stored locally, but the ST7735 has its own internal RAM, so the microcontroller does not need to store the entire frame. When sending pixel data, you pack two bytes per pixel: the first byte contains the high 5 bits of red and the top 3 bits of green, and the second byte contains the bottom 3 bits of green and the 5 bits of blue. The Adafruit ST7735 library handles this packing automatically when you use functions like drawPixel or fillRect. You can also set the color depth to 18 bits (6 bits per channel) using a different initialization command, but this is rarely used because it reduces the number of colors per channel slightly. The ST7735 color depth is sufficient for displaying photographs, graphs, and text with smooth gradients. However, due to the limited number of bits, some banding may appear in smooth color transitions. To minimize banding, you can use dithering algorithms in your software. The display can also be set to a lower color depth like 8 bits for faster updates, but this reduces quality. For most Arduino projects, the default 16-bit color depth is ideal. When choosing colors for your UI, use predefined constants like ST7735_BLACK, ST7735_WHITE, ST7735_RED, ST7735_GREEN, ST7735_BLUE, and ST7735_YELLOW. These constants are defined in the Adafruit library and map to the correct 16-bit values. The ST7735 color depth is one of the reasons it remains popular for embedded graphics applications.

7、ST7735 troubleshooting

ST7735 troubleshooting is a common task for beginners and experienced makers alike. The most frequent issue is a blank or white screen. This often results from incorrect wiring, especially the CS, DC, or RESET pins. Double-check that each pin matches the code definitions. Another cause is insufficient power; the ST7735 module can draw up to 120mA with the backlight on, so ensure your power supply can deliver enough current. If the display shows garbled characters or random pixels, the SPI clock speed may be too high. Reduce the SPI clock speed in the library by modifying the begin call or using setSPISpeed. For the Adafruit library, you can pass a speed value like tft.setSPISpeed(8000000) to set 8 MHz. Another common problem is incorrect initialization tab. The ST7735 comes in different variants: black tab, green tab, red tab, and blue tab. The initR function must use the correct tab constant. For most 1.8-inch displays, INITR_BLACKTAB works. For 1.44-inch displays, use INITR_144GREENTAB. If the colors are inverted or washed out, the color mode may be wrong. Try using initR(INITR_BLACKTAB) with MADCTL settings to swap RGB order. Some modules require a different command sequence; the library includes alternative initialization routines like initB or initR. If the display flickers or has horizontal lines, check the backlight connection. The LED pin should have a stable voltage, preferably from a separate 3.3V regulator. Adding a 10uF capacitor between VCC and GND near the display can filter noise. If the display works intermittently, inspect the solder joints on the module pins. Cold solder joints can cause intermittent connections. Reflowing the solder with a fine-tipped iron can fix this. For software issues, ensure you are using the latest version of the Adafruit ST7735 and GFX libraries. Older versions may have bugs that cause strange behavior. Finally, if nothing works, test the display with a known working Arduino and code from a reliable source like the Adafruit learning system. ST7735 troubleshooting is systematic: check power, then wiring, then code, then library version. With patience, most issues can be resolved quickly.

The ST7735 TFT LCD display is a versatile and affordable component for makers and engineers. By mastering its pinout, wiring, library usage, and troubleshooting techniques, you can create colorful and interactive projects with Arduino, ESP32, or other microcontrollers. Whether you are building a weather station, a game console, or a data display, the ST7735 offers excellent performance and ease of use. The seven key topics covered in this guide provide a solid foundation for both beginners and advanced users. Start with simple examples, then expand to more complex applications. The ST7735 community is active and supportive, with many online resources and forums available. With the right knowledge and tools, you can unlock the full potential of this small but powerful display.

This article has provided a comprehensive overview of the ST7735 TFT LCD display, covering essential aspects such as pinout, Arduino library integration, wiring diagrams, 1.8-inch display projects, SPI interface details, color depth, and common troubleshooting methods. By understanding these core topics, you can confidently incorporate the ST7735 into your next electronics project. The display's compact size, low cost, and full-color capability make it an excellent choice for hobbyists and professionals alike. We encourage you to experiment with code examples, customize your graphics, and share your creations with the community. With the information presented here, you are well-equipped to tackle any ST7735-based project successfully.