Components · 10 min read

ST7735 Arduino: 1.8 Inch TFT Wiring, Tab Colors and Fixes

ST7735 Arduino guide: SPI wiring for the 1.8 inch 128x160 TFT, picking the tab color in Adafruit's library, fixing inverted colors and offsets, ESP32 TFT_eSPI.

The ST7735 and Arduino pair is the cheapest way to add a color screen to your project. The red 1.8 inch TFT module you see everywhere has an ST7735 driver chip inside; with its 128x160 pixel resolution, a panel that shows 65 thousand colors and an SD card slot on the back, it sits between an OLED and an ILI9341 in size and price. The screen talks to the Arduino over SPI, so five signal wires are all you need.

In this guide you'll first see which version of the module you have and how to choose the tab color in Adafruit's library, because a wrong choice is the number one cause of inverted colors, garbage pixels at the edge and shifted images. Then we'll safely connect the Uno's 5 V outputs to the 3.3 V screen, run a test sketch, build a small flicker-free gauge interface and write a faster version of the same gauge on an ESP32 using TFT_eSPI sprites.

Arduino Uno for connecting an ST7735 TFT display
Arduino Uno: it drives the ST7735 screen through the hardware SPI pins D11 and D13.

What is the ST7735 and how does it work?

The ST7735 is a driver chip made by Sitronix for small color TFT panels. Inside it is a 132x162 pixel graphics memory (GRAM); the Arduino tells it which area to write to and then sends the pixel colors one after another. Colors are usually sent as RGB565, meaning 16 bits (2 bytes) per pixel: 5 bits red, 6 bits green, 5 bits blue. Painting the full screen once takes 128 x 160 x 2 = 40,960 bytes; that is twenty times the Uno's 2 KB of RAM, so the Uno never keeps the image in memory and draws straight to the screen. The A0 pin on the module (also called DC) tells the chip whether the byte being sent is a command or data.

Feature1.8 inch ST7735 moduleNote
Resolution128x160 pixels160x128 in landscape
Colors65K (RGB565, 16-bit)The chip also supports 18-bit; libraries use 16-bit
InterfaceSPI (write only)No MISO; you can't read back from the screen
Logic voltage3.3 VNeeds level adaptation on the Uno
Supply (VCC)3.3–5 VRed modules have an onboard regulator
CurrentAbout 25–50 mAMostly drawn by the backlight LEDs
SPI speedAbout 15 MHz in the datasheetMost modules also run at 27 MHz
ExtraSD card slotShares the SPI bus with its own CS pin

Which module do you have? Versions and tab colors

The name ST7735 doesn't describe a single screen but several different panels and production batches. The same chip is paired with different glass panels in different factories; in some, the start of the graphics memory is shifted by 1–3 pixels, in others the color order is BGR instead of RGB. Adafruit named these differences after the color of the pull tab on the screen's protective film: black, red and green tab. Most red 1.8 inch modules sold today work correctly with the black tab (INITR_BLACKTAB), but if you threw the film away long ago you can't know the color; then you find it by trial with the table below and the test sketch.

ModuleAdafruit initR()TFT_eSPI defineSymptom if chosen wrong
1.8 inch 128x160, black tab (most common)INITR_BLACKTABST7735_BLACKTABRed and blue swapped
1.8 inch 128x160, green tabINITR_GREENTABST7735_GREENTAB (2, 3)1–2 pixel garbage strip on the right or bottom
1.8 inch 128x160, red tabINITR_REDTABST7735_REDTABWrong color order and edge offset
1.44 inch 128x128INITR_144GREENTABST7735_GREENTAB128Bottom 32 rows missing, edges offset
0.96 inch 160x80 (IPS)INITR_MINI160x80 or _PLUGINST7735_GREENTAB160x80Inverted colors, image shifted by 24–26 pixels

Pins and wiring: Arduino Uno, ESP32 and Pico

