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.

Hardware Required:

  • Arduino UNO board
  • 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.

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.

The following video shows my simple hardware circuit test:

And this one shows Proteus simulation (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

Leave a Reply

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