Components · 8 min read

GC9A01 ESP32: 1.28 inch Round TFT Display with TFT_eSPI, Sprites

GC9A01 ESP32 guide: wire the 1.28 inch 240x240 round SPI display, set up TFT_eSPI, draw a clock face and gauge, animate flicker-free with sprites. Pico code.

Pairing a GC9A01 with an ESP32 is the most popular way to build round interfaces such as smartwatches, car gauges or robot eyes. The GC9A01 is the driver chip behind 1.28 inch, 240×240 pixel round IPS TFT displays, and it talks to the microcontroller over a fast SPI bus. The display shows 65 thousand colors, looks sharp from every angle and has no empty corners like square screens; a clock face or analog gauge fits it naturally. Thanks to the ESP32's speed and memory you can draw smooth animation at 25–30 frames per second on it.

In this article you'll learn the module's pins and how to wire it to an ESP32 and a Raspberry Pi Pico, the TFT_eSPI library's User_Setup configuration, which is where most people get stuck, a clock face with a sweeping second hand and a colorful gauge driven by a potentiometer. To stop the animations flickering we'll use a memory buffer called a sprite and work out how much RAM it needs. Finally we'll draw the same gauge in MicroPython on the Pico. If you're not familiar with SPI, read the what is SPI article first.

What is the GC9A01 round display?

The GC9A01 is a driver that manages the display's own memory (GRAM) and scan timing. The microcontroller first defines a window, then sends the colors of the pixels inside that window one after another; each pixel is 16 bits in RGB565 format (5 bits red, 6 bits green, 5 bits blue). The memory is a square 240×240, but because the glass is cut round, only the circle with a 120 pixel radius from the center is visible; anything you draw in the corners disappears. That's why you need to position text and hands relative to the center and think in polar coordinates (angle and radius). The modules usually only write over SPI; there's no MISO pin, so nothing is read back from the display. If you're curious about square screens from the same family, see the ST7789 TFT display article.

FeatureValue
Size1.28 inch, visible area about 32.4 mm across
Resolution240×240 (only the 120 px radius circle is visible)
Panel and colorIPS, 65K colors (RGB565, 16-bit)
Interface4-wire SPI: SCK, MOSI, CS, DC + RST, write only
Voltage3.3 V logic; VCC 3.3–5 V on most modules (regulated)
Typical SPI speed27–40 MHz on the ESP32, 80 MHz on good modules
Full-screen data240 × 240 × 2 = 115,200 bytes

Pins and wiring

On cheap modules the pins are usually labelled VCC, GND, SCL, SDA, DC, CS, RST, and some have an extra BL pin for the backlight. The SCL and SDA labels here are misleading: this display uses SPI, not I2C; SCL is the clock (SCK) and SDA the data output (MOSI). The DC pin tells the display whether a byte is a command or data, CS selects the display and RST resets the driver at startup. On the ESP32 we use GPIO 18 (SCK) and GPIO 23 (MOSI), the default pins of the hardware VSPI bus; you can put the other three on any output pins as long as they match the values in User_Setup. On the Pico we use the SPI1 pins GP10 (SCK) and GP11 (MOSI).

Display pinFunctionESP32Raspberry Pi Pico
VCCSupply3V33V3(OUT)
GNDGroundGNDGND
SCL / CLKSPI clock (SCK)GPIO 18GP10
SDA / DINSPI data (MOSI)GPIO 23GP11
CSChip selectGPIO 5GP9
DCData / commandGPIO 2GP8
RSTResetGPIO 4GP12
BL (if present)Backlight3V3 or GPIO 22GP13
GC9A01 modules use 3.3 V logic. On most modules the VCC input is regulated and accepts 5 V, but the data pins are not 5 V tolerant. If you want to connect one to an Arduino Uno you need a level shifter on every signal line; on top of that the Uno's 2 KB of RAM isn't enough even for a small sprite buffer and full-screen drawing stays very slow. Use an ESP32, ESP32-S3 or Pico for this display.

TFT_eSPI setup (User_Setup.h)