The labels on the module can be confusing: SDA here is not the I2C data line but SPI's MOSI line; SCK is the clock, A0 selects command or data (DC), RESET is the hardware reset, CS is chip select and LED is the backlight. On the Arduino, use the hardware SPI pins for speed: on the Uno MOSI is D11 and SCK is D13, and they can't be changed. CS, DC and RESET can go to any digital pin. To see the pin positions quickly, check the pinout tool, and for how SPI works, the SPI guide.

ST7735 pinArduino UnoESP32Raspberry Pi PicoFunction
VCC5 V3V33V3 (OUT)Power (onboard regulator)
GNDGNDGNDGNDCommon ground
CSD10GPIO 5GP17Chip select
RESETD8GPIO 4GP21Hardware reset
A0 (DC)D9GPIO 2GP20Command / data
SDA (MOSI)D11GPIO 23GP19SPI data
SCKD13GPIO 18GP18SPI clock
LED3.3 V3V33V3 (OUT)Backlight; can be dimmed with PWM
The red module may have a solder bridge called J1 next to VCC. If the bridge is open, you feed 5 V to VCC and the onboard regulator makes 3.3 V; if it's closed, the regulator is bypassed and VCC must get only 3.3 V. Feeding 5 V with the bridge closed can permanently damage the screen. Also, the regulator only lowers the supply and doesn't protect the signal pins: CS, A0, RESET, SDA and SCK are always 3.3 V logic.

3.3 V logic on the Uno: resistors or a level shifter?

The Uno's digital outputs give 5 V when HIGH. The ST7735's input pins, however, are designed to tolerate only slightly more than their supply voltage. Many people connect the screen directly and see it work for a while; but the excess voltage flows through the protection diodes inside the chip, warms the screen and eventually comes back as a white screen or random corruption. There are three safe ways: a series resistor on each signal line, a voltage divider or a one-way level shifter. Because the screen only receives data, you don't need a complicated bidirectional solution. You can check divider values with the voltage divider calculator, and for details see the logic level converter guide.

MethodHow to connectProsCons
Series resistor1 kΩ on each signal lineCheapest, 5 resistorsLimits current but doesn't fully lower the voltage
Voltage divider1 kΩ in series + 2 kΩ to ground (5 V down to 3.3 V)Voltage stays within specEdges soften at 8 MHz, needs 10 resistors
74HC4050 / CD4050 bufferPowered from 3.3 V, inputs tolerate 5 VFast, clean signalExtra chip and wiring
BSS138 bidirectional moduleLV 3.3 V, HV 5 VReady-made, easyEdges can degrade at high SPI speed
Use a 3.3 V boardESP32, Pico or a 3.3 V Pro MiniNo converter neededYou have to switch boards

Step by step: the Adafruit ST7735 library and a first test

  1. In the Arduino IDE open Tools > Manage Libraries and type Adafruit ST7735 and ST7789 Library.
  2. Click Install; the IDE will also offer the Adafruit GFX Library and Adafruit BusIO dependencies, install them all.
  3. Wire the screen as in the table; on an Uno add series resistors or a level shifter on the signal lines.
  4. Upload the test sketch below and look for a white frame and red, green and blue bars from top to bottom.
  5. Open the Serial Monitor at 9600 baud; sending r rotates the image by 90 degrees and i inverts the colors.
  6. If red and blue are swapped or one edge of the frame is missing, change the TAB line in the code and upload again.
