Get in touch

Donate

Category: IOT

Many time we need a real time device to monitor and operate remotely. Mobile or laptop may not be suitable for that purpose because we don’t need much interactions and the device need to work 24*7. We can create such a device by connecting a touch screen with nodemcu. So lets see how can we connect the two and code it for interaction.

Things we need :

TFT LCD Display Touch Panel SPI (ILI9341)

Nodemcu

20 jumper wires

Breadboard

Stylus

Connections

Below is the connection between Touch screen and Nodemcu :

VCC to 3.3V

GND to GND

CS to D8

RESET to RST

DC to D4

SDI (MOSI) to D7

SCK to D5

LED to 3.3V

SDD (MISO) to D6

T_CLK to D5

T_CS to D2

T_DIN to D7

T_DO to D6

T_IRQ to D1

(Note for the pins that have same connections we will have to use breadboard)

Next, we need to install libraries. Adafruit_GFX and SPI library can be installed from library Manager. Other library that we need you can download here.

Next, we need to find out the calibration parameter of the touch screen. Calibration is matching the graphics on the display to the output from the touch-screen controller. In other words, converting the display coordinates to touch coordinates. Use the code below to find the calibration parameter :