1.8 inch st7735r spi 128 160 tft lcd display setup free sample

Hi guys, welcome to today’s tutorial. Today, we will look on how to use the 1.8″ ST7735  colored TFT display with Arduino. The past few tutorials have been focused on how to use the Nokia 5110 LCD display extensively but there will be a time when we will need to use a colored display or something bigger with additional features, that’s where the 1.8″ ST7735 TFT display comes in.

The ST7735 TFT display is a 1.8″ display with a resolution of 128×160 pixels and can display a wide range of colors ( full 18-bit color, 262,144 shades!). The display uses the SPI protocol for communication and has its own pixel-addressable frame buffer which means it can be used with all kinds of microcontroller and you only need 4 i/o pins. To complement the display, it also comes with an SD card slot on which colored bitmaps can be loaded and easily displayed on the screen.

The schematics for this project is fairly easy as the only thing we will be connecting to the Arduino is the display. Connect the display to the Arduino as shown in the schematics below.

Due to variation in display pin out from different manufacturers and for clarity, the pin connection between the Arduino and the TFT display is mapped out below:

We will use two libraries from Adafruit to help us easily communicate with the LCD. The libraries include the Adafruit GFX library which can be downloaded here and the Adafruit ST7735 Library which can be downloaded here.

We will use two example sketches to demonstrate the use of the ST7735 TFT display. The first example is the lightweight TFT Display text example sketch from the Adafruit TFT examples. It can be accessed by going to examples -> TFT -> Arduino -> TFTDisplaytext. This example displays the analog value of pin A0 on the display. It is one of the easiest examples that can be used to demonstrate the ability of this display.

The second example is the graphics test example from the more capable and heavier Adafruit ST7735 Arduino library. I will explain this particular example as it features the use of the display for diverse purposes including the display of text and “animated” graphics. With the Adafruit ST7735 library installed, this example can be accessed by going to examples -> Adafruit ST7735 library -> graphics test.

The first thing, as usual, is to include the libraries to be used after which we declare the pins on the Arduino to which our LCD pins are connected to. We also make a slight change to the code setting reset pin as pin 8 and DC pin as pin 9 to match our schematics.

Next, we create an object of the library with the pins to which the LCD is connected on the Arduino as parameters. There are two options for this, feel free to choose the most preferred.

Next, we move to the void setup function where we initialize the screen and call different test functions to display certain texts or images.  These functions can be edited to display what you want based on your project needs.

All the functions called under the void setup function, perform different functions, some draw lines, some, boxes and text with different font, color and size and they can all be edited to do what your project needs.

Uploading the code to the Arduino board brings a flash of different shapes and text with different colors on the display. I captured one and its shown in the image below.

That’s it for this tutorial guys, what interesting thing are you going to build with this display? Let’s get the conversation started. Feel free to reach me via the comment section if you have any questions as regards this project.

1.8 inch st7735r spi 128 160 tft lcd display setup free sample

Only an small advice for those who want to rotate to rotate the text you have to use the instruction tft.setRotation (2); the number can be 0,1,2,3

//#define ILI9488_DRIVER // WARNING: Do not connect ILI9488 display SDO to MISO if other devices share the SPI bus (TFT SDO does NOT tristate when CS is high)

1.8 inch st7735r spi 128 160 tft lcd display setup free sample

In this guide we’re going to show you how you can use the 1.8 TFT display with the Arduino. You’ll learn how to wire the display, write text, draw shapes and display images on the screen.

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.

The TFT display communicates with the Arduino via SPI communication, so you need to include the SPI library on your code. We also use the TFT library to write and draw on the display.

In which “Hello, World!” is the text you want to display and the (x, y) coordinate is the location where you want to start display text on the screen.

The 1.8 TFT display can load images from the SD card. To read from the SD card you use the SD library, already included in the Arduino IDE software. Follow the next steps to display an image on the display:

Note: some people find issues with this display when trying to read from the SD card. We don’t know why that happens. In fact, we tested a couple of times and it worked well, and then, when we were about to record to show you the final result, the display didn’t recognized the SD card anymore – we’re not sure if it’s a problem with the SD card holder that doesn’t establish a proper connection with the SD card. However, we are sure these instructions work, because we’ve tested them.

In this guide we’ve shown you how to use the 1.8 TFT display with the Arduino: display text, draw shapes and display images. You can easily add a nice visual interface to your projects using this display.

