The TFT LCD ST7735 is a compact 1.8-inch color display module that integrates the ST7735 driver IC, capable of rendering 262,000 colors with a resolution of 128x160 pixels. It communicates via the SPI interface, making it ideal for microcontroller projects, especially with Arduino and Raspberry Pi. This display is widely used for graphical interfaces, sensor data visualization, and small embedded systems due to its low power consumption, fast refresh rate, and ease of integration with popular graphic libraries like Adafruit GFX and TFT_eSPI.

1、ST7735 Arduino wiring diagram
2、ST7735 pinout configuration
3、ST7735 SPI interface setup
4、ST7735 library for Arduino
5、ST7735 display resolution
6、ST7735 vs ILI9341 comparison

1、ST7735 Arduino wiring diagram

Connecting an ST7735 TFT display to an Arduino board requires understanding the pinout and the SPI communication protocol. The ST7735 module typically has eight pins: VCC, GND, CS (Chip Select), RST (Reset), DC (Data/Command), MOSI (Master Out Slave In), SCK (Serial Clock), and LED (Backlight). For a standard Arduino Uno, VCC connects to 3.3V or 5V depending on the module variant, but 3.3V is recommended to avoid damaging the display. GND connects to ground. CS is usually connected to digital pin 10, RST to pin 9, DC to pin 8, MOSI to pin 11, and SCK to pin 13. The LED pin can be tied to 3.3V through a resistor to enable backlight, or controlled via a digital pin for PWM brightness adjustment. Some modules include an additional MISO pin, but it is often not required since the ST7735 is primarily a write-only display. For software SPI, you can define any digital pins, but hardware SPI on pins 11 and 13 offers faster data transfer. Always double-check the module's voltage level; 5V tolerant modules exist, but 3.3V logic is safer. A common mistake is connecting the display to 5V power without a level shifter, which can cause the ST7735 to overheat or malfunction. Using a breadboard and jumper wires, you can quickly prototype the connection. Once wired, upload a simple test sketch to verify the display illuminates and shows the initial color test. Many online tutorials provide wiring diagrams for Arduino Mega, Nano, and ESP32 as well. For ESP32, typical pins are VSPI: MOSI 23, SCK 18, CS 5, DC 17, RST 16. Always ensure the ground is common between the Arduino and the display to prevent communication errors.

2、ST7735 pinout configuration

The ST7735 pinout varies slightly between module manufacturers, but the core signals remain consistent. The main pins are: VCC (power supply, 2.8V to 3.3V typical), GND (ground), CS (active low chip select enables SPI communication), RST (active low reset initializes the display driver), DC (data/command select high for data, low for commands), MOSI (SPI data input), SCK (SPI clock), and LED (backlight control, often connected to VCC through a resistor). Some modules like the 1.8-inch 128x160 TFT from Adafruit include an SD card slot, adding additional pins for SD card SPI: MISO, CS_SD, and sometimes a separate VCC_SD. The pinout is usually printed on the back of the module or provided in the datasheet. The ST7735 driver itself supports up to 132x162 pixels, but the display panel is typically 128x160, with a small border area. The miso pin is rarely used because the ST7735 does not support reading from the display memory in standard operation. However, some libraries use MISO for identification or diagnostic purposes. The backlight pin can be driven with PWM for dimming; a 100-ohm resistor in series is recommended to limit current. If the LED pin is left floating, the backlight will be off. The reset pin should be connected to a digital output; if tied to VCC, the display may not initialize correctly. For modules with a built-in level shifter, the VCC can accept 5V, but it is safer to stick with 3.3V. The SPI interface operates at up to 20 MHz depending on the microcontroller and wiring quality. The pinout configuration is critical for proper initialization; if colors appear inverted or garbled, check the DC and CS pin assignments. Many libraries define these pins in the constructor or a header file. Understanding the pinout allows you to adapt the wiring for different boards without confusion.

3、ST7735 SPI interface setup

