Interfacing Arduino with ILI9341 color TFT display

This Arduino tutorial shows how to interface the Uno board with ILI9341 TFT display.
The ILI9341 TFT module contains a display controller with the same name: ILI9341. It’s a color display that uses SPI interface protocol and requires 4 or 5 control pins, it’s low cost and easy to use. The resolution of this TFT display is 240 x 320 which means it has 76800 pixels. This module works with 3.3V only and it doesn’t support 5V (not 5V tolerant).
TFT: Thin-Film Transistor.
SPI: Serial Peripheral Interface.

About the ILI9341 TFT Display Module:
The ILI9341 is a popular TFT display controller, used in small to medium-sized displays for embedded systems and DIY projects. It is widely utilized in various electronic projects due to its rich set of features and simplicity. Here are some key features and specifications of the ILI9341 TFT display module:

  • Resolution: 240×320 pixels.
  • Screen Size: Typically around 2.2 to 3.2 inches diagonally.
  • Color Depth: 16-bit (65K colors) to 18-bit (262K colors).
  • Interface: SPI (Serial Peripheral Interface.
  • Backlight: LED backlight.
  • Touchscreen Capability: Most ILI9341 displays come with a resistive touchscreen with an integrated touch screen controller (XPT2046).
  • SD Card slot: Some ILI9341 display modules come with SD card slot, this removes the need for an external SD card module.

The image shows the ILI9341 TFT module with integrated component details:

ILI9341 TFT display module interfacing

The ILI9341 display module shown above has a built-in 5V to 3.3V LDO regulator labeled as U2, the part number of this regulator is: XC6206P332MR (662K). The display module can operate with 3.3V or 5V depending on the state of jumper J1, closing the jumper will bypass the LDO regulator and configure the display to work with 3.3V only.

The ILI9341 display module consists of XPT2046 resistive touch screen controller ( —datasheet— ). This controller adds the touch screen functionality to the display.
The small transistor Q1 is used for display backlight control.

ILI9341 TFT Display Pinout:
The pinout for an ILI9341 TFT display can vary depending on the used module. For the display module shown above, pinout configuration are listed below according to their functionality.

Display Pins:

  • VCC: Power supply pin, 3.3V or 5V.
  • GND: Ground.
  • CS: Chip Select pin, active low.
  • RESET: Display reset pin, active low.
  • D/C: Data/Command pin, select data or command input mode to the display, low for data mode and high for command mode.
  • SDI (MOSI): Master-Out Slave-In pin, SPI data input to the display.
  • SCK: SPI clock input to the display.
  • LED: Backlight LED pin
  • SDO/MISO: Master-In Slave-Out pin, SPI data output from the display.

Touch Screen Controller Pins (SPI Interface):

  • T_CLK: Clock input.
  • T_CS: Chip Select pin.
  • T_DIN: Data input.
  • T_DO: Data output.
  • T_IRQ: Interrupt output.

SD Card Slot Pins:

  • SD_CS: Chip Select.
  • SD MOSI: SPI data input to the SD card.
  • SD_MISO: SPI data output from the SD card.
  • SD_SCK: SPI clock input to the SD card.

Hardware Required:
Required components are listed below.

  • Arduino UNO (or similar) board   —> Board details
  • ILI9341 TFT display module
  • 5 x 3.3k ohm resistor
  • 5 x 2.2k ohm resistor
  • Breadboard
  • Jumper wires

Arduino uno with ILI9341 TFT display

Interfacing Arduino with ILI9341 TFT display circuit:
Hardware circuit diagram of the example is shown below.

Arduino ILI9341 color TFT display interfacing circuit

The ILI9341 TFT display board which is shown in the circuit diagram above has 14 pins, the first 9 pins are for the display and the other 5 pins are for the touch module.
So, the display side pins which numbered from 1 to 9 are (from left to right): VCC (5V), GND (ground), CS (chip select), RST (reset), DC (or D/C: data/command), MOSI (or SDI), SCK (clock), BL (back light LED) and MISO (or SDO).
MOSI: master-out slave-in.
SDI: serial data in.
MISO: master-in slave-out.
SDO: serial data out.

As mentioned above, the ILI9341 TFT display controller works with 3.3V only (power supply and control lines). The display module is supplied with 5V that comes from the Arduino board. This module has a built-in 3.3V regulator which supplies the display controller with 3.3V from the 5V source.

All Arduino UNO board output pins are 5V, connecting a 5V pin to the ILI9341 TFT display may damage its controller.
To connect the Arduino to the display module, I used voltage divider for each line which means there are 5 voltage dividers. Each voltage divider consists of 2.2k and 3.3k resistors, this drops the 5V into 3V which is sufficient.

So, the ILI9341 TFT display is connected to the Arduino board as follows (each one through voltage divider):
CS pin is connected to Arduino digital pin 8,
RST pin is connected to Arduino digital pin 9,
D/C pin is connected to Arduino digital pin 10,
MOSI pin is connected to Arduino digital pin 11,
SCK pin is connected to Arduino digital pin 13.

Other pins are connected as follows:
VCC pin is connected to Arduino 5V pin,
GND pin is connected to Arduino GND pin,
BL (LED) pin is connected to Arduino 5V pin,
MISO pin is not connected.

Interfacing Arduino with ILI9341 TFT display code:
The following Arduino code requires two libraries from Adafruit Industries:
The first library is a driver for the ILI9341 TFT display which can be installed from Arduino IDE library manager (Sketch —> Include Library —> Manage Libraries …, in the search box write “ili9341” and choose the one from Adafruit).

The second library is Adafruit graphics library which can be installed also from Arduino IDE library manager.

The previous two libraries can also be installed manually:
Download both libraries from the following two links:
Adafruit ILI9341 TFT library   —->  direct link
Adafruit graphics library        —->  direct link

Go to Arduino IDE —> Sketch —> Include Library —> Add .ZIP Library … and browse for the .zip file (previously downloaded).
The same thing for the second file.

This example was tested with the following library versions:
Adafruit ILI9341 Library: 1.6.0.
Adafruit GFX Library: 1.11.9.

The previous 2 libraries are included in the main code as shown below:

The ILI9341 TFT display is connected to Arduino hardware SPI module pins (clock and data), the other pins which are: CS (chip select), RST (reset) and DC (data/command) are defined as shown below:

Full Arduino code:
The following Arduino code is from Adafruit ILI9341 library (graphicstest.ino) with some modifications in order to work with the above circuit diagram.

Interfacing Arduino with ILI9341 TFT Display Video:
The following video shows my DIY hardware test circuit.

Arduino with ILI9341 Display Proteus Simulation Video:
The video below shows Proteus simulation of Arduino UNO board with ILI9341 display (not perfect result!):
Note that Proteus simulation circuit is not the same as real hardware circuit, project hardware circuit diagram is shown above.

Proteus simulation file download link is below, use version 8.6 or higher to open it:
Arduino and ILI9341 TFT Proteus simulation


Discover more from Simple Circuit

Subscribe to get the latest posts sent to your email.

13 thoughts on “Interfacing Arduino with ILI9341 color TFT display”

  1. You’re really confusing when you make this statement:
    This module works with 3.3V only and it doesn’t support 5V (not 5V tolerant).

    Then the wiring diagram shows 5 volts from the Uno being used.

    1. As mentioned above, for the +5V power supply:
      This module has a built-in 3.3V regulator which supplies the display controller with 3.3V from the 5V source.
      and for control/data pins:
      To connect the Arduino to the display module, I used voltage divider for each line which means there are 5 voltage dividers. Each voltage divider consists of 2.2k and 3.3k resistors, this drops the 5V into 3V which is sufficient.

  2. Peter Armstrong

    The initialising line doesn’t seem right. Are you sure of the order of paramaters.
    This worked for me: I defined all the pins
    Adafruit_ILI9341 tft = Adafruit_ILI9341(T_CS, T_DC, T_MOSI, T_CLK, T_RST, T_MISO);
    Do you have RST in the wrong place?

  3. Hello folks! Well, I suppose, using D3 as PWM-Output to have a dimmable LED-Backlight would be a really good idea: pinMode(3,OUTPUT); analogWrite(3,200);

  4. Hi, I got UNO R3 and this type of display fitting directly in the UNO r3. But my screen stays white. Is this because I need more power or? Feeding from the USB from a MacBookPro. The power supply is coming, but like to going on.

    Any suggestions/Ideas?

  5. I think the J1 solderable link allows the ILI9341 display to be powered from a 3.3v source. The ILI9341 specs say max. of 3.3v operation hence the 3.3v LDO regulator on board. How long the display lasts when fed with 5v with J1 bridged may not matter of course.

  6. On the displays that i bought (ILI9431s) there is a jumper on the back of the unit marked JI. I have seen some documentation that claims this sets the display to work with 5 volt logic from a UNO/NANO, etc. I am trying to confirm that but wonder is you know the answer to this. The shield version works fine and must have logic level converters built in.
    Thanks, Jack

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top