C++ (Arduino IDE)
1// ST7735 1,8" test: sekme (tab), renk ve kenar kontrolü / tab, colour and edge check
2#include <Adafruit_GFX.h>      // çizim fonksiyonları / drawing functions
3#include <Adafruit_ST7735.h>   // ST7735 sürücüsü / ST7735 driver
4#include <SPI.h>
5
6#define TFT_CS   10            // CS
7#define TFT_DC    9            // modüldeki A0 / A0 on the module
8#define TFT_RST   8            // RESET
9// SDA (MOSI) -> D11, SCK -> D13: donanım SPI / hardware SPI
10
11Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
12
13// Sekme: INITR_BLACKTAB, INITR_GREENTAB ya da INITR_REDTAB / tab option
14const uint8_t TAB = INITR_BLACKTAB;
15uint8_t rotation = 0;          // 0-3
16bool inverted = false;
17
18void drawTest() {
19  tft.fillScreen(ST77XX_BLACK);
20  // Beyaz çerçeve: 4 kenar da tam görünmeli / all 4 edges must be visible
21  tft.drawRect(0, 0, tft.width(), tft.height(), ST77XX_WHITE);
22
23  // Şeritler yukarıdan aşağı kırmızı, yeşil, mavi olmalı / bars must read red, green, blue
24  tft.fillRect(10, 20, tft.width() - 20, 18, ST77XX_RED);
25  tft.fillRect(10, 42, tft.width() - 20, 18, ST77XX_GREEN);
26  tft.fillRect(10, 64, tft.width() - 20, 18, ST77XX_BLUE);
27
28  tft.setTextSize(1);
29  tft.setTextColor(ST77XX_WHITE);
30  tft.setCursor(10, 90);
31  tft.print(F("R / G / B"));
32  tft.setCursor(10, 102);
33  tft.print(tft.width());
34  tft.print(F(" x "));
35  tft.print(tft.height());
36  tft.print(F("  rot "));
37  tft.print(rotation);
38  tft.setTextColor(ST77XX_YELLOW);
39  tft.setCursor(10, 116);
40  tft.print(F("BlueGrays"));
41}
42
43void setup() {
44  Serial.begin(9600);
45  tft.initR(TAB);              // ekranı başlat / initialise the display
46  tft.setRotation(rotation);
47  drawTest();
48  Serial.println(F("r: dondur / rotate, i: renkleri tersle / invert"));
49}
50
51void loop() {
52  if (Serial.available()) {
53    char c = Serial.read();
54    if (c == 'r') {            // 90 derece döndür / rotate 90 degrees
55      rotation = (rotation + 1) % 4;
56      tft.setRotation(rotation);
57      drawTest();
58    } else if (c == 'i') {     // ters renk testi / inversion test
59      inverted = !inverted;
60      tft.invertDisplay(inverted);
61    }
62  }
63}
64

In the code, initR(TAB) starts the screen according to the tab you choose: the tab sets both the color order and the memory start offset. setRotation() works in portrait 128x160 at 0 and 2 and in landscape 160x128 at 1 and 3; width() and height() change accordingly, so it's a good habit to use these functions instead of fixed numbers in your drawings. If all four edges of the frame are visible, the bars are in the right order and the text is readable, you've found the right tab. With hardware SPI the Uno paints this whole screen in about 50–60 ms; if you use the software SPI constructor (the one that takes every pin), that time grows several times.

Inverted colors, shifted image and garbage pixels: fixes

SymptomLikely causeFix
Red shows as blue and blue as redRGB/BGR color order mismatchSwitch between BLACKTAB and GREENTAB/REDTAB; TFT_RGB_ORDER in TFT_eSPI
Black is white, colors look negativePanel runs in inversion modeinvertDisplay(true) or TFT_INVERSION_ON
1–3 pixel colored garbage strip at the edgeWrong memory start offsetTry GREENTAB; GREENTAB2 and GREENTAB3 in TFT_eSPI
Image mirroredDifferent scan direction (MADCTL)Try another tab or change the setRotation value
All-white screenInit commands aren't arrivingCheck CS, A0 and RESET wires and the 3.3 V logic conversion
Completely black screenBacklight not poweredConnect the LED pin to 3.3 V
Very slow drawingSoftware SPI or fillScreen every frameUse the hardware SPI pins and redraw only what changes
Screen breaks when the SD card is insertedBoth devices' CS LOW at the same timeSeparate CS pins, set both HIGH at the start of setup
Once you've found the tab, put a small label on the back of the module (e.g. "BLACKTAB, rot 1"). The next batch from the same seller may use a different panel; with the label you'll still remember months later which module works with which setting.

