Zonnestroompanelen in Nederland

duurzaamheid achter de meter

(23) The Tiny TFT that delivers: the 0.96 inch 80*160 TFT display with ST7735 driver for Arduino

by Floris Wouterlood – The Netherlands – December 26, 2020

The pinout and wiring to an Arduino Nano is described of a 0.96 inch, 80*160 pixel TFT color display with ST7735 controller. A demo sketch is provided.

A good display is indispensable for data representation. Devices such as LCDs and OLEDs provide fast and easy solutions. Why then a TFT? The answer is simple: user definable colors. The monochrome nature of LCD’s and OLEDs rule out displaying many colors. Some OLEDs offer a very limited array of colors. When colorful data representation is desirable the TFT display comes into the picture. A large variety of such displays is on the market, with the ILI9341-chip driven displays as the unchallenged champion. A humble, economical and small footprint TFT display, yet with considerable resolution, is the 80*160 pixel display with 0.96 inch screen diameter. The device described here has a ST7735S chip (S stands for ‘scrolling’) and it communicates via a SPI interface. This could be a display handy for combination with small-footprint Arduino devices and with IOT applications.
The libraries published by Adafruit: “Adafruit_GFX.h” and “Adafruit_ST7735.h” support alphanumeric and graphical functionality. In this article we wire the 80*160 ST7735 TFT to an Arduino Nano.

Voltage and power considerations
The TFT display at hand was sold to me as a 3.3V device. Inspection after arrival did not reveal an on-board voltage divider. Caution therefore needs to be exercised when connecting this device to an Arduino-type of microcontroller board. In all control logic wires a 220 Ω resistor was placed in series to reduce signal voltage.

Wiring the 0.96’ 80*160 TFT to an Arduino Nano
The TFT breakout board has 8 pins (fig 1):

  • GND: ground pin. Connect to GND.
  • VCC: power pin: needs 3.3V permanently.
  • SCL: clock pin for serial SPI communication. Connect to pin D13 of the Nano and use a 220 Ω resistor in series.
  • SDA: data pin for serial SPI communication. Connect to pin D11 of the Nano and use a 220 Ω resistor in series.
  • RES: reset pin. Connect to pin D5 of the Arduino and use a 220 Ω resistor in series.
  • DC: command/data pin: Connect to pin D7 of the Nano and use a 220 Ω resistor in series.
  • CS: chip enable: allows data to be clocked in. Connect to pin D6 of the Arduino and use a 220 Ω resistor in series.
  • BLK: back light pin: if 3.3V is applied to this pin the backlight led will provide extra light. In my construction backlight was not necessary so this pin is left unconnected here.

Figure 1. Wiring of a 0.96 inch 80*160 TFT with ST7735 controller to an Arduino Nano. Note the voltage-reducing resistors in all wires. The VCC pin of the TFT must be wired to the 3V3 pin of the Arduino. BLK may be connected to the Nano’s 3.3V pin.

Figure 2 shows ‘live’ wiring on a breadboard, with the resistors included in the control wires. Figure 3 shows the display in action with the demo sketch.The SDA (to Nano pin 11) and SCL (to Nano pin 13) wires are ‘obligatory’ wires since pins 11 and 12 are the hardware pins designated for SPI communication. The remaining wires to the Nano (here to pins 5,6,7) can be connected to pins of choice, that is that the constructor then needs to be adapted accordingly. The constructor with the configuration as shown in Figures 1 and 2 is:

Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);

with the following defines preceding the constructor (see also the demo sketch):

#define TFT_RST 5              // reset line (optional, pass -1 if not used)
#define TFT_CS   6              // chip select line
#define TFT_DC   7              // data/command line

Figure 2. The ST7735 80*160 TFT wired to an Arduino Nano board, with the demo sketch running. Note the voltage reducing resistors. The display is so bright that the BLK pin does not need to be connected.

Figure 3. Detail of figure 2. This is a small, yet razor sharp display with considerable resolution and showing saturated, bright colors.

Library needed

Note: the libraries ‘Adafruit_GFX.h’ and ‘Adafruit_ST7735.h’ are required to compile this sketch. These libraries can be installed via Library Manager in the Arduino IDE: Sketch → Include Library → Manage Libraries. An alternative way is to search the internet download and install via the Arduino IDE: Sketch → Include Library → Add .ZIP Library.

Downloadable sketch


(sketch is ZIP compressed)