Interfacing ESP8266 NodeMCU with ST7735 TFT

This post shows how to interface ESP8266 NodeMCU development board (ESP12-E module) with ST7735 TFT display (128×160 pixel resolution).
The ST7735 TFT display is a color display that uses SPI protocol, it’s low cost and easy to use.
This module works with 3.3V only, connecting it directly to a 5V system will not work and may damage its controller circuit!

The display which is used in this project is shown below (face):

ST7735S SPI TFT display face

and the back of the display module:

ST7735S SPI TFT display back

As shown in the back of the display module there is the AMS1117 3V3 voltage regulator, it’s used to supply the display controller circuit with 3.3V from an input supply of 5V (because it does work with 3.3V only).
Also, we can disuse the built-in voltage regulator (AMS1117 3V3) if we already have a regulated voltage source of 3.3V, here we should close (solder) jumper J1 (red ellipse).

Project Hardware Required:

  • ESP8266 NodeMCU development board
  • ST7735 TFT display module
  • Breadboard
  • Jumper wires

ESP8266 NodeMCU with ST7735S color TFT display

Interfacing NodeMCU with ST7735 TFT circuit:
Project circuit schematic diagram is shown below.

The ST7735S shown in project circuit diagram has 8 pins: (from right to left): RST (reset), CE (chip enable), DC (or D/C: data/command), DIN (data in), CLK (clock), VCC, BL (back light) and Gnd (ground).

ESP8266 NodeMCU ST7735S TFT display

The ST7735 display is connected to the NodeMCU board as follows:
RST pin is connected to D4 (ESP8266EX GPIO2),
CS pin is connected to D3 (ESP8266EX GPIO0),
D/C pin is connected to D2 (ESP8266EX GPIO4),
DIN pin is connected to D7 (ESP8266EX GPIO13),
CLK pin is connected to D5 (ESP8266EX GPIO14),
VCC and BL are connected to pin 3V3,
GND is connected to pin GND of the NodeMCU board.

Pins D5 (GPIO14) and D7 (GPIO13) are hardware SPI module pins of the ESP8266EX microcontroller respectively for SCK (serial clock) and MOSI (master-out slave-in).

Interfacing NodeMCU with ST7735 TFT code:
The following Arduino code requires two libraries from Adafruit Industries:
The first library is a driver for the ST7735 TFT display which can be installed from Arduino IDE library manager (Sketch —> Include Library —> Manage Libraries …, in the search box write “st7735” and install the one from Adafruit).

The second library is Adafruit graphics library which can be installed also from Arduino IDE library manager.

Both libraries can be installed manually, first download them from the following 2 links:
Adafruit ST7735 TFT library    —->  direct link
Adafruit graphics library        —->  direct link

After the download, go to Arduino IDE —> Sketch —> Include Library —> Add .ZIP Library … and browse for the .zip file (previously downloaded).
The same thing for the other library file.

Arduino Code:
The Arduino code below is the Adafruit test example for the ST7735 display (comes with Adafruit ST7735 library) with few modifications in order to work with the circuit schematic shown above.

Project hardware circuit should give the same result as the one shown in the following video where Arduino UNO board is used (NodeMCU is much faster than Arduino UNO):

ESP8266 Projects with ST7735 TFT display:
NodeMCU with ST7735 TFT and LM35 Analog Temperature Sensor
ESP8266 NodeMCU Internet Clock with ST7735 TFT
ESP8266 NodeMCU with ST7735 TFT and DHT11 Sensor
Interfacing NodeMCU with DHT22 Sensor and ST7735 TFT
Interfacing NodeMCU with DS3231 RTC and ST7735 TFT
NodeMCU with ST7735 TFT and BMP280 Sensor
Interfacing NodeMCU with BME280 Sensor and ST7735 TFT

1 thought on “Interfacing ESP8266 NodeMCU with ST7735 TFT”

  1. I am trying to get the graphicstest sketch to work in a small red ST7735 TFT Display when driven by a Lolin NodeMcu V3.0. The sketch compiles and uploads but no graphics appear. What am I doing wrong?

Leave a Comment

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.

Scroll to Top