Bodmer's TFT_eSPI library is the fastest and most feature-rich display library for the ESP32, but its settings aren't made in the sketch; they live in the User_Setup.h file in the library folder. Install TFT_eSPI from the Library Manager, open libraries/TFT_eSPI/User_Setup.h in your Arduino folder, comment out the other driver lines (e.g. ILI9341_DRIVER) and leave the lines below enabled. Without this step the code compiles fine but the screen stays white or black. Updating the library overwrites this file; keep a copy of your settings, or select the ready-made User_Setups/Setup46_GC9A01_ESP32.h from User_Setup_Select.h and edit the pins there.

Code
1// TFT_eSPI kütüphane klasöründeki User_Setup.h: yalnız bu satırlar açık kalsın
2// User_Setup.h in the TFT_eSPI library folder: keep only these lines enabled
3#define GC9A01_DRIVER
4#define TFT_WIDTH  240
5#define TFT_HEIGHT 240
6
7#define TFT_MOSI 23   // Ekranın SDA / DIN pini / Display SDA / DIN pin
8#define TFT_SCLK 18   // Ekranın SCL / CLK pini / Display SCL / CLK pin
9#define TFT_CS    5   // Yonga seçimi / Chip select
10#define TFT_DC    2   // Veri / komut / Data / command
11#define TFT_RST   4   // Reset
12// #define TFT_BL 22  // Arka ışığı koddan yönetmek istersen / To control the backlight from code
13
14#define LOAD_GLCD     // Font 1 (8 px)
15#define LOAD_FONT2    // Font 2 (16 px)
16#define LOAD_FONT4    // Font 4 (26 px)
17#define LOAD_FONT6    // Font 6 (48 px, yalnız rakam / digits only)
18#define SMOOTH_FONT
19#define SPI_FREQUENCY 40000000   // 40 MHz; sorun olursa 27000000 / if unstable use 27000000
20

Step by step: first test

  1. Wire the display to the ESP32 as in the table; connect VCC to 3V3 and, if there's a BL pin, tie it to 3V3 for now.
  2. Install TFT_eSPI and edit User_Setup.h with the lines above. Don't forget to save the file; the settings are read from it on every compile.
  3. Upload a simple example from File > Examples > TFT_eSPI (e.g. Colour_Test under Test and diagnostics) and check that the colors look right.
  4. If red and blue are swapped, add #define TFT_RGB_ORDER TFT_BGR to User_Setup; if the colors look inverted, add tft.invertDisplay(true) to the code.
  5. If the test works, move on to the clock face and gauge code below.

Drawing a clock face with the ESP32

ESP32 development board
The ESP32's hardware SPI and hundreds of KB of RAM make smooth full-screen sprite animation on the GC9A01 possible.

The most natural use of a round display is an analog clock. To find the tip of a hand we use polar coordinates: if the angle is measured clockwise from 12 o'clock, the end point is x = 120 + length × sin(angle), y = 120 − length × cos(angle) (on screen, y grows downwards). The second hand turns 6° per second, the minute hand 6° per minute and the hour hand 30° per hour; because we add the fraction of the next smaller unit to the hour and minute hands, they move without jumping. The code starts the clock from the compile time (__TIME__) and counts with millis(); for a real clock you can get the time from the internet with ESP32 NTP. For anti-aliased hands we use TFT_eSPI's drawWedgeLine(): because the start and end widths can differ, the hands taper towards the tip.

