Hey guys, its Nick again, welcome once again to educ8s.tv a channel that is all about DIY electronics projects with Arduino, Raspberry Pi, ESP8266 and other popular boards. Today we are going to look at how to drive the low cost, big, Arduino 3.5″ Color TFT display. At the end of this tutorial, we would have learned how to use this interesting display with the Arduino Uno and Mega boards.
The display is quite big and offers a resolution of 480×320 pixels. It is based on the ILI9481 TFT driver, comes with an SD card slot at the back and it is pre-soldered with pins for easy mount on the Arduino Uno, which is nice since there are not many big TFT displays that work with the Arduino Uno.
Few weeks ago, I discovered this Arduino 3.5″ Color TFT display on Banggood.com and thought it will be useful in some of our projects because of its size and its low price. The price of the display is very low for such a big display, it costs 10$ and banggood.com were kind enough to send me a sample unit in order to test it and share my opinion about it with you.
As shown in the video, we will be performing simple tasks with the display to demonstrate how it works and how you can integrate it in your project. I will be performing demos such as showing how Images stored on an SD card and inserted into the SD slot of the display can be shown on the display.
Components Required and Where to Buy
The following components are required to follow and build this project and they can all be bought by clicking the link in front of them.
- 3.5″ Color TFT:Â https://educ8s.tv/part/ColorTFT35
- Cheap Uno:Â https://educ8s.tv/part/ArduinoUno
- Arduino Mega:Â https://educ8s.tv/part/ArduinoMega
- Powerbank:Â https://educ8s.tv/part/Powerbank
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]
Schematics
Connecting the module to the Arduino is very easy. Since the module comes in a shield form, all we need to do is to snap it onto the top of the Arduino Uno as shown in the image below.
One of the few downsides to this display is the amount of the Arduino pins it uses. If we don’t use the SD card slot, we will be left with 6 digitals pins and one analog pin which can be connected to other modules or sensors. but when we use the SD card module part of the display, we will be left with just 2 digital and one analog pin which at times limits what we the kind of project for which we can use this display but fortunately, this display is also compatible with the Arduino Mega board which offers many more digital pins to work with, so when you need extra pins, and size is not an issue, use the mega. Unfortunately, this display does not work with some other Arduino Uno form factor based boards like the Arduino Due or the Wemos D1 ESP8266 board due to pin compatibility and library Issues. The Wemos D1, in particular, has just one analog pin and the display requires 5.
With the display mounted on the Arduino, we are ready to run some sample codes on it.
Code
To use this display, we will need the libraries which can found on the product page on banggood.com. All we have to do is to install the library and load any of the examples that are designed for this shield. Since the display uses the familiar Adafruit libraries, we can easily build several impressive projects. I have developed a simple program just to demonstrate how easy it is to use the display thanks to the Adafruit libraries! It uses some of the basic functions in order to display text and simple graphics. You can download the code of this simple example for the Arduino 3.5″ Color TFT display by clicking on the download link below or by clicking on the link in the description of the video.
To briefly explain the code, as usual, the first thing we do is include the libraries we will be working with.
#include <Adafruit_GFX.h> #include <Adafruit_TFTLCD.h>
Next, we declare the pins of the Arduino to which our LCD is connected to, after which we declare colors for the fonts and its matching hex value.
#define LCD_CS A3 #define LCD_CD A2 #define LCD_WR A1 #define LCD_RD A0 #define LCD_RESET A4 #define BLACK 0x0000 #define BLUE 0x001F #define RED 0xF800 #define GREEN 0x07E0 #define CYAN 0x07FF #define MAGENTA 0xF81F #define YELLOW 0xFFE0 #define WHITE 0xFFFF
Next, we create an object of the TFTLCD library with the pins to which the LCD is connected to on the Arduino as arguments.
Adafruit_TFTLCD tft(LCD_CS, LCD_CD, LCD_WR, LCD_RD, LCD_RESET);
With this done, we then write the void setup() function. To begin we clear the LCD of previous settings, then set the type LCD we are using via the LCD.begin function. With this done, we set the rotation of the TFT and proceed to fill the screen with different colors.
void setup() { tft.reset(); tft.begin(0x9481); tft.setRotation(1); tft.fillScreen(RED); tft.fillScreen(GREEN); tft.fillScreen(BLUE); tft.fillScreen(BLACK); delay(1000);
Next, we display some text, which includes one reminding you to subscribe!
tft.setCursor(80,100);
tft.setTextColor(WHITE);
tft.setTextSize(4);
tft.print("Hello");
tft.setCursor(220,100);
tft.setTextColor(RED);
tft.setTextSize(4);
tft.print("YouTUBE!");
tft.fillRect(80,200, 321, 60, RED);
tft.setCursor(135,215);
tft.setTextColor(WHITE);
tft.setTextSize(4);
tft.print("Subscribe");
tft.drawRect(0,0,480,320,WHITE);
delay(1000);
Next, we move to the void loop section.
The void loop section basically echoes some of the things we tried under the void setup function. The idea behind all of this is to show you what is possible with this wonderful display.
void loop() { tft.fillRect(80,200,321,60,BLACK); delay(1000); tft.fillRect(80,200,321,60,RED); tft.setCursor(135,215); tft.setTextColor(WHITE); tft.setTextSize(4); tft.print("Subscribe"); delay(1000); }
The full code can be downloaded by clicking the link below.
——————–
CODE OF THE PROJECT
——————–
Upload the code to your Arduino and you should see the display come alive as shown in the image below.
That’s it for today’s tutorial guys, thanks for reading/watching. If you get stuck at any point while building this project, feel free to reach out to me via the comment section, I will be glad to answer whatever questions you might have. Don’t forget to share, like and subscribe on youtube. Thanks!
SUBSCRIBE ON YOUTUBE
——————–
Never miss a video: Subscribe to educ8s.tv
Hello Sir !
which library can i used for this display //there is no any download files belongs to library.Please give me a download links for libraries
thank you
Hello Sir,
Great video but it does not work for me :-( …
I download librairies with the link in the description on http://www.banggood.com/ web site and I install it on my arduino IDE.
And then I try your sketch but on my arduino uno but the screen stay always white :-( …
Have you any idea or suggestion to debug tjis trouble ?
Thank you !
Hello, try to use the Arduino IDE version that I use in the video. The latest version of the IDE won’t work unfortunately.
which version did u use
yes which????
1.6.8 version
yep same for me but have you find the solution
https://github.com/prenticedavid/MCUFRIEND_kbv/tree/master/examples try this
could we make a music player using the kind of scrolling mechanism a phone has using this screen.
I just need to know if we could make scrolling type mechanism into my tft if yes need some help as well!!
waiting for your reply
Hello. I ask if it works with Arduino clone due
It is a fraud , it does not work at all.
It always gives compiling error for arduino UNO
What version…
Hi I need 3.5 utft lidaray plz
Hello, I tried the libraries you mention and your demo code with the 3.5″ display and an arduino mega board and it works fine. However, drawPixels and drawLines commands are not working. Do you have any clue of what could be happening?
Hi guys,
I’ve an display which has an inscription saying “3.5” TFTLCD for arduino 2560(ili9481)” I’ve tried different drivers like TFT_HX8357 and UTFT from mcufriend but both of them does not work.
I’m using it on Arduino Mega 2560 R3
When ever I try to Load the program the display remains blank with white color backlight
Can you guys please help me make this work.
its very imp to me beacause i am fresher and my senior give mi this project
Hi,
I have an ILI 9481 and an Arduino Leonardo. Unfortunately, the demo does not work. Display stays white.
what can I do?
remplacer LCD_CD par LCD_RS.
ligne 5 et 19.
voila
hello sir
i have the same display and the libraries works fine with it but i am not able to draw a graph on it there is a TFT function which asks for cs,dc and rst, i dont know any dc pin on it.
i think i have same issue.
if your LCD does not work try this library https://github.com/prenticedavid/MCUFRIEND_kbv/tree/master/examples
Thank you! It worked perfectly. I wonder why this example doesn’t work.
If the LCD does not work tray this libraries they did work for me
https://shop.boxtec.ch/tft-lcd-shield-for-arduino-unomega-ili9481-p-42762.html
Hello can anyone help me?
I am using 3.5 uno tft driver: ILI9486
and I am not finding the right library for this kind of lcd i have..
Probably a bit late now, but I found this worked for me,
https://github.com/prenticedavid/MCUFRIEND_kbv/tree/master/examples
Hello,
I bought this kit from Banggood that finally arrived (link below).
https://www.banggood.com/Geekcreit-MEGA-2560-R3-ATmega2560-MEGA2560-Development-Board-3_5-Inch-TFT-Color-Display-320×480-Screen-p-1626622.html?rmmds=search&cur_warehouse=CN
Need to know pin alignments to snap these two boards together.
Please help.
Thanks,
Henry
tengo el mismo mudulo y arduino uno ya copie el codigo, per la pantalla solo me muestra una luz blanca no se cual es error, alguna solucion?
Where do I find Adafruit_TFTLCD.h
Thanks
#include
#include
#include
MCUFRIEND_kbv tft;
#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_RS A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A0 // LCD Read goes to Analog 0
#define LCD_RST A4 // Can alternately just connect to Arduino’s reset pin
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
INSTA ID : ALI.BAKHTIYARI66
#include
#include
#include
MCUFRIEND_kbv tft;
#include SPI.h
#include Adafruit_GFX.h
#include MCUFRIEND_kbv.h
MCUFRIEND_kbv tft;