ESP32 UNO - 2.25 inch TFT LCD Display Screen 76x284
The ESP32 Uno puts an ESP32 chip on a board with the familiar Uno layout, so Uno-style wiring carries over, but at 3.3V and with Wi-Fi. That makes it an easy home for the 2.25 inch TFT LCD display screen, a 76x284 color bar that connects directly without a level converter. In this guide, you will see:
- How the board's D labels map to the ESP32 GPIO numbers used in the code.
- How to wire the display to the D13 and D11 header pins.
- How to turn on the active-LOW backlight.
- How to draw a set of shapes across the screen.
- How to show text and numbers.
- How to draw a picture stored in flash.
- How to use an external font.
- How to move the display from VSPI to HSPI without rewiring.
- How to measure drawing speed with a benchmark.

Hardware Preparation
| 1 | × | ESP32 Uno-form Board | |
| 1 | × | USB Cable Type-A to Type-C (for USB-A PC) | |
| 1 | × | USB Cable Type-C to Type-C (for USB-C PC) | |
| 1 | × | 2.25 inch TFT LCD Display Screen 76x284 | |
| 1 | × | Jumper Wires |
Or you can buy the following kits:
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Overview of the 2.25 inch TFT LCD Display Screen 76x284
The 2.25 inch TFT LCD display screen is a long, narrow color panel with 76 x 284 pixels. It is driven by an ST7789 chip, which receives drawing commands over SPI. The panel has no touch layer, and its shape suits status bars, level meters, clocks and scrolling text.
| Item | Value |
|---|---|
| Screen size | 2.25 inch (diagonal) |
| Resolution | 76 x 284 pixels (284 x 76 in landscape) |
| Panel | IPS, wide viewing angle |
| Driver chip | ST7789 |
| Interface | SPI, write only (no MISO pin) |
| Colors | 16-bit RGB565 (65,536 colors) |
| Touch | No |
| Backlight | Active-LOW (on when BL is LOW) |
The ST7789 chip has memory for a 240 x 320 picture, but this panel shows only a 76 x 284 window in the middle of that memory. When you create the display object with the size 76 x 284, the DIYables_TFT_SPI library picks the right settings for this panel: it shifts every drawing call into that window, uses the panel's color order, and sets a 20 MHz SPI clock. You simply draw with screen coordinates, starting from (0, 0) at the top-left corner.
Pinout
The display module has 8 pins:
| Pin | Function |
|---|---|
| GND | Ground |
| VCC | Power supply (3.3V) |
| SCL | SPI clock (SCK) |
| SDA | SPI data input (MOSI) - data from the ESP32 Uno to the display |
| RST | Hardware reset |
| DC | Data / Command select - HIGH for pixel data, LOW for commands |
| CS | Chip Select - LOW selects the display on the SPI bus |
| BL | Backlight - active-LOW: LOW (GND) turns the backlight on, HIGH turns it off |
Note — SCL and SDA are SPI pins: The names SCL and SDA are often used for I2C, but on this module they are the SPI clock (SCK) and the SPI data line (MOSI). Connect them to the hardware SPI pins of the ESP32 Uno, not to its I2C pins.
Note — no MISO pin: The display only receives data, so it has no MISO (SDO) pin. The library never reads from the display, so nothing is missing.

Wiring Diagram
Note — the backlight is active-LOW: Connect BL to GND to turn the backlight on. If BL is connected to 3.3V, the backlight stays off and the screen looks black even when the code is running. To switch the backlight from code instead, connect BL to a free pin and call TFT_display.initBacklight(pin, true); the true tells the library that the backlight is active-LOW.
Note: The ESP32 Uno uses 3.3V logic. Connect the display's VCC to the 3.3V pin.
Note — GPIO numbers: The code uses the ESP32's GPIO numbers, not the D labels printed on the board: D10 = GPIO5, D3 = GPIO25, D9 = GPIO13, D13 = GPIO18 and D11 = GPIO23.
Connect SCL to D13 (GPIO18) and SDA to D11 (GPIO23), the hardware SPI pins of the ESP32 Uno. RST, DC and CS can use any free digital pins - D9 (GPIO13), D3 (GPIO25) and D10 (GPIO5) are used in the examples.
| Display Pin | ESP32 Uno Pin | Description |
|---|---|---|
| GND | GND | Ground |
| VCC | 3.3V | Power supply (3.3V) |
| SCL | D13 (GPIO18) | SPI clock (SCK) |
| SDA | D11 (GPIO23) | SPI data (MOSI) |
| RST | D9 (GPIO13) | Reset |
| DC | D3 (GPIO25) | Data / Command select |
| CS | D10 (GPIO5) | Chip Select |
| BL | GND | Backlight on (active-LOW) |