C++ (Arduino IDE)
1// GC9A01 yuvarlak ekranda analog saat kadranı (ESP32 + TFT_eSPI + sprite)
2// Analog clock face on a GC9A01 round display (ESP32 + TFT_eSPI + sprite)
3#include <TFT_eSPI.h>
4
5TFT_eSPI tft;
6TFT_eSprite face(&tft);          // 240x240 bellek tamponu / 240x240 memory buffer
7const int CX = 120, CY = 120, R = 118;
8const uint16_t DIAL = 0x18E3;    // Koyu gri kadran / Dark grey dial
9uint32_t baseSeconds;            // Derleme anının gün içi saniyesi / Compile time as seconds of day
10unsigned long baseMillis;
11
12void handPoint(float angleDeg, float len, float &x, float &y) {
13  // 0° = saat 12, saat yönünde artar / 0° = 12 o'clock, increases clockwise
14  float a = angleDeg * DEG_TO_RAD;
15  x = CX + len * sin(a);
16  y = CY - len * cos(a);
17}
18
19void drawFace(int h, int m, float s) {
20  face.fillSprite(TFT_BLACK);
21  face.fillSmoothCircle(CX, CY, R, DIAL, TFT_BLACK);
22  for (int i = 0; i < 60; i++) {                     // Dakika ve saat çizgileri / Minute and hour ticks
23    bool hourMark = (i % 5 == 0);
24    float x0, y0, x1, y1;
25    handPoint(i * 6, R - 4, x0, y0);
26    handPoint(i * 6, hourMark ? R - 18 : R - 10, x1, y1);
27    face.drawWedgeLine(x0, y0, x1, y1, hourMark ? 2.5 : 1, hourMark ? 2.5 : 1,
28                       hourMark ? TFT_WHITE : TFT_DARKGREY, DIAL);
29  }
30  face.setTextColor(TFT_WHITE, DIAL);
31  face.setTextDatum(MC_DATUM);                       // Yazıyı ortala / Center the text
32  face.drawString("12", CX, CY - 82, 4);
33  face.drawString("3", CX + 82, CY, 4);
34  face.drawString("6", CX, CY + 82, 4);
35  face.drawString("9", CX - 82, CY, 4);
36
37  float x, y;
38  handPoint(((h % 12) + m / 60.0) * 30, 55, x, y);   // Akrep / Hour hand
39  face.drawWedgeLine(CX, CY, x, y, 6, 2, TFT_WHITE, DIAL);
40  handPoint((m + s / 60.0) * 6, 85, x, y);           // Yelkovan / Minute hand
41  face.drawWedgeLine(CX, CY, x, y, 4, 1.5, TFT_WHITE, DIAL);
42  handPoint(s * 6, 95, x, y);                        // Akıcı saniye / Sweeping second hand
43  face.drawWedgeLine(CX, CY, x, y, 2, 1, TFT_RED, DIAL);
44  face.fillSmoothCircle(CX, CY, 5, TFT_RED, DIAL);
45
46  face.pushSprite(0, 0);                             // Tek seferde ekrana / Push to screen in one go
47}
48
49void setup() {
50  Serial.begin(115200);
51  tft.init();
52  tft.setRotation(0);
53  tft.fillScreen(TFT_BLACK);
54  face.setColorDepth(16);
55  if (face.createSprite(240, 240) == nullptr) {      // 115 KB yoksa 8 bit dene / If 115 KB is not free, try 8-bit
56    face.setColorDepth(8);
57    face.createSprite(240, 240);
58  }
59  const char* t = __TIME__;                          // "hh:mm:ss"
60  baseSeconds = atoi(t) * 3600UL + atoi(t + 3) * 60UL + atoi(t + 6);
61  baseMillis = millis();
62}
63
64void loop() {
65  float total = baseSeconds + (millis() - baseMillis) / 1000.0;
66  int h = (int)(total / 3600) % 24;
67  int m = ((int)total / 60) % 60;
68  float s = fmod(total, 60.0);
69  drawFace(h, m, s);
70  delay(20);                                         // Yaklaşık 25 kare/sn / About 25 frames per second
71}
72

Flicker-free animation with sprites

To move a hand directly on the screen you erase the old position and draw the new one. Because the display shows both steps, the hand flickers. A sprite is a RAM buffer that acts as a copy of the screen: you first draw the whole frame in that buffer, then send it to the display in one go with pushSprite(0, 0) at close to DMA speed. Since the display never sees a half-drawn frame, flicker disappears completely. The cost is memory: a 240×240 pixel, 16-bit sprite needs 115,200 bytes. On a classic ESP32 without PSRAM this usually fits, but with Wi-Fi on the largest free memory block can shrink; that's why the code automatically falls back to 8-bit color if createSprite() fails. At 40 MHz SPI a full-screen sprite takes about 23 ms to send, so you get smooth motion close to 30 frames per second.