1.8 inch st7735r spi 128 160 tft lcd display setup free sample

Other than SPI pins, we need to select three more pins as output. I have selectedPB6 for CS, PC7 for RESET, and PA9 for DC. You are free to choose any other pins also, whatever suits the requirement

1.8 inch st7735r spi 128 160 tft lcd display setup free sample

Specification:Driver IC: ST7735RResolution: 128 x 160 pixelsFeatures:- Can help you to get rid of the Arduino serial monitor.- Some tests and provide UTFT library, AdaFruit Library and instruction on DropBox.- Tested with Latest Arduino 1.6.5.IO interface:1. RESET --directly to the microcontroller IO2. CS --directly to the microcontroller IO3. A0 --IO control registers select4. SDA --IO control data transmission5. SCL --IO control SPI bus6. BL--High Level 3.3V backlight onNote:Please contact us for documents and driver if you need. Please noted this LCD is 3.3V, which can not receive 5V signals from the Arduino, so please use a 1k series resistors between GPIO lines on a 5V arduino and this LCD, power this LCD with 5V but drive it with "level shifted resistor" GPIO lines.Besides, you could use mcifriend 2.8 inch TFT LCD library to get it to work, it will work fine with the Mega or Uno.

1.8 inch st7735r spi 128 160 tft lcd display setup free sample

The 1.8" display has 128x160 color pixels. The TFT driver (ST7735) can display full 18-bit color. The breakout has the TFT display soldered on (it uses a delicate flex-circuit connector).

In the below example, Node32-Lite and this 1.8-inch LCD. Please refer to the tutorial here: ST7735S interfacing with ESP32 to make the connections, Arduino library installation, and modification needed for it to works on this LCD.

1.8 inch st7735r spi 128 160 tft lcd display setup free sample

I wanted to try these ST7735 inexpensive displays that can be found all over the internet, so I ordered a couple for a few euros each. My quick research showed that a number of libraries support them and it turns out that you can display anything you want. Of course, we are not talking about playing modern games on it or watching 4k videos. These are just simple displays that can be really helpful to any project.

And here is how the TFT looks. As you see it also has a port for an SD card if you want to use e.g. for reading images from it. In my case, I didn’t connect it.

Once you have the connections ready next step is to install the TFT library in your Arduino IDE. Go to Tools – > Manage Libraries and then search for TFT_eSPI and click install. Alternatively, crab the lib from here.

Next step is to configure the pins in the file User_Setup.h of the library. In your favourite text editor open the file and change the pins in lines 124,125,126. Here how mine looks:

After this, you can pick any of the examples from the library to upload to your ESP32 microcontroller. Some of them are really nice. For testing, I connected a DHT11 temperature/humidity sensor and I displayed the readings in the ST7735. Sweet!

1.8 inch st7735r spi 128 160 tft lcd display setup free sample

Got three of them all working(1 with Arduino Leonardo and 2 with NodeMCU ESP8266).arduino will need a solution to the 5v out 3.3v in(10s solder job) NodeMCU is directly compatible.i used adafruits code.Very happy. getting more. also hiletgo products have all been functional so far. becoming a fan.Update: switched to TFT_eSPI.h library. Wow. Orders of magnitude faster display now. A bit trickier to setup but well worth it.

1.8 inch st7735r spi 128 160 tft lcd display setup free sample

The 1.8 inch TFT LCD Module SPI Serial 51 128 x 160 is a compact colourful display that works well with Raspberry Pi, Android and other microcontrollers.

The display module is bight, anti-reflective and offers the choice of loading images via SD card through the slot on the back of the screen or via a microcontroller.

16-BIT RGB 65K colour display and the internal driver IC is ST7735S, which uses 4-wire SPI communication. The module contains an LCD display and a PCB control backplane.

It only takes a few IOs to illuminate the display with an SD card slot for convenient function expansion provide underlying libraries and rich sample programs forArduino, C51, and STM32 platforms.

1.8 inch st7735r spi 128 160 tft lcd display setup free sample

Features:This is a new 4.8cm series SPI color display module. Supports analog SPI and hardware SPI. SPI series, less I/O port needed. Designed with SD card socket and PCB adapter for LCD. It can be controlled by 8051 / AVR / PIC /ARM/STM32. It can be driven with at least four I/Os.