The ST7735 uses a standard 4-wire SPI interface for communication, which includes SCK (clock), MOSI (master out slave in), CS (chip select), and DC (data/command). The SPI protocol allows high-speed data transfer, typically up to 20 MHz, enabling smooth frame updates for animations or video. To set up the SPI interface, you need to initialize the SPI bus on your microcontroller. On Arduino, use the SPI.begin() function and configure the clock polarity and phase. The ST7735 expects SPI mode 0 (CPOL=0, CPHA=0) or mode 3 (CPOL=1, CPHA=1) depending on the library; most libraries default to mode 0. The CS pin is pulled low to start communication and high to end it. The DC pin determines whether the transmitted byte is a command (low) or data (high). After initializing SPI, send initialization commands such as SWRESET (software reset), SLPOUT (sleep out), COLMOD (color mode, typically 16-bit RGB565), and DISPON (display on). Each command is followed by parameters as specified in the ST7735 datasheet. For example, to set the color mode to 16-bit, send command 0x3A followed by parameter 0x05. The SPI setup also involves setting the correct data order (MSB first) and bit order. Some libraries like Adafruit ST7735 handle all initialization automatically, but you can customize it by modifying the init sequence. The SPI interface can be shared with other SPI devices if each has its own CS pin. For hardware SPI, use the dedicated pins on your board; for software SPI, you can define any pins but expect lower speed. The ST7735 also supports 3-wire SPI (without DC) but it is less common and requires a different protocol. Proper SPI setup ensures reliable communication; if the display shows random pixels or no image, check wiring, clock speed, and SPI mode. Using a logic analyzer can help debug SPI transactions. Overall, the SPI interface makes the ST7735 easy to integrate with most microcontrollers.

4、ST7735 library for Arduino

Several libraries are available for the ST7735 TFT display on Arduino, with the most popular being Adafruit ST7735 and TFT_eSPI. The Adafruit library provides a high-level API built on top of Adafruit GFX, offering functions for drawing pixels, lines, rectangles, circles, text, and bitmaps. To use it, install the Adafruit ST7735 library and Adafruit GFX library via the Arduino Library Manager. Then include the header files and create a display object, specifying the CS, DC, and RST pins. For example: Adafruit_ST7735 tft = Adafruit_ST7735(cs, dc, rst);. In setup(), call tft.initR(INITR_BLACKTAB) for most 1.8-inch modules. The library supports rotation, color depth, and custom fonts. Another excellent library is TFT_eSPI by Bodmer, which is optimized for speed and memory. TFT_eSPI supports hardware SPI acceleration, DMA transfers, and advanced features like sprite rendering and JPEG decoding. It requires manual configuration in a User_Setup.h file, where you define pins, display driver, and SPI frequency. For the ST7735, set the driver to ST7735_DRIVER and define TFT_WIDTH 128, TFT_HEIGHT 160. TFT_eSPI also includes an SPIFFS or SD card support for loading images. Both libraries handle the initialization sequence automatically, but you can override it if needed. For beginners, Adafruit ST7735 is easier due to its simplicity and extensive documentation. For advanced users, TFT_eSPI offers better performance and more features. Other libraries like Ucglib and MCUFRIEND_kbv also support ST7735 but are less common. When choosing a library, consider your project requirements: if you need fast frame rates or touch support, TFT_eSPI is preferable. Always check the library documentation for pin configuration and initialization options. Using a library greatly simplifies programming, allowing you to focus on the graphical content rather than low-level driver details.

5、ST7735 display resolution

The ST7735 TFT display has a resolution of 128 pixels horizontally and 160 pixels vertically, resulting in a total of 20,480 pixels. This resolution is ideal for small form factor projects such as wearable devices, sensor readouts, and mini game consoles. The display supports a 16-bit color depth (RGB565), which assigns 5 bits to red, 6 bits to green, and 5 bits to blue, allowing 65,536 colors. Some modules also support 18-bit color (262,000 colors) but require different initialization. The pixel pitch is approximately 0.22 mm, giving a crisp image for its size. The active area is typically 28.03 mm by 35.04 mm, making it suitable for displaying text, icons, and simple graphics. Despite its small size, the resolution is sufficient for showing up to 10 lines of text at 8x8 pixel fonts. The ST7735 driver can address up to 132x162 pixels, but the physical panel only exposes 128x160. The extra pixels are used for offset correction. When writing a library, you need to set the column and page addresses correctly to map the virtual resolution to the physical one. The resolution affects the frame buffer size; for a full 16-bit color frame, you need 20,480 * 2 = 40,960 bytes of RAM. This can be challenging for microcontrollers with limited memory like the Arduino Uno (2 KB SRAM), so partial buffering or direct drawing is often used. For more powerful boards like ESP32 or Teensy, full frame buffering is possible. The resolution also determines the aspect ratio of approximately 4:5, which is portrait-oriented. Some applications rotate the display to landscape using library rotation functions, but the physical orientation remains the same. When designing graphics, consider the resolution limits to ensure text and images are legible. The ST7735 is not suitable for high-definition video but excels in displaying real-time data, menus, and simple animations.