Color depth240×240 spriteColorsWhen to use
16-bit115,200 bytes65.536Default, best image
8-bit57,600 bytes256Low memory, together with Wi-Fi
4-bit28,800 bytes16 (palette)Simple gauges, few colors
Partial sprite (e.g. 120×120, 16-bit)28,800 bytes65.536Refresh only the changing area

Drawing a gauge

The second example shows the value of a potentiometer on GPIO 34 as a 0–100 gauge; swapping the potentiometer for a temperature, speed or battery value takes only a few lines. TFT_eSPI's drawSmoothArc() draws arcs with anti-aliased edges. In this function angles follow a different rule: 0° is the 6 o'clock position and the angle increases clockwise, so 90° is 9 o'clock and 180° is 12 o'clock. Because we place the gauge between 30° and 330°, a 60° gap remains at the bottom and the value text sits there. First a grey track is drawn, then a colored arc up to the value: green up to 60%, yellow up to 85% and red above. The needle direction is calculated with the same angle rule: x = 120 − sin(angle) × r, y = 120 + cos(angle) × r. The displayed value moves 15% towards the target each frame, so the needle glides smoothly even on sudden changes.

C++ (Arduino IDE)
1// GC9A01 gösterge (gauge): potansiyometre değeri, titremesiz sprite (ESP32 + TFT_eSPI)
2// GC9A01 gauge: potentiometer value, flicker-free sprite (ESP32 + TFT_eSPI)
3#include <TFT_eSPI.h>
4
5TFT_eSPI tft;
6TFT_eSprite spr(&tft);
7const int POT_PIN = 34;                 // ADC1 pini, yalnız giriş / ADC1 pin, input only
8const int START = 30, END = 330;        // TFT_eSPI açısı: 0° = saat 6, saat yönünde / 0° = 6 o'clock, clockwise
9float shown = 0;                        // Ekrandaki (yumuşatılmış) değer / Displayed (smoothed) value
10
11uint16_t zoneColor(float v) {
12  if (v < 0.6) return TFT_GREEN;        // Normal
13  if (v < 0.85) return TFT_YELLOW;      // Uyarı / Warning
14  return TFT_RED;                       // Tehlike / Danger
15}
16
17void drawGauge(float v) {               // v: 0.0–1.0
18  spr.fillSprite(TFT_BLACK);
19  int valAngle = START + (END - START) * v;
20  spr.drawSmoothArc(120, 120, 116, 100, START, END, 0x2104, TFT_BLACK, true);   // Gri iz / Grey track
21  if (valAngle > START + 1) {
22    spr.drawSmoothArc(120, 120, 116, 100, START, valAngle, zoneColor(v), TFT_BLACK, true);
23  }
24  for (int i = 0; i <= 10; i++) {       // 11 ölçek çizgisi / 11 scale ticks
25    float a = (START + (END - START) * i / 10.0) * DEG_TO_RAD;
26    float sx = -sin(a), sy = cos(a);
27    spr.drawWedgeLine(120 + sx * 92, 120 + sy * 92, 120 + sx * 80, 120 + sy * 80, 2, 2, TFT_WHITE, TFT_BLACK);
28  }
29  float a = valAngle * DEG_TO_RAD;      // İbre / Needle
30  spr.drawWedgeLine(120, 120, 120 - sin(a) * 74, 120 + cos(a) * 74, 6, 1, TFT_ORANGE, TFT_BLACK);
31  spr.fillSmoothCircle(120, 120, 10, TFT_DARKGREY, TFT_BLACK);
32
33  char txt[6];
34  snprintf(txt, sizeof(txt), "%d", (int)(v * 100 + 0.5));
35  spr.setTextDatum(MC_DATUM);
36  spr.setTextColor(TFT_WHITE, TFT_BLACK);
37  spr.drawString(txt, 120, 168, 6);     // Font 6: yalnız rakamlar / digits only
38  spr.drawString("%", 120, 202, 4);
39  spr.pushSprite(0, 0);
40}
41
42void setup() {
43  tft.init();
44  tft.setRotation(0);
45  tft.fillScreen(TFT_BLACK);
46  if (spr.createSprite(240, 240) == nullptr) {
47    spr.setColorDepth(8);               // Bellek azsa 8 bit renk / 8-bit color if memory is low
48    spr.createSprite(240, 240);
49  }
50  analogReadResolution(12);             // 0–4095
51}
52
53void loop() {
54  long sum = 0;
55  for (int i = 0; i < 16; i++) sum += analogRead(POT_PIN);   // Gürültü süzgeci / Noise filter
56  float target = (sum / 16) / 4095.0;
57  shown += (target - shown) * 0.15;     // İbre hedefe yumuşakça gider / Needle eases to the target
58  drawGauge(shown);
59  delay(15);
60}
61