A small gauge interface (Arduino Uno)

Now let's turn the screen into something useful: an interface that shows the value of a potentiometer (or any analog sensor) on A0 as a big percentage number, a colored bar and a scrolling history graph. Just connect the potentiometer's outer legs to 5 V and GND and its middle leg to A0. On the Uno, clearing and redrawing the full screen in every loop is both slow and causes visible flicker, so the code draws the static parts once and then updates only the pixels that change.

C++ (Arduino IDE)
1// ST7735 küçük gösterge arayüzü (Uno) / small gauge UI (Uno)
2#include <Adafruit_GFX.h>
3#include <Adafruit_ST7735.h>
4#include <SPI.h>
5
6#define TFT_CS   10
7#define TFT_DC    9
8#define TFT_RST   8
9const int SENSOR_PIN = A0;     // potansiyometre orta ucu / potentiometer wiper
10
11Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
12
13const int BAR_X = 10, BAR_Y = 66, BAR_W = 140, BAR_H = 14;
14const int GRAPH_X = 10, GRAPH_Y = 90, GRAPH_W = 140, GRAPH_H = 32;
15const uint16_t GREY = 0x7BEF;  // RGB565 gri / grey
16int lastBar = 0;
17uint16_t lastColor = 0;
18int graphX = 0;
19
20uint16_t levelColor(int percent) {        // yüzdeye göre renk / colour by level
21  if (percent < 60) return ST77XX_GREEN;
22  if (percent < 85) return ST77XX_YELLOW;
23  return ST77XX_RED;
24}
25
26void drawFrame() {             // sabit parçalar bir kez çizilir / static parts drawn once
27  tft.fillScreen(ST77XX_BLACK);
28  tft.fillRect(0, 0, tft.width(), 16, ST77XX_BLUE);
29  tft.setTextSize(1);
30  tft.setTextColor(ST77XX_WHITE);
31  tft.setCursor(4, 4);
32  tft.print(F("BlueGrays Gosterge"));
33  tft.drawRect(BAR_X - 1, BAR_Y - 1, BAR_W + 2, BAR_H + 2, ST77XX_WHITE);
34  tft.drawRect(GRAPH_X - 1, GRAPH_Y - 1, GRAPH_W + 2, GRAPH_H + 2, GREY);
35}
36
37void setup() {
38  tft.initR(INITR_BLACKTAB);
39  tft.setRotation(1);          // yatay 160x128 / landscape
40  drawFrame();
41}
42
43void loop() {
44  int raw = analogRead(SENSOR_PIN);                 // 0-1023
45  int percent = map(raw, 0, 1023, 0, 100);
46  uint16_t color = levelColor(percent);
47
48  // Büyük sayı: arka plan rengiyle yazınca silmeye gerek kalmaz / text with background, no clearing
49  char buf[6];
50  snprintf(buf, sizeof(buf), "%3d%%", percent);
51  tft.setTextSize(3);
52  tft.setTextColor(color, ST77XX_BLACK);
53  tft.setCursor(44, 28);
54  tft.print(buf);
55
56  // Çubuk: yalnız değişen parçayı çiz / bar: draw only the changed part
57  int bar = map(percent, 0, 100, 0, BAR_W);
58  if (color != lastColor) {
59    tft.fillRect(BAR_X, BAR_Y, bar, BAR_H, color);  // renk değişti, hepsini boya / colour changed
60    tft.fillRect(BAR_X + bar, BAR_Y, BAR_W - bar, BAR_H, ST77XX_BLACK);
61  } else if (bar > lastBar) {
62    tft.fillRect(BAR_X + lastBar, BAR_Y, bar - lastBar, BAR_H, color);
63  } else if (bar < lastBar) {
64    tft.fillRect(BAR_X + bar, BAR_Y, lastBar - bar, BAR_H, ST77XX_BLACK);
65  }
66  lastBar = bar;
67  lastColor = color;
68
69  // Kayan grafik: her döngüde bir sütun / scrolling graph: one column per loop
70  int y = GRAPH_Y + GRAPH_H - 1 - map(percent, 0, 100, 0, GRAPH_H - 1);
71  tft.drawFastVLine(GRAPH_X + graphX, GRAPH_Y, GRAPH_H, ST77XX_BLACK);
72  tft.drawPixel(GRAPH_X + graphX, y, ST77XX_CYAN);
73  graphX = (graphX + 1) % GRAPH_W;
74  tft.drawFastVLine(GRAPH_X + graphX, GRAPH_Y, GRAPH_H, GREY);  // imleç / cursor
75
76  delay(100);
77}
78