6、ST7735 vs ILI9341 comparison

The ST7735 and ILI9341 are both popular TFT display drivers, but they target different applications. The ST7735 is used for small displays (typically 1.8 inches, 128x160 pixels) while the ILI9341 drives larger displays (2.8 to 3.5 inches, 240x320 pixels). The ILI9341 supports higher resolution and can display more detailed content, but it consumes more power and requires more memory. The ST7735 uses a simpler SPI protocol with lower clock speeds, making it easier to interface with 8-bit microcontrollers. The ILI9341 has a more complex initialization sequence and supports parallel interface in addition to SPI. In terms of color depth, both support 16-bit and 18-bit modes, but the ILI9341 can also handle 24-bit color with external RAM. The ST7735 has a lower pin count and smaller footprint, ideal for space-constrained projects. The ILI9341 often includes a touch controller (XPT2046) and a microSD card slot, adding functionality. Performance-wise, the ILI9341 can achieve higher frame rates due to its faster SPI support (up to 40 MHz) and larger frame buffer. However, for simple applications like displaying text or sensor data, the ST7735 is more than adequate. Cost is also a factor: ST7735 modules are cheaper, typically under $5, while ILI9341 modules range from $8 to $15. When choosing between them, consider your project's requirements: if you need a small, low-power display for a wearable or IoT device, the ST7735 is ideal. If you need a larger, more detailed display for a dashboard or game, the ILI9341 is better. Both drivers are well-supported by libraries like Adafruit GFX and TFT_eSPI, so migration between them is relatively straightforward. In summary, the ST7735 excels in compact, low-cost applications, while the ILI9341 offers higher performance and resolution for more demanding projects.

If you are exploring the world of small color displays for your next project, the TFT LCD ST7735 module is an excellent starting point. This guide has covered essential topics including ST7735 Arduino wiring diagram, ST7735 pinout configuration, ST7735 SPI interface setup, ST7735 library for Arduino, ST7735 display resolution, and ST7735 vs ILI9341 comparison. Each of these aspects helps you understand how to integrate and program this versatile display. Whether you are building a weather station, a mini handheld console, or a data logger, the ST7735 provides a reliable and colorful output. By mastering the wiring, pinout, SPI setup, and library usage, you can unlock the full potential of this display. The comparison with ILI9341 also gives you perspective on when to choose the ST7735 for your specific needs. Continue experimenting with different libraries and custom initialization sequences to optimize performance. With its low cost and wide community support, the ST7735 remains a favorite among hobbyists and professionals alike.

In conclusion, the TFT LCD ST7735 is a powerful yet affordable display module that brings color graphics to embedded projects. We have explored the essential aspects of connecting and programming this display, from the ST7735 Arduino wiring diagram and pinout to the SPI interface setup and library options. Understanding the display resolution and how it compares to alternatives like the ILI9341 helps you make informed design decisions. The ST7735 excels in small, low-power applications where color output is needed without high memory requirements. By following the wiring diagrams and using libraries such as Adafruit ST7735 or TFT_eSPI, you can quickly get your display running. Whether you are a beginner or an experienced developer, the ST7735 offers a straightforward path to adding vibrant visuals to your projects. Its robust driver IC and extensive community support ensure that you will find solutions to any challenges. We encourage you to experiment with different graphics, animations, and sensors to fully leverage this display. The ST7735 remains a reliable choice for countless embedded applications.