The ILI9341 2.8" TFT display, manufactured by Ilitek, is a versatile and compact graphical display module. It features a 240x320 pixel resolution and an integrated touchscreen interface, making it ideal for projects requiring both visual output and user interaction. This display is widely used in embedded systems, IoT devices, and DIY electronics projects due to its vibrant color rendering, touch functionality, and compatibility with popular microcontrollers like Arduino and Raspberry Pi.
Below are the key technical details of the ILI9341 2.8" TFT display:
Parameter | Specification |
---|---|
Manufacturer | Ilitek |
Part ID | ILI9341 2.8" Touch |
Display Type | TFT LCD |
Screen Size | 2.8 inches |
Resolution | 240x320 pixels |
Color Depth | 16-bit (65,536 colors) |
Touchscreen Type | Resistive or Capacitive (varies) |
Interface | SPI (Serial Peripheral Interface) |
Operating Voltage | 3.3V (logic level) |
Backlight Voltage | 3.3V to 5V |
Current Consumption | ~50mA (typical, backlight on) |
Controller IC | ILI9341 |
Operating Temperature | -20°C to 70°C |
The ILI9341 2.8" TFT display typically has the following pinout:
Pin | Name | Description |
---|---|---|
1 | VCC | Power supply for the display (3.3V or 5V, depending on the module). |
2 | GND | Ground connection. |
3 | CS | Chip Select pin for SPI communication. |
4 | RESET | Reset pin to initialize the display. |
5 | DC (RS) | Data/Command pin to differentiate between data and command signals. |
6 | SDI (MOSI) | SPI Master Out Slave In (data input to the display). |
7 | SCK | SPI Clock pin. |
8 | LED | Backlight control pin (connect to 3.3V or 5V for constant backlight). |
9 | T_IRQ | Touchscreen interrupt pin (used for touch detection). |
10 | T_CS | Chip Select pin for the touchscreen controller. |
11 | T_CLK | SPI Clock pin for the touchscreen controller. |
12 | T_DIN | SPI data input for the touchscreen controller. |
13 | T_DO | SPI data output from the touchscreen controller. |
Note: Some modules may have slight variations in pin configuration. Always refer to the specific datasheet for your module.
To use the ILI9341 2.8" TFT display with an Arduino UNO, follow these steps:
Wiring the Display: Connect the pins of the display to the Arduino as shown below:
ILI9341 Pin | Arduino Pin |
---|---|
VCC | 3.3V |
GND | GND |
CS | D10 |
RESET | D9 |
DC (RS) | D8 |
SDI (MOSI) | D11 |
SCK | D13 |
LED | 3.3V or 5V |
T_CS | D4 |
T_CLK | D13 |
T_DIN | D11 |
T_DO | D12 |
T_IRQ | D2 |
Install Required Libraries:
Adafruit_GFX
and Adafruit_ILI9341
libraries from the Arduino Library Manager.Adafruit_STMPE610
library (if using a resistive touchscreen).Example Code: Below is an example sketch to display text and detect touch input:
#include <Adafruit_GFX.h> // Graphics library
#include <Adafruit_ILI9341.h> // ILI9341 driver library
#include <Adafruit_STMPE610.h> // Touchscreen library
// Define pins for the display
#define TFT_CS 10
#define TFT_DC 8
#define TFT_RST 9
// Define pins for the touchscreen
#define TS_CS 4
// Create display and touchscreen objects
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
Adafruit_STMPE610 ts = Adafruit_STMPE610(TS_CS);
void setup() {
// Initialize serial communication
Serial.begin(9600);
// Initialize the display
tft.begin();
tft.setRotation(1); // Landscape orientation
tft.fillScreen(ILI9341_BLACK);
tft.setTextColor(ILI9341_WHITE);
tft.setTextSize(2);
tft.println("ILI9341 TFT Display");
// Initialize the touchscreen
if (!ts.begin()) {
Serial.println("Touchscreen not found!");
while (1);
}
Serial.println("Touchscreen initialized.");
}
void loop() {
// Check for touch input
if (ts.touched()) {
TS_Point p = ts.getPoint();
// Map touch coordinates to screen coordinates
int x = map(p.x, 0, 240, 0, tft.width());
int y = map(p.y, 0, 320, 0, tft.height());
// Draw a circle at the touch point
tft.fillCircle(x, y, 5, ILI9341_RED);
// Print touch coordinates to the serial monitor
Serial.print("Touch at: ");
Serial.print(x);
Serial.print(", ");
Serial.println(y);
}
}
The display does not turn on:
No image on the screen:
Adafruit_ILI9341
library is correctly installed and initialized.Touchscreen not responding:
Adafruit_STMPE610
library is installed and initialized.Flickering or distorted display:
By following this documentation, you can successfully integrate the ILI9341 2.8" TFT display with touch functionality into your projects.