Three techniques prevent flicker. First, giving setTextColor(color, background) two colors: the library also paints behind the characters, so you don't need to erase the old number separately. Second, drawing only the part of the bar that grows or shrinks instead of the whole bar; when a color threshold is crossed, a single full repaint happens. Third, clearing just one vertical column of the graph per loop and placing one dot. This way a loop finishes in a few milliseconds and the Uno's 2 KB of RAM stays comfortable. You can change the percentage thresholds (60 and 85) for your own sensor and convert to real units (degrees, cm, volts) in the map() line.

ST7735 with an ESP32: setting up TFT_eSPI

Because the ESP32 runs on 3.3 V logic, it connects to the screen directly with no extra parts. Adafruit's library works on the ESP32 too, but TFT_eSPI is a better choice for speed and features: it runs SPI at up to 27 MHz and offers smooth fonts and sprites (drawing areas prepared in memory and sent in one go). TFT_eSPI has one difference: the screen and pin settings aren't made with lines in your code but in the User_Setup.h file inside the library folder. After installing the library from the Library Manager, replace the contents of that file in Documents/Arduino/libraries/TFT_eSPI with the following.

Code
1// TFT_eSPI/User_Setup.h: ST7735 1,8" 128x160 + ESP32
2// (dosyanın içeriğini bununla değiştir / replace the file contents with this)
3#define ST7735_DRIVER
4#define TFT_WIDTH  128
5#define TFT_HEIGHT 160
6#define ST7735_BLACKTAB            // sorun varsa GREENTAB, GREENTAB2, GREENTAB3, REDTAB
7// #define TFT_RGB_ORDER TFT_BGR   // kırmızı-mavi yer değiştiriyorsa / red and blue swapped
8// #define TFT_INVERSION_ON        // renkler ters ise / colours inverted
9
10#define TFT_MOSI 23                // modüldeki SDA / SDA on the module
11#define TFT_SCLK 18                // SCK
12#define TFT_CS    5                // CS
13#define TFT_DC    2                // modüldeki A0 / A0 on the module
14#define TFT_RST   4                // RESET
15
16#define LOAD_GLCD                  // 8 px yazı tipi / 8 px font
17#define LOAD_FONT2                 // 16 px
18#define LOAD_FONT4                 // 26 px
19#define SMOOTH_FONT
20
21#define SPI_FREQUENCY  27000000    // görüntü bozulursa 20000000 / drop to 20 MHz on glitches
22

Note: when you update the library, User_Setup.h is reset too, so keep your settings somewhere else. The tab problem is the same in TFT_eSPI: if colors are swapped, enable the TFT_RGB_ORDER line; if there's a garbage strip at the edge, try GREENTAB, GREENTAB2 or GREENTAB3 instead of BLACKTAB. Once the setup is ready, the code below shows a potentiometer on GPIO 34 as a 270-degree colored arc with a big number in the middle and the minimum and maximum values in the corners.

