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.

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.
| Feature | 1.8 inch ST7735 module | Note |
|---|---|---|
| Resolution | 128x160 pixels | 160x128 in landscape |
| Colors | 65K (RGB565, 16-bit) | The chip also supports 18-bit; libraries use 16-bit |
| Interface | SPI (write only) | No MISO; you can't read back from the screen |
| Logic voltage | 3.3 V | Needs level adaptation on the Uno |
| Supply (VCC) | 3.3–5 V | Red modules have an onboard regulator |
| Current | About 25–50 mA | Mostly drawn by the backlight LEDs |
| SPI speed | About 15 MHz in the datasheet | Most modules also run at 27 MHz |
| Extra | SD card slot | Shares 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.
| Module | Adafruit initR() | TFT_eSPI define | Symptom if chosen wrong |
|---|---|---|---|
| 1.8 inch 128x160, black tab (most common) | INITR_BLACKTAB | ST7735_BLACKTAB | Red and blue swapped |
| 1.8 inch 128x160, green tab | INITR_GREENTAB | ST7735_GREENTAB (2, 3) | 1–2 pixel garbage strip on the right or bottom |
| 1.8 inch 128x160, red tab | INITR_REDTAB | ST7735_REDTAB | Wrong color order and edge offset |
| 1.44 inch 128x128 | INITR_144GREENTAB | ST7735_GREENTAB128 | Bottom 32 rows missing, edges offset |
| 0.96 inch 160x80 (IPS) | INITR_MINI160x80 or _PLUGIN | ST7735_GREENTAB160x80 | Inverted 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 pin | Arduino Uno | ESP32 | Raspberry Pi Pico | Function |
|---|---|---|---|---|
| VCC | 5 V | 3V3 | 3V3 (OUT) | Power (onboard regulator) |
| GND | GND | GND | GND | Common ground |
| CS | D10 | GPIO 5 | GP17 | Chip select |
| RESET | D8 | GPIO 4 | GP21 | Hardware reset |
| A0 (DC) | D9 | GPIO 2 | GP20 | Command / data |
| SDA (MOSI) | D11 | GPIO 23 | GP19 | SPI data |
| SCK | D13 | GPIO 18 | GP18 | SPI clock |
| LED | 3.3 V | 3V3 | 3V3 (OUT) | Backlight; can be dimmed with PWM |
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.
| Method | How to connect | Pros | Cons |
|---|---|---|---|
| Series resistor | 1 kΩ on each signal line | Cheapest, 5 resistors | Limits current but doesn't fully lower the voltage |
| Voltage divider | 1 kΩ in series + 2 kΩ to ground (5 V down to 3.3 V) | Voltage stays within spec | Edges soften at 8 MHz, needs 10 resistors |
| 74HC4050 / CD4050 buffer | Powered from 3.3 V, inputs tolerate 5 V | Fast, clean signal | Extra chip and wiring |
| BSS138 bidirectional module | LV 3.3 V, HV 5 V | Ready-made, easy | Edges can degrade at high SPI speed |
| Use a 3.3 V board | ESP32, Pico or a 3.3 V Pro Mini | No converter needed | You have to switch boards |
Step by step: the Adafruit ST7735 library and a first test
- In the Arduino IDE open Tools > Manage Libraries and type Adafruit ST7735 and ST7789 Library.
- Click Install; the IDE will also offer the Adafruit GFX Library and Adafruit BusIO dependencies, install them all.
- Wire the screen as in the table; on an Uno add series resistors or a level shifter on the signal lines.
- Upload the test sketch below and look for a white frame and red, green and blue bars from top to bottom.
- Open the Serial Monitor at 9600 baud; sending r rotates the image by 90 degrees and i inverts the colors.
- If red and blue are swapped or one edge of the frame is missing, change the TAB line in the code and upload again.
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}
64In 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
| Symptom | Likely cause | Fix |
|---|---|---|
| Red shows as blue and blue as red | RGB/BGR color order mismatch | Switch between BLACKTAB and GREENTAB/REDTAB; TFT_RGB_ORDER in TFT_eSPI |
| Black is white, colors look negative | Panel runs in inversion mode | invertDisplay(true) or TFT_INVERSION_ON |
| 1–3 pixel colored garbage strip at the edge | Wrong memory start offset | Try GREENTAB; GREENTAB2 and GREENTAB3 in TFT_eSPI |
| Image mirrored | Different scan direction (MADCTL) | Try another tab or change the setRotation value |
| All-white screen | Init commands aren't arriving | Check CS, A0 and RESET wires and the 3.3 V logic conversion |
| Completely black screen | Backlight not powered | Connect the LED pin to 3.3 V |
| Very slow drawing | Software SPI or fillScreen every frame | Use the hardware SPI pins and redraw only what changes |
| Screen breaks when the SD card is inserted | Both devices' CS LOW at the same time | Separate CS pins, set both HIGH at the start of setup |
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.
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}
78Three 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.
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
22Note: 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.
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}
59In 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.
Projects to build after reading this
See all projects
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.

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.

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.

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.

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.

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.

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.

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.
More articles
BlueGrays app
Build this circuit step by step on your phone
Wiring diagram, code and parts list on one screen. 500+ Arduino, ESP32, ESP8266, Pico, mBot and micro:bit projects ready to build.
Scan with your phone
Point your camera at the code and your phone's app store opens.
or open the store

