TFT 1.8″ Display (ST7735R) with Arduino Uno

The 1.8″ display has 128×160 color pixels. Unlike the low cost “Nokia 6110” and similar LCD displays, which are CSTN type and thus have poor color and slow refresh, this display is a true TFT. TFT means Thin Film Transistor. The TFT driver (ST7735R) can display full 18-bit color. The LCD will always come with the same driver chip so there’s no worries that your code will not work from one to the other.
Both boards have the TFT soldered on as well as a ultra-low-dropout 3.3V regulator and a 3/5V level shifter so you can use it with 3.3V or 5V power and logic. These also include a microSD card holder so you can easily load full color bitmaps from a FAT16/FAT32 formatted microSD card.
DT018ATFT is a display module that contains a TFT display with a 160 * 128 RGB resolution. The driver used for this project is the Ilitek ILI9163C or compatible and can display 262K colors. The driver is mounted on the glass and the interconnection via FPC including components to drive the display module.
TFT LCD module has always been one of the hot products in DIY industry and LCD is basically the necessary products during all projects, at the same time, serial port modules are also the popular ones, because it takes few IO and the usage is simple. This section of the 1.8-inch TFT LCD serial SPI integrated features of compact, SPI interface.
The 1.8 TFT is a colorful display with 128 x 160 color pixels. The display can load images from an SD card – it has an SD card slot at the back. The following figure shows the screen front and back view.
This module uses SPI communication – see the wiring below. To control the display we’ll use the TFT library, which is already included with Arduino IDE 1.0.5 and later.
FEATURES OF TFT:
1. It is a 1.8 “SPI TFT LCD Screen Module, 9pins interface. Not just a LCD break but include SD card (2GB),
2. The LCD drive ic is ST7735S. It’s a 128 X 160 (resolution). The LCD has a wide viewing angle, the contrast is also very suitable.
3. The display interface is serial, it just needs 5 wires (CS, RS, SCL, SDA, RST) for controlling.
4. SDcard use hardware SPI interface (CS / MOSI / MISO / SCK), Not solder pins.
PARAMETERS:
A. LED 3.3V IO and Power Supply pin.
B. LED UTFT Support.
C. SCL Serial clock input.
D. SDA/SDI Serial data input.
E. DC:Data/Command selection.
F. RST:Reset Low level active.
G. CS:Chip Selection,Low level active.
H. GND:Ground.
I. VDD33:3.3V Power Supply pin.
IMPORTANT POINTS:
1. Lite – this is the PWM input for the backlight control. Connect to 3-5VDC to turn on the backlight. Connect to ground to turn it off. Or, you can PWM at any frequency.
2. MISO – this is the SPI Master In Slave Out pin, its used for the SD card. It isn’t used for the TFT display which is write-only.
3. SCLK – this is the SPI clock input pin.
4. MOSI – this is the SPI Master Out Slave In pin, it is used to send data from the microcontroller to the SD card and/or TFT.
5. TFT_CS – this is the TFT SPI chip select pin.
6. Card CS – this is the SD card chip select, used if you want to read from the SD card.
7. D/C – this is the TFT SPI data or command selector pin.
8. RST – this is the TFT reset pin. Connect to ground to reset the TFT! Its best to have this pin controlled by the library so the display is reset cleanly, but you can also connect it to the Arduino Reset pin, which works for most cases.
9. Vcc – this is the power pin, connect to 3-5VDC – it has reverse polarity protection but try to wire it right.
10. GND – this is the power and signal ground pin.
TFT DISPLAY WITH ARDUINO UNO CIRCUIT DIAGRAM:
TFT DSIPLAY WITH ARDUINO UNO SKETCH:
Copy and paste the code with arduino IDE or download the code by below given link.
//Circuito.io is an automatic generator of schematics and code.
//Copyright (C) 2016 Roboplan Technologies Ltd.
// Include Libraries
#include “Arduino.h”
#include “GraphicLCD.h”
// Pin Definitions
#define GRAPHICLCD_PIN_RX 2
#define GRAPHICLCD_PIN_TX 3
// Global variables and defines
// object initialization
GraphicLCD graphicLCD(GRAPHICLCD_PIN_RX,GRAPHICLCD_PIN_TX);
// define vars for testing menu
const int timeout = 10000; //define timeout of 10 sec
char menuOption = 0;
long time0;
// Setup the essentials for your circuit to work. It runs first every time your circuit is powered with electricity.
void setup()
{
// Setup Serial which is useful for debugging
// Use the Serial Monitor to view printed messages
Serial.begin(9600);
while (!Serial) ; // wait for serial port to connect. Needed for native USB
Serial.println(“start”);
menuOption = menu();
}
// Main logic of your circuit. It defines the interaction between the components you selected. After setup, it runs over and over again, in an eternal loop.
void loop()
{
if(menuOption == ‘1’) {
// Serial Graphic LCD 160×128 – Test Code
// The LCD Screen will display the text of your choice at the location (30,50) on screen. Counting from the top left corner: 30 pixels to the right and 50 pixels down
graphicLCD.setX(30); // 1. sets left-right indent for text to print. Change the value in the brackets (1 – left, 164 – right) for a different indent.
graphicLCD.setY(50); // 2. sets top-bottom height for text to print. Change the value in the brackets (1 – top, 128 – bottom) for a different height.
graphicLCD.print(“Circuito.io Rocks!”); // 3. prints the text in the brackets. Modify the text to get your own unique print.
delay(1000); // 4. waits 1000 milliseconds (1 sec). Change the value in the brackets (1000) for a longer or shorter delay in milliseconds.
graphicLCD.clear(); // 5. wipes the screen
delay(1000); // 6. waits 1000 milliseconds (1 sec). Change the value in the brackets (1000) for a longer or shorter delay in milliseconds.
}
if (millis() – time0 > timeout)
{
menuOption = menu();
}
}
// Menu function for selecting the components to be tested
// Follow serial monitor for instrcutions
char menu()
{
Serial.println(F(“\nWhich component would you like to test?”));
Serial.println(F(“(1) Serial Graphic LCD 160×128”));
Serial.println(F(“(menu) send anything else or press on board reset button\n”));
while (!Serial.available());
// Read data from serial monitor if received
while (Serial.available())
{
char c = Serial.read();
if (isAlphaNumeric(c))
{
if(c == ‘1’)
Serial.println(F(“Now Testing Serial Graphic LCD 160×128”));
else
{
Serial.println(F(“illegal input!”));
return 0;
}
time0 = millis();
return c;
}
}
}
Download the Full Arduino Uno Sketch Here.TF- 1.8 with Arduino After Downloaded extract and compile and upload to project board.

Leave a Reply

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.