C++ (Arduino IDE)
1// ESP32 + ST7735 + TFT_eSPI: sprite ile titremesiz yay gösterge / flicker-free arc gauge
2#include <TFT_eSPI.h>          // ayarlar User_Setup.h içinde / settings live in User_Setup.h
3
4TFT_eSPI tft = TFT_eSPI();
5TFT_eSprite spr = TFT_eSprite(&tft);   // bellekte çizim alanı / off-screen canvas
6
7const int SENSOR_PIN = 34;     // potansiyometre (ADC1, yalnız giriş) / potentiometer (ADC1, input only)
8const int CX = 80, CY = 70;    // yay merkezi / arc centre
9const int R = 50, RI = 40;     // dış ve iç yarıçap / outer and inner radius
10float smooth = 0;
11int minP = 100, maxP = 0;
12
13uint16_t levelColor(int p) {
14  if (p < 60) return TFT_GREEN;
15  if (p < 85) return TFT_YELLOW;
16  return TFT_RED;
17}
18
19void setup() {
20  Serial.begin(115200);
21  tft.init();
22  tft.setRotation(1);          // yatay 160x128 / landscape
23  tft.fillScreen(TFT_BLACK);
24  analogReadResolution(12);    // 0-4095
25  spr.setColorDepth(16);       // 160x128x2 = 40 KB RAM
26  if (spr.createSprite(tft.width(), tft.height()) == nullptr) {
27    Serial.println("Sprite icin bellek yok / not enough RAM for sprite");
28  }
29}
30
31void loop() {
32  int raw = analogRead(SENSOR_PIN);
33  smooth = smooth * 0.8 + raw * 0.2;                // basit filtre / simple low-pass filter
34  int percent = (int)(smooth * 100.0 / 4095.0 + 0.5);
35  if (percent < minP) minP = percent;
36  if (percent > maxP) maxP = percent;
37
38  spr.fillSprite(TFT_BLACK);
39  // Açılar saat 6 yönünden saat yönünde ölçülür / angles start at 6 o'clock, clockwise
40  spr.drawArc(CX, CY, R, RI, 45, 315, TFT_DARKGREY, TFT_BLACK, false);
41  if (percent > 0) {
42    spr.drawArc(CX, CY, R, RI, 45, 45 + percent * 270 / 100, levelColor(percent), TFT_BLACK, false);
43  }
44
45  spr.setTextColor(TFT_WHITE, TFT_BLACK);
46  spr.setTextDatum(MC_DATUM);                       // ortadan hizala / centre datum
47  spr.drawNumber(percent, CX, CY, 4);
48  spr.drawString("%", CX, CY + 22, 2);
49
50  spr.setTextDatum(TL_DATUM);
51  spr.drawString("BlueGrays", 2, 2, 2);
52  spr.setTextColor(TFT_CYAN, TFT_BLACK);
53  spr.drawString("min " + String(minP), 2, 112, 1);
54  spr.drawString("max " + String(maxP), 118, 112, 1);
55
56  spr.pushSprite(0, 0);        // tek seferde ekrana gönder / push in one go
57  delay(30);
58}
59

In this code everything is first drawn into a 160x128 sprite and then sent to the screen in one go with pushSprite(0, 0); since a half-drawn frame never appears on the screen, there's no flicker. At 16-bit color the sprite takes 40 KB of RAM: no problem for the ESP32's roughly 320 KB, impossible on the Uno. drawArc() measures angles from 6 o'clock clockwise; 45 to 315 degrees gives the classic gauge arc with a gap at the bottom. GPIO 34 is an input-only ADC1 pin, so it can be read even while Wi-Fi is on. With 27 MHz SPI the ESP32 sends a full frame in about 15 ms, comfortably above 30 frames per second.

ST7735 with a Raspberry Pi Pico

The Pico also runs on 3.3 V logic and connects to the screen directly. If you use Earle Philhower's arduino-pico core in the Arduino IDE, the Uno sketches above work unchanged; you only need to set the pin defines to CS 17, DC 20, RESET 21, because in this core the default SPI0 bus uses GP18 for SCK and GP19 for MOSI. On the MicroPython side there's no built-in ST7735 module; you copy one of the community st7735.py drivers to the Pico and start it with SPI(0, baudrate=20_000_000, sck=Pin(18), mosi=Pin(19)). Tab and color order problems are solved with the same logic there too.

