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.

  1. 3.5″ Color TFT: https://educ8s.tv/part/ColorTFT35
  2. Cheap Uno: https://educ8s.tv/part/ArduinoUno
  3. Arduino Mega: https://educ8s.tv/part/ArduinoMega
  4. 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.

Connecting the Display

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.

Demo

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