Welcome to another Arduino video tutorial! In this video, we are going to take a first look at this 2.8” Color TFT Touch display! It is a big, low-cost touch display which is very easy to use. Without any further delay, let’s get started.
Intro to the Arduino 2.8″ ILI9341 Tutorial
Hello guys, I am Nick and welcome to educ8s.tv a channel that is all about DIY electronics projects with Arduino, Raspberry Pi, ESP8266, ESP32 and other popular boards. If you are new here, welcome, be sure to subscribe and check the previous videos on the channel.
Today we are going to learn how to drive the 2.8” Touch display with the ILI9341 driver with an Arduino Uno and an ESP32 board. First of all, let’s take a close look at the display itself. The display is big, and it offers a resolution of 320×240 pixels. Compared to one of my favorites displays, the 1.8” Color TFT display you can see it a lot larger. The screen also offers touch functionality which is an added bonus and an SD card slot at the back. It uses the SPI interface, so the connection with the Arduino is very straightforward. The cost of the display is relatively low; it costs around 11$ which in my opinion is a fair price for what this display offers.
——————–
WHERE TO BUY
——————–
2.8″ Inch Display: https://educ8s.tv/part/28ILI9341
Arduino Uno: https://educ8s.tv/part/ArduinoUno
Resistors: https://educ8s.tv/part/Resistors
Arduino Pro Mini: https://educ8s.tv/part/ArduinoProMini
ESP32: https://educ8s.tv/part/ESP32
STM32: https://educ8s.tv/part/STM32
DS3231 RTC: https://educ8s.tv/part/DS3231
Breadboard: https://educ8s.tv/part/SmallBreadboard
Wires: https://educ8s.tv/part/Wires
Full disclosure: All of the links above are affiliate links. I get a small percentage of each sale they generate. Thank you for your support!
[adsense]
Another thing I like about this display is that it does not come as a shield like the touch display we were using so far. This way, we can connect the display to any board, the Arduino Pro mini, the STM32, the ESP8266 and the ESP32. This is very important because we now have a low-cost display that we can use with every board. Until now, the only touch display we could use with these boards were the Nextion displays which are more expensive, and to be honest even though I use them from time to time, I don’t really like them.
Connection with the Arduino Uno
Now let’s see how to connect this display to an Arduino Uno. The first 9 pins of the display are the power pins and the SPI pins. So, if we connect only the first 9 pins of the display, we can use it as a regular display without touch functionality. The display uses 3.3-volt logic levels and unfortunately, it is not 5V tolerant. So, we need to use some 10K resistors if we want to drive it with a board that uses 5V logic levels like the Arduino Uno.
We connect the display to the Arduino Uno according to this schematic diagram.
As you can see, we have connected Vcc to 5V of the Arduino Uno and the SPI pins of the display to the hardware SPI pins of the Arduino Uno. Let’s load a demo sketch now. As you can the 8bit Arduino Uno with only 2KBs of RAM can drive this big display! But as you can see it is very slow in updating the screen. It takes many seconds to update the whole screen which is a pity. It can display text with more speed though. It is obvious that the Arduino Uno is not enough to drive a display with such a high resolution. It is obvious that we need a more powerful board to drive this display effectively.
But can we build a useful project using this display? I wanted to find out, so I decided to build a simple real-time clock and temperature monitor. I added a DS3231 RTC module, and I modified the code of a previous project to use the new bigger display. You can find the code of the project in a link in the description below. The result is not that bad as the demo sketch. The project works fine, but of course, there is a small delay when the values on the screen are updated. In my opinion, this project demonstrates that we can use this display with an 8bit Arduino only on very simple projects that update the screen rarely.
Before moving to the more capable ESP32 board, let’s try to use the touch functionality of the display. We connect the remaining 5 pins according to this schematic diagram, and we are ready to upload the second sketch to the board.
To my surprise, the touch demo works relatively fast! It is a simple sketch in which we draw on the screen using this stylus. I think this result is impressive if we take into consideration that this display is driven by an 8bit board.
ESP32 and the ILI9341 Display
Let’s now connect the display to an ESP32 board. If you are not familiar with it, the ESP32 is a very fast and inexpensive Arduino compatible board. I prepared a detailed review of this board a few months ago; you can watch it by clicking on the card here. Since the ESP32 board uses 3.3V logic levels, we don’t need any resistors to drive the display. So, if we don’t need the touch functionality, we connect the display according to this schematic diagram.
If we upload the same sketch that used before on the Arduino Uno, we can see the ESP32 is extremely fast. It can update the display, draw graphics and complete the demo sketch way faster than the Arduino Uno.
Unfortunately, the touch demo is not compatible with the ESP32 board yet, so I didn’t have the chance to try the touch functionality of the display. I will prepare another video about the ESP32 board and this display soon. First I want to test more libraries and find a touch library that works with the ESP32 chip and build a simple demo sketch. Stay tuned.
Let’s now see the software side of the project. In order to use this display with Arduino, we need to install the Adafruit ILI9341 driver and the familiar Adafruit GFX library if we don’t use the touch functionality. If we want to use the touch functionality, we have also to install the URtouch library. You can find links to all the libraries needed along with the code of the demo programs I showed you in the description below.
——————–
LIBRARIES
——————–
? Adafruit GFX: https://github.com/adafruit/Adafruit-GFX-Library
? Adafruit ILI9341: https://github.com/adafruit/Adafruit_ILI9341
? URtouch: http://www.rinkydinkelectronics.com/library.php?id=92
As a final thought, I believe this display is a great display to use for our future projects. I think I am going to use this display a lot with the ESP32, and STM32 boards because it is easy to use, offers touch functionality and it is relatively inexpensive. I am going to build a complete project around this display soon, to test it even more, and see what is capable of.
I would love to hear your opinion on this display. Have you ever used it in your projects, or are you going o use it in the future? Do you have any project ideas that we could build using this display? Please post your comments below and don’t forget to like the video if you find it useful. Thanks!
——————–
CODE
——————–
My favourite project now in bigger screen looks superb . Can you please design even a simple 3d printed case for this ? Will be grateful.
Thank you once more .
Yes, I will try to build one. It is going to be a cool little project completed.
I have built the arduino project and it works fantastic, the screen is much clear then the 1.8 screen.
I have tried to get the ESP-WROOM-32
it looks like the graphic version, but all the labels are different. it is very different to the one in your video.
Can you give me the labels that each colour should go to.on ESP and LCD display ILI9341 .
ESP was bought through your link.
hoping you can help
Regards
Mark Laurence
Hello Mark! Thanks for the comment. Yes, there is a new version of the board available now, which has different pins. I have bought one of these and I will try it soon. I will prepare another guide for this board. Cheers!
I was curious if you would know why I get a blank screen when I try to run the code with InitTouch(); in the setup. If I comment it out of the code it will finally display the graphics but of course, it won’t let me use the touch screen. Any ideas?
Hi Nick! GREAT VIDEO !!!
All the functions works really great but the touch screen function don’t works…
I have the same display as yours with the touch screen function so i think the problem is in the code.
I tried to repair it but I have not got it. If you or someone can helpme I would be very thankful !!!
Dear All,
I have the same Problem. Display works well, but the touch function is out of order. I have checked the code and libaries but do not find the bug. May be someone else has a hint.
Hi, How can I wire the SD card integrated to arduino nano?
hi, the date and time is wrong hope someone can help me?
Hi! We also got the wrong date and temperature. We get Monday, 165/165/216 45:165 Temp: -1,8 C
Hi, Code without touch works very well, but if i wire touch and want to upload the code, arduino says: Arduino:
URTouch.h:30:42: error: hardware/avr/HW_AVR_defines.h: No such file or directory
compilation terminated.
exit status 1
hardware/avr/HW_AVR_defines.h: No such file or directory
What is it?
Regards Andreas
Is it possible to use the clock sketch with ESP8266? Thank you
10k resistors slow down SPI badly. I’d rather go with voltage divider. 2.2K LCD-PIN 4.7K GND
It’s day and night. Also reset can be connected directly to reset pin on arduino instead of dedicating a port to it.
Wehn I try to install the URTouch library using the Add Library .ZIP i get an error for ” urtouch.h:65:3 regsize’ does not name a type”..
How to fix it..
Hi, i was searching and realize that error is because the code and library is for arduino and not to the nodemcu :C
Resistors =10k ? Look like red,red,Brown =220 ohms ??
I absolutly LOVE your videos!!!
They are fun to listen to…. love the caring and attention to detail voice..
Your videos on so many subjects are informative and…many things of course we already know… but perhaps we did it years ago, or similar things…. and you remind us clearly of the wiring and software etc…
Great site mate…. keep up the really great work.
do you have a video for the ESP32 or the ESP8266… with the 2.8tft… with TOUCH capability ?
Im familiar with lots of these screen…and like you i like the 1.8 inch tft :o)
But not really ventured out into the Touch screen…. I am using an SPI interface….or any ideas?
thanks Ian Moore
Hello,
I would love to get your program working, but no change. I tried different programs all work but your program I’m not getting to work with my display.
See the fault codes here after:
C:\Program Files\Arduino Programme\TFT Display ILI9314\ILI9341 Arduino DemoPrograms\Arduinographicstest\ILI9341 Test.ino:82:18: error: redefinition of ‘Adafruit_ILI9341 tft’
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_RST);
^~~
C:\Program Files\Arduino Programme\TFT Display ILI9314\ILI9341 Arduino DemoPrograms\Arduinographicstest\Arduinographicstest.ino:25:18: note: ‘Adafruit_ILI9341 tft’ previously declared here
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_CLK, TFT_RST, TFT_MISO);
^~~
C:\Program Files\Arduino Programme\TFT Display ILI9314\ILI9341 Arduino DemoPrograms\Arduinographicstest\ILI9341 Test.ino: In function ‘void setup()’:
C:\Program Files\Arduino Programme\TFT Display ILI9314\ILI9341 Arduino DemoPrograms\Arduinographicstest\ILI9341 Test.ino:100:6: error: redefinition of ‘void setup()’
void setup() // Start of setup
^~~~~
C:\Program Files\Arduino Programme\TFT Display ILI9314\ILI9341 Arduino DemoPrograms\Arduinographicstest\Arduinographicstest.ino:27:6: note: ‘void setup()’ previously defined here
void setup() {
^~~~~
C:\Program Files\Arduino Programme\TFT Display ILI9314\ILI9341 Arduino DemoPrograms\Arduinographicstest\ILI9341 Test.ino: In function ‘void loop()’:
C:\Program Files\Arduino Programme\TFT Display ILI9314\ILI9341 Arduino DemoPrograms\Arduinographicstest\ILI9341 Test.ino:185:6: error: redefinition of ‘void loop()’
void loop() // Start of loop
^~~~
C:\Program Files\Arduino Programme\TFT Display ILI9314\ILI9341 Arduino DemoPrograms\Arduinographicstest\Arduinographicstest.ino:99:6: note: ‘void loop()’ previously defined here
void loop(void) {
^~~~
Mehrere Bibliotheken wurden für “SPI.h” gefunden
Benutzt: C:\Users\onsca\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.2\libraries\SPI
Mehrere Bibliotheken wurden für “Adafruit_GFX.h” gefunden
Benutzt: C:\Program
Nicht benutzt: C:\Program
Mehrere Bibliotheken wurden für “Adafruit_ILI9341.h” gefunden
Benutzt: C:\Program
Bibliothek Adafruit_GFX_Library in Version 1.7.4 im Ordner: C:\Program Files\Arduino wird verwendet
Bibliothek Adafruit_ILI9341 in Version 1.5.4 im Ordner: C:\Program Files\Arduino wird verwendet
Bibliothek SPI in Version 1.0 im Ordner: C:\Users\onsca\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.2\libraries\SPI wird verwendet
exit status 1
Fehler beim Kompilieren für das Board Arduino Uno.
Cqhfoyf
cbos@bright.net
:
Sorry just a white blank screen. Following the schematics in the code. Becorse the frizzing schematics seems wrong.
I give up on it
Greetings
I have a TFT LCD Touch Screen 3.2 “SPI ILI9341 but, I can’t calibrate the Touch Screen with the URTouch library. It arrives at the INSTRUCTIONS screen and, when I click with the pen, the screen doesn’t continue.
The TFT Display normally works with the UTFT library. I configure the pins on the Arduino Mega as follows:
UTFT myGLCD (ILI9341_S5P, 51, 52, 10, 9, 8); // UTFT myGLCD (Model, SDI, SCK, CS, RST, DC);
URTouch myTouch (6, 5, 4, 3, 2); // T_CLK, T_CS, T_DIN, T_DO, T_IRQ
With all the pins connected via a CD4050BE.
Would you have any tips, please? Thank you
The screen can work with both 5v and 3.3v ? So do we really need resistors?
No level shifter needed, board has Tolerance of 5- 3.3V
I have an issue, the display works great however the touch screen does not work. It worked once then disappeared and is not registering that it is being touched by the stylus. How can I fix this?
Nick’s ILI9341 Real Time Clock Project
I have a 96 year-old mother who struggles a little to remember the day and date, and I thought this project may help.
I played around with the text size and placement a little to make it a little easier to read on a 3.5” screen. Photo https://i.ibb.co/qy5yt1S/IMG-9102.jpg
In the code the Day and Date are printed in a single line, which I have spread over two lines by increasing the text size and adding some spaces.
However, what I would really like to do is print both the day and the date on two separate lines so that the day could be in larger text with a different colour.
Unfortunately, my skills are not good and I have had no success in achieving this.
Does anyone have any pointers to how this can be achieved?
Thanks
je vous propose ce site pour la bibliothèque URTouch: http://www.rinkydinkelectronics.com/library.php?id=92
Hello, Nick
My drawing is completely shifted on my ILI9341 2.8 touch screen so I have to draw all the way down to the right
Hello, Mark
You need to calibrate