SD card, images and memory tips

  • The SD slot on the back shares the MOSI, MISO and SCK lines with the screen; use a separate CS for the SD (e.g. D4 on the Uno) and connect the SD's MISO to D12.
  • The spitftbitmap example from Adafruit draws a 24-bit BMP file from the SD card; shrink the image to 128x160 beforehand.
  • On the Uno you can keep fixed graphics in PROGMEM, but a 128x160 image is 40 KB and doesn't fit into 32 KB of flash; stick to small icons (e.g. 16x16 = 512 bytes).
  • Use the F() macro for text; display libraries fill the Uno's RAM quickly, and the methods in the low memory guide help here too.
  • If you connect the backlight to a PWM pin (like D6 on the Uno) through an NPN transistor and dim it with analogWrite(), you can halve the current in battery projects.

Project ideas with the ST7735

  • Color thermometer: show a DS18B20 or DHT22 reading with a bar that turns from blue to red with temperature.
  • Mini game console: Pong or snake with two buttons and a joystick; the screen's 160-pixel side is ideal for a horizontal playfield.
  • ESP32 weather screen: show temperature and humidity fetched from the internet with icons; for details see the clock example in the ST7789 guide.
  • Battery tester: watch the voltage and remaining capacity on a gauge arc.
  • If you want to move to a bigger screen, see the ILI9341 guide for 2.4 or 2.8 inch; most drawing commands are the same.

The ST7735 is a small but very capable screen: once you've found the right tab, haven't skipped level conversion and draw only the pixels that change, you can build smooth interfaces even on an Uno. If you want to try display and sensor projects step by step with a circuit diagram and ready-made code, take a look at the OLED games, the parking sensor and the ESP32 weather projects in the BlueGrays app; moving their drawing logic to the ST7735 takes only a few lines.

Frequently asked questions

Does the ST7735 display work with 5 V?

On most red modules you can feed 5 V to VCC because there's a 3.3 V regulator on the board. The signal pins, however, are 3.3 V logic; you should lower the Uno's 5 V outputs with series resistors, a voltage divider or a level shifter. On 3.3 V boards like the ESP32 and Pico no conversion is needed.

Which tab should I choose for the ST7735?

Try INITR_BLACKTAB first; most 1.8 inch modules sold today work correctly with it. If red and blue are swapped, switch to INITR_GREENTAB or INITR_REDTAB. If you see garbage pixels at the edge, the GREENTAB variant with its memory offset usually fixes it.

Why does my ST7735 display stay white?

A white screen means the backlight is on but the init commands aren't reaching the chip. Check the CS, A0 (DC), RESET, SDA and SCK wires, the pin numbers in the code and the level conversion on the Uno. If the screen was run with direct 5 V signals before, its input pins may be damaged.

What is the difference between ST7735 and ST7789?

Both are SPI display drivers from Sitronix. The ST7735 is usually found on 128x160 and smaller panels, the ST7789 on 240x240 and 240x320 IPS panels. The ST7789 gives a sharper image with wider viewing angles; the same Adafruit library supports both.

Why are the colors inverted on my ST7735?

Colors that look like a negative mean the panel is running in inversion mode; it's common on 0.96 inch 160x80 IPS screens. In Adafruit's library tft.invertDisplay(true) fixes it, in TFT_eSPI the TFT_INVERSION_ON line. If only red and blue are swapped, the problem isn't inversion but color order.

How many pins does the ST7735 use on an Arduino?

It uses at least five signal pins: SDA (MOSI), SCK, CS, A0 (DC) and RESET, plus VCC, GND and LED for the backlight. If you tie RESET to the Arduino's RESET pin and pass -1 in the code, you save one pin. Since nothing is read from the screen, MISO isn't needed, but if you use the SD card slot, MISO gets connected too.

See all projects
Paddle Ball Game - SSD1306
AR-86Intermediate
Premium

