st7735 tft display quotation

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.

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.

testdrawtext("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur adipiscing ante sed nibh tincidunt feugiat. Maecenas enim massa, fringilla sed malesuada et, malesuada sit amet turpis. Sed porttitor neque ut ante pretium vitae malesuada nunc bibendum. Nullam aliquet ultrices massa eu hendrerit. Ut sed nisi lorem. In vestibulum purus a tortor imperdiet posuere. ", ST7735_WHITE);

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.

st7735 tft display quotation

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 above 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.

st7735 tft display quotation

If anyone has one of these displays that you thought was broken, here is a working sketch based on an 8051 driver example I received from the Chinese vendor. Perhaps it will help get someone started... I took the function initial() from this sketch and added it to Bodmers ST7735_init.h for my "BLUETAB" version which is the subject of this topic.

st7735 tft display quotation

This Bare Basic deals with connecting an Arduino with a breakout, serial SPI interfaced, 160×128 pixel color TFT display with a screen diagonal of 1.8 inch. The controller chip is a ST7735S.

The Sitronics ST7735 is a versatile display controller chip used to drive affordable, Arduino compatible TFT screens with moderate dimensions (1.8 inch display diameter; 160×128 pixels; 16-bit color). Displays with this chip can be applied as output color graphics / text display in an Arduino environment. An interesting library written by Adafruit exits that provides sufficient tools to create colorful, attractive presentation of data.

Once an Arduino has collected and manipulated data, display of the output is obvious. Reporting can be arranged via the Arduino IDE and Serial Monitor, but in this situation the Arduino must be connected to a computer while there is no way to directly produce graphical output. A separate display can be very handy for graphical data display and is especially recommended in standalone applications.

Displays for the Arduino are available in all kinds and price classes. I distinguish three groups: LCD, OLED and TFT. Well known is the monochrome LCD display with a blue or green background, usually with two lines of 16 characters or 4 lines of 20 characters, with each ‘character’ created in its own 8×5 pixel matrix. These LCD displays are good for displaying short messages or numerical values while they lack graphical capabilities and colors. Special LCD displays are the 128×64 monochrome numerical/graphical LCD display whose library offers a few primitive graphics, and the Nokia 5110 84×48 LCD display with a PCD8544 controller. LCD displays do not offer colors other than background versus character.

Figure 1: 1.8 inch 160×128 color TFT display with SPI interface on a breakout board (ST7735 compatible). Left: simple sketch showing text mode; right: graphics test mode.

A special kind of LCD is the OLED display. This family includes small, programmable graphical displays (64×32 or 128×32 pixels) in monochrome or full color.

More versatile than the LCD displays, as well as larger, are TFT displays (fig 1). These are capable of graphics and a spectrum of colors (65,536 up to 256,000 colors) to the degree that they support realistic display of color pictures. TFT displays can be bought in a dazzling array of sizes, resolution, interfaces and prices.

TFT displays for the Arduino microcontroller boards can be accessed via an 8-bit parallel data interface – fast but consuming at least 8 pins of the Arduino. An alternative is the serial SPI interface which needs only five pins.

Figure 2: Wiring of the 160×128 SPI 1.8 inch color TFT display. Note that more expensive displays have a voltage level shifter on board. This makes it possible to connect VCC with 5V instead of 3.3V as in this clone situation.

Here is a no-frills sketch that does what is needed; display some message on the display, with some color and two graphic element (one visible: the frame rectangles and one invisible: the rectangles filled with the same color as the background used to wipe out text).

ST7735 controller based TFT displays are very handy displays for use in Arduino applications. One typical application is a standalone weather station built around an Arduino platform and decorated with temperature, humidity and barometric pressure sensors. The ST7735 is less sophisticated as the bigger parallel TFT screens but displays based on this chip form a nice intermediate between the ‘big’ TFTs and the basic LCD displays.

st7735 tft display quotation

This lovely little display breakout is the best way to add a small, colorful, and bright display to any project. Since the display uses 4-wire SPI to communicate and has its own pixel-addressable frame buffer, it can be used with every kind of microcontroller. Even a very small one with low memory and few pins available!

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! The TFT driver (ST7735R) can display full 18-bit color (262,144 shades!).

And the 1.8 Inch SPI 128×160 TFT LCD Display Module will always come with the same driver chip so there are no worries that your code will not work from one to the other.

The breakout has the TFT display soldered on (it uses a delicate flex-circuit connector) as well as an 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.

st7735 tft display quotation

were missing for my display (hailege, 2,8 tft, spi, il9431, https://www.amazon.de/-/en/gp/product/B07YTWRZGR/ref=ppx_yo_dt_b_asin_title_o04_s00?ie=UTF8&psc=1). so it might just be that the led backlight isnt being turned on. but of course the tip might not help with the st7796s.

st7735 tft display quotation

The TFT isn’t ‘plug & play’ with the Raspberry, a patch has to be applied to the kernel to be able to interface via SPI with the ST7735R controller chip on the TFT. Once working, the display will act as a framebuffer device.

-Get Kamal’s source which has the patch for ST7735R controller and the branch for the kernel that is used in 2013-02-09-wheezy-raspbian, which is 3.6.y;

If you are planning on displaying the console on the TFT, then enabling these options in .config will allow you to change the font size and rotate the display later on.

If you build the st7735 driver pair as built-in, add these options to the end of the line in /boot/cmdline.txt. This will display the console on the TFT.