This image is created using Fritzing. Click to enlarge image
Library Installation
- Connect the ESP32 Uno to your computer with a USB cable.
- Open Arduino IDE, select the right board and port.
- Navigate to the Libraries icon on the left bar of the Arduino IDE.
- Search "DIYables_TFT_SPI", then find the DIYables_TFT_SPI library by DIYables.
- Click Install button to install the latest version of the library.
- When prompted to install dependencies, click Install All to also install the Adafruit GFX Library.
- Search for DIYables TFT SPI created by DIYables.io and click the Install button.
Note: If this is your first ESP32 project, install the esp32 board package by Espressif from the Boards Manager, then select ESP32 Dev Module as the board.
Basic Structure
Every sketch for this display starts from the same few lines:
- Always pass 76, 284 - the width and height in portrait. This size tells the library to use the settings of the 2.25 inch panel. With another size, the picture appears shifted or not at all.
- Rotation 0 and 2 are portrait (76 pixels wide, 284 tall). Rotation 1 and 3 are landscape (284 wide, 76 tall). All examples in this tutorial use landscape.
- begin() uses a 20 MHz SPI clock. You can pass another clock, for example TFT_display.begin(10000000) for 10 MHz, if long jumper wires cause noise on the screen.
ESP32 Uno Code - Draw Shapes
The DrawShapes example draws two rows of shapes across the long screen: outlined and filled circles and triangles plus a diamond outline on the top row, and outlined and filled rectangles and rounded rectangles plus a filled diamond on the bottom row. It uses the drawing functions of the Adafruit GFX Library.
Detailed Instructions
- Wire the display to the ESP32 Uno as shown in the wiring diagram above.
- Connect the ESP32 Uno to your computer with a USB cable.
- Open Arduino IDE, select the right board and port.
- Copy the above code and paste it to the editor of Arduino IDE.
- Click Upload button on Arduino IDE to upload code to the ESP32 Uno.
- The screen shows two rows of colored shapes on a white background.
API Summary
| Method | Description | Example |
|---|---|---|
| TFT_display.begin() | Initialize the display. Call once in setup(). | TFT_display.begin(); |
| TFT_display.setRotation(r) | Set screen orientation. 1 = landscape (284 x 76). | TFT_display.setRotation(1); |
| TFT_display.fillScreen(color) | Fill the entire screen with one color. | TFT_display.fillScreen(WHITE); |
| DIYables_TFT_SPI::colorRGB(r,g,b) | Convert RGB values to a 16-bit color. | DIYables_TFT_SPI::colorRGB(255, 0, 0) |
| TFT_display.drawCircle(x,y,r,color) | Draw a circle outline. | TFT_display.drawCircle(30, 20, 15, RED); |
| TFT_display.fillCircle(x,y,r,color) | Draw a filled circle. | TFT_display.fillCircle(30, 20, 15, RED); |
| TFT_display.drawTriangle(x0,y0,x1,y1,x2,y2,color) | Draw a triangle outline. | TFT_display.drawTriangle(10, 34, 46, 34, 28, 6, BLUE); |
| TFT_display.fillRoundRect(x,y,w,h,r,color) | Draw a filled rectangle with rounded corners. | TFT_display.fillRoundRect(10, 44, 44, 26, 6, PINK); |
| TFT_display.drawLine(x0,y0,x1,y1,color) | Draw a line. | TFT_display.drawLine(0, 0, 283, 75, GREEN); |
ESP32 Uno Code - Show Text and Number
The ShowTextAndNumber example prints text and numbers with the built-in font, the way you would show sensor readings: a temperature and a humidity value in magenta on a white background. Text size 2 makes each character 12 x 16 pixels, so two lines fit comfortably in the 76-pixel height.
Detailed Instructions
- Wire the display to the ESP32 Uno as shown in the wiring diagram above.
- Connect the ESP32 Uno to your computer with a USB cable.
- Open Arduino IDE, select the right board and port.
- Copy the above code and paste it to the editor of Arduino IDE.
- Click Upload button on Arduino IDE to upload code to the ESP32 Uno.
- The screen shows two lines: Temperature: 23.5°C and Humidity: 78.6%.
API Summary
| Method | Description | Example |
|---|---|---|
| TFT_display.setTextColor(color) | Set the text color. | TFT_display.setTextColor(MAGENTA); |
| TFT_display.setTextSize(size) | Set the text scale (1 = 6 x 8 pixels, 2 = 12 x 16 pixels, ...). | TFT_display.setTextSize(2); |
| TFT_display.setCursor(x, y) | Move the text cursor. | TFT_display.setCursor(10, 14); |
| TFT_display.print(value) | Print a string or a number at the cursor. | TFT_display.print(23.5, 1); |
| TFT_display.println(value) | Print, then move the cursor to the next line. | TFT_display.println("C"); |
ESP32 Uno Code - Draw Image
The DrawImage example draws a 120 x 53 pixel color picture in the middle of the screen, then inverts its colors every 2 seconds. The pixels are stored in flash memory in the companion file bitmap.h as a const uint16_t array, so they do not use any RAM. The picture is wider than 76 pixels, so it only fits in landscape.
Detailed Instructions
- Wire the display to the ESP32 Uno as shown in the wiring diagram above.
- Place bitmap.h in the same folder as the sketch.
- Connect the ESP32 Uno to your computer with a USB cable.
- Open Arduino IDE, select the right board and port, paste the code, and click Upload.
- The picture appears in the middle of the screen. Every 2 seconds, its colors invert and then return to normal.
API Summary
| Method | Description | Example |
|---|---|---|
| TFT_display.drawRGBBitmap(x,y,bitmap,w,h) | Draw an RGB565 bitmap from flash memory at position (x, y). | TFT_display.drawRGBBitmap(82, 11, myBitmap, 120, 53); |
| TFT_display.invertDisplay(on) | Invert all colors on the screen (true) or show them normally (false). | TFT_display.invertDisplay(true); |
| TFT_display.width() / TFT_display.height() | Get the screen size for the current rotation. | int x = (TFT_display.width() - 120) / 2; |
ESP32 Uno Code - Use External Font
The UseExternalFont example prints the same two readings with FreeSansBold12pt7b, one of the fonts included in the Adafruit GFX Library. External fonts have smooth, proportional characters that look much better than the built-in 5 x 7 font. Call setFont(NULL) at any time to go back to the built-in font.
Detailed Instructions
- Wire the display to the ESP32 Uno as shown in the wiring diagram above.
- Connect the ESP32 Uno to your computer with a USB cable.
- Open Arduino IDE, select the right board and port.
- Copy the above code and paste it to the editor of Arduino IDE.
- Click Upload button on Arduino IDE to upload code to the ESP32 Uno.
- The screen shows the temperature and humidity in a smooth, bold font. This font has no degree sign, so the temperature is shown as 23.5 C.
API Summary
| Method | Description | Example |
|---|---|---|
| TFT_display.setFont(&FontName) | Switch to an Adafruit GFX font. Pass NULL to return to the built-in font. | TFT_display.setFont(&FreeSansBold12pt7b); |
| TFT_display.setCursor(x, y) | With an external font, y is the baseline of the text (the bottom of letters without descenders), not the top. | TFT_display.setCursor(10, 30); |
| TFT_display.print(text) | Print a string with the active font. | TFT_display.print("Humidity: "); |
ESP32 Uno Code - Custom SPI
The CustomSPI example passes the SPI bus to the display object as the last argument of the constructor. This matters on boards that have more than one SPI bus, or when you want to make the bus choice clear in the code.
The ESP32 Uno has two hardware SPI buses for your devices: VSPI and HSPI. The sketch uses VSPI (&SPI), whose pins are D13 (GPIO18) and D11 (GPIO23). The ESP32 can route either bus to these pins, so you can move the display to HSPI without rewiring: uncomment the two HSPI lines and the hspi.begin(18, 19, 23, -1) line in setup(), and comment out the VSPI #define MY_SPI &SPI line.
Detailed Instructions
- Wire the display to the ESP32 Uno as shown in the wiring diagram above.
- Connect the ESP32 Uno to your computer with a USB cable.
- Open Arduino IDE, select the right board and port.
- Copy the above code and paste it to the editor of Arduino IDE.
- Click Upload button on Arduino IDE to upload code to the ESP32 Uno.
- The screen shows three color bars - red, green and blue - with the text Custom SPI bus OK.
API Summary
| Method | Description | Example |
|---|---|---|
| DIYables_ST7789_SPI(w,h,cs,dc,rst,spi) | Constructor with the SPI bus as the last argument. Without it, the library uses &SPI. | DIYables_ST7789_SPI TFT_display(76, 284, TFT_CS_PIN, TFT_DC_PIN, TFT_RST_PIN, &SPI); |
| TFT_display.begin() | Initialize the display on the selected SPI bus. | TFT_display.begin(); |
ESP32 Uno Code - Display Test
The ColligateTest example is a full graphics benchmark laid out for this long, low screen. It runs 14 tests - text, triangle-function curves, a sine wave, filled rectangles, round rectangles, circles and triangles, grid lines, and random pixels, lines and shapes - and measures how long each one takes. The results are shown on the screen in two pages and printed on the Serial Monitor. It is also a quick way to check that every part of the wiring works.
Detailed Instructions
- Wire the display to the ESP32 Uno as shown in the wiring diagram above.
- Connect the ESP32 Uno to your computer with a USB cable.
- Open Arduino IDE, select the right board and port, paste the code, and click Upload.
- Open the Serial Monitor at 9600 baud.
- The screen runs the tests one by one, then shows the time of each test. The same times are printed on the Serial Monitor. After a few seconds, the test starts again.
Troubleshoot
If the code is not working, there are some common issues you can troubleshoot:
- Screen stays black: The backlight is off. Check that BL is connected to GND, not to 3.3V. Then check VCC and GND.
- Backlight is on but the screen stays white: The display does not receive commands. Check that SCL is on D13 (GPIO18) and SDA is on D11 (GPIO23), and that CS, DC and RST are on the pins defined in the code.
- Picture is shifted, cut off, or has random pixels along the edges: The constructor must use the portrait size 76, 284 - not 284, 76 and not another size.
- Colors look wrong, or the screen shows noise: Use the latest version of the DIYables_TFT_SPI library. If you use long jumper wires, try a lower SPI clock, for example TFT_display.begin(10000000);.