Paddle Ball Game - SSD1306

A ball, two paddles and you: you play table tennis, one of the very first video games, on a small OLED screen.

4.5(47)
65
OLED T-Rex Run: Arduino Dinosaur Game
AR-87Advanced
Premium

OLED T-Rex Run: Arduino Dinosaur Game

The dinosaur game that pops up when your internet goes down, now on your desk: the dinosaur runs across the small OLED screen, cacti come at you, and you jump with a single button.

4.7(33)
53
ESP32 HTTPClient + Weather API (with SSD1306 OLED Display)
ES-32Advanced
Premium

ESP32 HTTPClient + Weather API (with SSD1306 OLED Display)

In this project the ESP32 makes a REST API call over the internet to a weather API (wttr.in) using HTTPClient.h. Unlike the I2C LCD version, it uses an SSD1306 OLED (128×64) display, with large text and vector icons for a richer look. Seven weather icons (sunny, rainy, snowy and more) are drawn on the fly, with no bitmap files.

4.3(10)
22
ESP32 Deep Sleep — Battery Saving (OLED + RTC RAM Counter)
ES-33Advanced
Premium

ESP32 Deep Sleep — Battery Saving (OLED + RTC RAM Counter)

The ESP32's Deep Sleep mode shuts down the CPU and most peripherals, cutting current draw to about 10µA, which is vital for battery-powered IoT devices. This project uses three wake-up sources: a timer (15 s), an external pin (EXT0, the button on GPIO 33) and a touch pin (T0/GPIO 4). Counters marked with RTC_DATA_ATTR survive deep sleep.

4.3(10)
17
ESP32 Prayer Rakat Counter (HC-SR04 + SSD1306 OLED + 2 Buttons)
ES-34Advanced
Premium

ESP32 Prayer Rakat Counter (HC-SR04 + SSD1306 OLED + 2 Buttons)

Do you sometimes lose track of which rakat you are on during prayer? This project is a rakat counter that sits next to your prayer mat and counts your prostrations when you bring your hand close. The HC-SR04 ultrasonic distance sensor detects your hand, the SSD1306 OLED display shows the count, and two buttons let you choose 2, 3 or 4 rakats and reset. A 2.5-second debounce and a "hand-away" check make sure no prostration is counted twice.

4.8(11)
14
ESP32 Color Mixer Light (3 Potentiometers + RGB LED + OLED)
ES-36Advanced
Premium

ESP32 Color Mixer Light (3 Potentiometers + RGB LED + OLED)

A smart color-mixer lamp: turn 3 potentiometers on the ESP32 and mix any color you like! As you turn the red, green and blue potentiometers, the common-cathode RGB LED changes color instantly. The SSD1306 OLED display shows each channel's 0-255 value, fill bars and the HEX web color code (like #FF8040) live.

4.7(6)
10
ESP32 Parking Sensor (HC-SR04 + 5-LED Bar + Buzzer + OLED)
ES-38Advanced
Premium

ESP32 Parking Sensor (HC-SR04 + 5-LED Bar + Buzzer + OLED)

The ESP32 version of a car parking sensor! The HC-SR04 ultrasonic sensor measures the distance to the object in front. As it gets closer, a 5-LED bar fills up (green → yellow → red) and the buzzer beeps faster. Very close (under 10 cm), a continuous alarm sounds and all LEDs light up. The SSD1306 OLED display shows the live distance in cm in large text, plus a status message.

14
ESP32 Temperature Data Logger (DHT22 + DS1307 RTC + microSD + OLED)
ES-40Advanced
Premium

ESP32 Temperature Data Logger (DHT22 + DS1307 RTC + microSD + OLED)

Build a timed temperature and humidity logger with the ESP32! A DHT22 sensor reads temperature and humidity once a minute, and each reading is saved to a microSD card in CSV format with a real-time stamp from the DS1307 RTC module. The OLED display shows the latest temperature, humidity, timestamp and total number of records live, in large text.

4.7(7)
12