GC9A01 with Raspberry Pi Pico (MicroPython)

To work with MicroPython on the Pico we use russhughes' pure-Python gc9a01py driver: just copy gc9a01py.py from the repository to the Pico with Thonny. The driver takes an SPI object and the DC, CS, RST and BL pins, and pushes a buffer to the display with blit_buffer(). For flicker-free drawing we create a 115,200-byte full-screen buffer with MicroPython's built-in framebuf module; the Pico's 264 KB of RAM handles that easily at startup. There's one subtlety: framebuf writes RGB565 colors in little-endian order, while the display wants big-endian. The c565() function swaps the bytes in advance, otherwise the colors look completely wrong. Because poly() is used for the arcs and ellipse() for the circles, you need MicroPython 1.20 or newer. You can also drive the same display with the Arduino-Pico core and TFT_eSPI; you just write the Pico pins into User_Setup.

MicroPython
1# GC9A01 + Raspberry Pi Pico (MicroPython): framebuf ile titremesiz gösterge
2# GC9A01 + Raspberry Pi Pico (MicroPython): flicker-free gauge with framebuf
3# gc9a01py.py sürücüsünü (russhughes) Pico'ya kopyala / copy the gc9a01py.py driver to the Pico
4import gc, math, framebuf
5from array import array
6from machine import Pin, SPI, ADC
7import gc9a01py as gc9a01
8
9spi = SPI(1, baudrate=40_000_000, sck=Pin(10), mosi=Pin(11))   # SCL = GP10, SDA = GP11
10tft = gc9a01.GC9A01(spi, dc=Pin(8, Pin.OUT), cs=Pin(9, Pin.OUT),
11                    reset=Pin(12, Pin.OUT), backlight=Pin(13, Pin.OUT), rotation=0)
12pot = ADC(26)                                # GP26 = ADC0
13
14W = H = 240
15gc.collect()
16buf = bytearray(W * H * 2)                  # 115 200 bayt tam ekran tamponu / full-screen buffer
17fb = framebuf.FrameBuffer(buf, W, H, framebuf.RGB565)
18
19def c565(r, g, b):
20    # framebuf küçük endian yazar, ekran büyük endian ister: baytları çevir
21    # framebuf writes little-endian, the display wants big-endian: swap bytes
22    c = ((r & 0xF8) << 8) | ((g & 0xFC) << 3) | (b >> 3)
23    return ((c & 0xFF) << 8) | (c >> 8)
24
25BLACK, WHITE, GREY = c565(0, 0, 0), c565(255, 255, 255), c565(40, 40, 40)
26GREEN, YELLOW, RED, ORANGE = c565(0, 200, 0), c565(255, 200, 0), c565(255, 0, 0), c565(255, 120, 0)
27START, END = 30, 330                         # 0° = saat 6, saat yönünde / 0° = 6 o'clock, clockwise
28
29def point(a_deg, r):
30    a = math.radians(a_deg)
31    return int(120 - math.sin(a) * r), int(120 + math.cos(a) * r)
32
33def zone(v):
34    return GREEN if v < 0.6 else (YELLOW if v < 0.85 else RED)
35
36def big_text(s, cx, y, scale, color):
37    # 8x8 yazıyı büyüterek çiz / draw the 8x8 font scaled up
38    w = len(s) * 8
39    small = bytearray((w + 7) // 8 * 8)
40    sf = framebuf.FrameBuffer(small, w, 8, framebuf.MONO_HLSB)
41    sf.text(s, 0, 0, 1)
42    x0 = cx - w * scale // 2
43    for yy in range(8):
44        for xx in range(w):
45            if sf.pixel(xx, yy):
46                fb.fill_rect(x0 + xx * scale, y + yy * scale, scale, scale, color)
47
48def draw(v):
49    fb.fill(BLACK)
50    fb.ellipse(120, 120, 117, 117, GREY, True)   # Gri iz / Grey track
51    fb.ellipse(120, 120, 100, 100, BLACK, True)
52    end = START + (END - START) * v
53    col = zone(v)
54    a = START
55    while a < end:                               # Değer yayı, 5° dilimler / Value arc, 5° slices
56        b = min(a + 5, end)
57        x0, y0 = point(a, 100); x1, y1 = point(a, 117)
58        x2, y2 = point(b, 117); x3, y3 = point(b, 100)
59        fb.poly(0, 0, array("h", [x0, y0, x1, y1, x2, y2, x3, y3]), col, True)
60        a = b
61    for i in range(11):                          # Ölçek çizgileri / Scale ticks
62        x0, y0 = point(START + 30 * i, 92)
63        x1, y1 = point(START + 30 * i, 80)
64        fb.line(x0, y0, x1, y1, WHITE)
65    tip = point(end, 74)                         # Üçgen ibre / Triangle needle
66    l = point(end + 90, 5)
67    r = point(end - 90, 5)
68    fb.poly(0, 0, array("h", [tip[0], tip[1], l[0], l[1], r[0], r[1]]), ORANGE, True)
69    fb.ellipse(120, 120, 9, 9, GREY, True)
70    big_text("%d%%" % int(v * 100 + 0.5), 120, 160, 4, WHITE)
71    tft.blit_buffer(buf, 0, 0, W, H)             # Tek seferde ekrana / Push in one go
72
73shown = 0.0
74while True:
75    target = pot.read_u16() / 65535
76    shown += (target - shown) * 0.2
77    draw(shown)
78

Project ideas

  • Idea: a desk smartwatch with an ESP32 and a GC9A01 that gets the time over Wi-Fi and the temperature from a weather API, with a button to switch faces.
  • Idea: robot eyes with two GC9A01s; share SCK, MOSI, DC and RST, give each its own CS pin and draw the eyes in turn. For the OLED version see the ESP32 OLED robot eyes article.
  • Idea: a GPS speedometer for a bike or scooter; show the NEO-6M GPS speed on the gauge arc and the total distance in the middle.
  • Idea: an indoor air gauge; show the ppm value of an MH-Z19 CO2 sensor on a gauge with green, yellow and red zones.

Common mistakes and fixes

SymptomLikely causeFix
Screen stays white or blackAnother driver or wrong pins in User_SetupLeave only GC9A01_DRIVER enabled, compare pins with the wiring
Red and blue swappedColor order is BGR#define TFT_RGB_ORDER TFT_BGR
Colors look invertedPanel inversion differstft.invertDisplay(true) or false
Noise, random linesSPI speed too high for the wiringShorten wires, lower SPI_FREQUENCY to 27 MHz
Board crashes at startup or the sprite doesn't drawNot enough memory for the 115 KB spriteCheck createSprite's result, use 8-bit or a partial sprite
Colors completely wrong on the Picoframebuf byte order not swappedGenerate colors with c565()
When designing for a round display, keep everything important within 100 pixels of the center. Text near the edge gets clipped by the curve of the glass or becomes hard to read; as a first step, draw two circles with radii of 100 and 118 pixels to test the safe area.

Despite its small size, the GC9A01 round display gives very impressive results for clocks, gauges and eye animations; once you get the TFT_eSPI setup right, the rest is purely drawing and geometry. If you'd like to see the basics of showing time and sensor data on a screen step by step, check the wiring diagrams and code of the "ESP32 Real Time from the Internet with NTP", "ESP32 HTTPClient + Weather API (with SSD1306 OLED)" and "ESP32 LED Brightness with a Potentiometer (Analog → PWM)" projects in the BlueGrays app.

Frequently asked questions

How do you connect a GC9A01 display to an ESP32?

VCC goes to 3V3, GND to GND, SCL (SCK) to GPIO 18 and SDA (MOSI) to GPIO 23; this article uses GPIO 5, 2 and 4 for CS, DC and RST. Despite the SCL and SDA labels the display uses SPI and is not connected to the I2C pins. You must write the pins you use into TFT_eSPI's User_Setup.h exactly.

Why does my GC9A01 display stay white?

The most common cause is another driver still selected in TFT_eSPI's User_Setup.h, or pins that don't match the wiring. The code compiles without errors but the display is never initialised. Leave only the GC9A01_DRIVER line enabled, check the pins, then recompile and upload.

Does the GC9A01 work with an Arduino Uno?

Technically yes, but it isn't recommended. The display's data pins are 3.3 V, so the Uno needs a level shifter on every line. The Uno's 2 KB of RAM isn't enough for a sprite and full-screen drawing is very slow; an ESP32 or Raspberry Pi Pico gives far better results.

What is a sprite in TFT_eSPI and why does it prevent flicker?

A sprite is a drawing buffer in RAM that behaves like a copy of the screen. Because you finish the frame in this buffer first and then send it in one go with pushSprite(), the display never shows a half-drawn image. A 240×240 pixel, 16-bit sprite needs 115,200 bytes of RAM.

What SPI speed should I use for the GC9A01?

On the ESP32, 40 MHz works on most modules and sends a full-screen frame in about 23 ms. Good modules with short, tidy wiring can go up to 80 MHz. If you see noise or shifted images, drop the speed to 27 MHz and shorten the wires.

How do you use the GC9A01 with a Raspberry Pi Pico?

In MicroPython you copy russhughes' gc9a01py driver to the Pico, set up SPI1 on GP10 (SCK) and GP11 (MOSI) and pass the DC, CS, RST and BL pins. For flicker-free drawing you create a 115,200-byte buffer with framebuf and send it with blit_buffer(). Using TFT_eSPI with the Arduino-Pico core is also possible.

See all projects
Real-Time Clock from the Internet via ESP32 NTP
ES-26Advanced
Premium

Real-Time Clock from the Internet via ESP32 NTP

The ESP32 connects to Wi-Fi and fetches the real time from NTP (Network Time Protocol) servers with millisecond precision. configTzTime() applies the Turkey time zone (TRT, UTC+3) automatically, and in countries with daylight saving time the DST switch is handled by a POSIX TZ string. The time is printed both to the Serial Monitor and to an optional I2C LCD.

4.5(13)
22
Digital Clock with ESP32 and DS1307 RTC (I2C + LCD)
ES-18Intermediate
Premium

Digital Clock with ESP32 and DS1307 RTC (I2C + LCD)

In this project, we display the time and date on a 16x2 I2C LCD screen using the DS1307 real-time clock (RTC) module. The DS1307 is a battery-backed RTC that maintains the time even if the ESP32 is powered off. Both modules share the same I2C bus (SDA/SCL), allowing us to learn how to control multiple devices using just two signal wires. Through this project, you will gain practical knowledge of the I2C communication protocol, RTC module operation, and dynamic data display on an LCD screen.

4.6(26)
40
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 LED Brightness Control with a Potentiometer (Analog → PWM)
ES-13Intermediate
Premium

ESP32 LED Brightness Control with a Potentiometer (Analog → PWM)

In this project, we control the brightness of an LED analogically using a potentiometer. The ESP32's ADC pin reads the 0-3.3V voltage from the potentiometer, and this value is then converted into a PWM (Pulse Width Modulation) signal and sent to the LED. As a result, as you turn the potentiometer, the LED gradually brightens and dims. With Arduino Core 3.0+, analogWrite() can be used directly; on the ESP32-S2/S3, the ADC resolution is fixed at 12-bit.

4.4(20)
32
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 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
LED Blink with ESP32
ES-1Beginner

LED Blink with ESP32

Teaches basic GPIO output usage with ESP32. We achieve a blinking effect by turning an LED on and off from a digital pin. ESP32 version of the classic blink project on Arduino UNO; the basic blink commands in the Arduino environment are the same, but the ESP32's pin layout and 3.3 V GPIO levels differ from those of the Arduino UNO.

4.7(38)
114
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