Interfacing 3.5 inch TFT LCD Display with Raspberry Pi Zero W

Published  September 15, 2021   0
Interfacing 3.5 inch TFT LCD Display with Raspberry Pi Zero W

In this tutorial, we are going to interface a 3.5-inch TFT display with Raspberry Pi Zero W development board. Although Raspberry pi zero itself has an HDMI output that can be directly connected to a Monitor, but in projects where space is a constrain, we need smaller displays. This TFT touch screen display can be easily interfaced to the Raspberry Pi to display the system console, movies, and images, as well as control a relay board and other devices at your fingertips. We’ve used software like MobaXterm or putty to connect to the PC remotely in past tutorials. Here, we are going to use MobaXterm software to install the required drivers for interfacing TFT display with Raspberry Pi Zero W.

Introduction to 3.5 inch TFT LCD Display

This TFT LCD display has a 3.5-inch resistive touch screen display and is compatible with any hardware of the Raspberry Pi family. This 3.5" TFT display has 480x320 pixels with a 16-bit resolution and resistive touch option. It can fit directly on top of the Raspberry Pi Zero W board and gets powered from the Vcc pin, the display communicates through SPI protocol with the Pi. Additionally, you can also use the HDMI port on the Pi to connect it to another display as well. It is designed for Raspberry Pi Zero/Pi 2 /Pi 3 Model B / B+ and can also be used on other hardware platforms which have SPI interfaces. The highlights of this display module is that it supports plug and play without rebooting the Pi and the SPI speed runs as fast as 32MHz to support games and videos.

3.5 inch TFT RPi Display Pin Diagram

There are 26 pins in TFT RPi LCD display. It's used to establish SPI communication between the Raspberry Pi and the LCD, as well as to power the LCD from the Raspberry Pi's 5V and 3.3V pins. The description of pins is shown below.

Description

Pin

NO.

NO.

Pin

Description

Power input (5V)

5V

2

1

3.3V

NC

Power input (5V)

5V

4

3

SDA

NC

Power GND

GND

6

5

SCL

NC

NC

TX

8

7

P7

NC

NC

RX

10

9

GND

Power GND

NC

P1

12

11

P0

NC

Power GND

GND

14

13

P2

NC

NC

P4

16

15

P3

NC

NC

P5

18

17

3.3V

NC

Power GND

GND

20

19

MI

TP SPI Bus input (MOSI)

TP Interrupt

IRQ

22

21

MO

TP SPI Bus output (MISO)

NC

CE0

24

23

SCK

TP SPI Bus Clock (SCLK)

TP chip Select

TCS

26

25

GND

Power GND

3.5inch TFT RPi Display Pins

Connecting 3.5” TFT LCD Display to Raspberry Pi Zero W

It is very easy to connect Raspberry Pi Zero W with a 3.5” TFT LCD display. There are 40 pins on the Raspberry Pi Zero W, but only 26 pins on the LCD, so make sure you connect the pins to your Pi correctly. A strip of female header pins on the LCD will fit snugly into the male header pins. To establish the connection, simply align the pins and press the LCD on top of the Raspberry Pi zero W. When everything is in place, your Pi and LCD should look like the one given below.

Connect 3.5” TFT LCD Display to Raspberry Pi Zero W

Preparing your Raspberry Pi Zero W for 3.5” LCD Display Screen

After you've connected the LCD to the Raspberry Pi Zero W and power on it, you'll see a blank white screen on the LCD which is due to the fact that no drivers for the linked LCD have been installed on the Pi. So, open the Pi's terminal window and start making the necessary adjustments. Here, we are going to use MobaXterm software for connecting Raspberry Pi Zero W but you can use PuTTY or any software which is most comfortable for you.

It's expected that your Raspberry Pi already has an operating system installed and can connect to the internet. If it is not then you can follow our previous tutorial Getting Started with the RASPBERRY PI ZERO W – Headless Setup without Monitor. It's also assumed that you have access to your Raspberry Pi's terminal window. In this tutorial, we are going to use MobXterm in SSH mode to connect it with Raspberry Pi Zero W.

Step-1 Open the terminal window of Raspberry Pi Zero W and the configuration window by using the below command.

sudo raspi-config

Raspberry Pi Zero Configuration

Raspberry Pi Software Configuration Tool

Step-2: In this step, we are going to enable SPI connection for Raspberry Pi Zero W. To enable SPI communication, select ‘Interface options’, and then select ‘SPI option’. Then click on 'yes' to enable SPI interfacing.

Enable Raspberry Pi SPI Communication

Enable SPI Interfacing

Enable SPI Interfacing

Step-3: Now as we have enabled the SPI interfacing, in this step, we are going to install touch driver in our Raspberry Pi Zero W. You can install the touch drivers using the below command:

git clone https://github.com/waveshare/LCD-show.git

Install Touch Driver for Raspberry Pi

After cloning the touch driver directory use the below command to move inside the driver directory:

cd LCD-show/

Raspberry Pi Touch Driver

Step-4: After installing the touch driver use the below commands to proceed with further setup, here we are using chmod command to change the access mode of the file.

chmod +x LCD35-show
 ./LCD35-show

Setup Raspberry Pi Zero

Raspberry Pi Zero W Setup

Step-5: Now, restart your Raspberry Pi Zero W. When the Raspberry Pi Zero W restarts, you will see the boot information on the LCD display before the desktop appears, as shown below.

LCD Display Boot Information

Raspberry Pi Display

I would like to add one thing at the end of this tutorial that while doing this interfacing, I faced a problem related to OS. TFT display interfacing with Raspberry Pi Zero W was not working on Raspberry Pi OS Lite and Raspberry Pi OS with desktop but when I used the Raspberry Pi OS with desktop and recommended software then TFT display interfacing with Raspberry Pi Zero W worked as expected.

Raspberry PI OS

This is how you can interface Raspberry Pi Zero W with a 3.5 inch TFT Raspberry Pi display. In our next tutorials, we are going to interface different sensors with Raspberry Pi Zero and you will see some amazing DIY projects using Raspberry Pi Zero W. I Hope you've enjoyed the project and learned something useful. If you have any questions, please leave them in the comment section below or use our forum to start a discussion on the same.

Video

Have any question realated to this Article?

Ask Our Community Members