Buy from US Buy from UK Buy from DE Buy from IT Buy from FR Buy from ES Buy from JP

Caution:

1. If you don’t install the touch driver and use 3.5″ SPI screen, this screen will show white screen. Please don’t worry and follow our guide to make it work.
2. Please confirm that your SD card have enough space for touch driver
3. In this guide, we introduce two way to install the touch driver for this screen: ready-to-use image and touch driver installation.
4. This screen is just compatible with Raspberry Pi OS. All guide in this user manual are tested with Raspberry Pi OS from official website.
5. User manual PDF download from https://www.osoyoo.com/manual/2022013800.pdf
6. This screen is not compatible with Raspberry Pi 5
7. This SPI screen doesn’t support raspios BOOKWORM version.

top

Overview

Introduction

3.5 inch SPI Touch Display is designed for Raspberry Pi.

top

Features

top

Key Parameters

SKU O
LCD Type TFT
LCD Interface SPI(Fmax:24MHz)
Touch Screen Type Resistive
Touch Screen Controller XPT2046
Colors 262K
Driver IC ILI9488
Backlight LED
Resolution 320RGB(H)×480(V) (Pixel)
Backlight Current 120ma
Power Dissipation 0.13A*5V
Operating Temp. (℃) -20~60
Active Area 48.96×73.44(mm)
Product Size 85.5*56(mm)
Package Size 135*95*45 (mm)
Net Weight 55 (g)

top

Interface definition

The pins marked as “NC” below indicate that the pins are not occupied by the LCD and can be used by the user for other applications.

Pin Number Identification Description
1 3.3V Power (3.3V input)
2 5V Power (5V input)
3 NC NC
4 5V Power (5V input)
5 NC NC
6 GND Ground
7 NC NC
8 NC NC
9 GND Ground
10 NC NC
11 TP_IRQ The touch panel is interrupted, and it is low when it is detected that the touch panel is pressed
12 NC NC
13 NC NC
14 GND Ground
15 NC NC
16 NC NC
17 3.3V Power (3.3V input)
18 LCD_RS Command/Data Register Select
19 LCD_SI / TP_SI LCD display / SPI data input of touch panel
20 GND Ground
21 TP_SO SPI data output of touch panel
22 RST Reset
23 LCD_SCK / TP_SCK SPI clock signal for LCD display / touch panel
24 LCD_CS LCD chip select signal, low level selects LCD
25 GND Ground
26 TP_CS Touch panel chip select signal, low level selects touch panel

top

Getting Started

Ready-to-use Image Installation Guide for Raspberry Pi OS

Step 1: Download Ready-to-use Image of Raspberry Pi OS from: https://osoyoo.com/driver/pi/raspberrypi.img

Step 2: Prepare a newly MicroSD memory card (TF card) with USB microSD card reader, recommend sizes are 8G, 16G, and 32G. Insert Micro SD card in USB micro SD card reader,  and connect USB micro SD card reader with your PC.

If you need to format MicroSD card, please download SDFormatter from: https://www.sdcard.org/downloads/formatter_4/.

Step 3: Download the Win32DiskImager utility from Sourceforge: https://sourceforge.net/projects/win32diskimager/

Step 4: Run the Win32DiskImager utility. You may need to run the utility as administrator. Right-click on the file, and select Run as administrator.

Step 5: Browse driver image file from Step 1:

Step 6: Select correct device you prepared and click “write” to burn the driver image file (from Step 1) into MicroSD card. (Note: Please confirm you choose the correct SD card, or you’ll damage the files in your device)

Step 7: Connecting touch screen LCD display to your Raspberry Pi (Note: There are 40 pins on Raspberry Pi, but there are 26 pins on the LCD, so you should pay attention to connecting the pins to your Pi accordingly.)

Step 8: Insert MicroSD card from step 8 into your raspberry pi and power it up.

top

Touch driver installation guide for Raspberry Pi OS

Caution:
1. If you don’t install the touch driver and use 3.5″ SPI screen, this screen will show white screen. Please don’t worry and follow the following guide to make it work.
2. You can install the touch driver on the existing Raspberry Pi OS.
3. Please confirm that your SD card have enough space for touch driver

Step 1. Burn Raspberry Pi OS (please download OS from Raspberry Pi official website, but don’t use BOOKWORM Version) in a TF card/micro SD card, and insert this card in your raspberry Pi. (please confirm that the SD card have enough space for touch driver)

Step 2. Connect Raspberry Pi to your HDMI monitor or TV. Put a keyboard and mouse into Raspberry Pi USB ports, as following. (please don’t install 3.5″ SPI screen now, as it will show white screen)

Step 3. Getting the Raspberry Pi connected to the Internet (If you want to learn how to get the Raspberry Pi connected to the Internet, please visit https://osoyoo.com/2017/06/20/raspberry-pi-3-basic-tutorial/ )

Step 4. Open terminal, and enter the following command to get the Raspberry Pi’s IP address

hostname -I

Step 6. Enter the following command in the terminal of Raspberry Pi to install the touch driver.

git clone https://github.com/osoyoo/LCD-show.git
cd LCD-show/

Step 7. Enter the following command in the terminal of Raspberry Pi to run touch driver

chmod +x lcd35b-show
 ./lcd35b-show

The touch function will restart automatically.

Step 8. Shut down and remove the HDMI/TV monitor. keyboard and mouse, then install the 3.5″ SPI screen with the Raspberry Pi which has install touch driver.(There are 40 pins on Raspberry Pi, but there are 26 pins on the LCD, so you should pay attention to connecting the pins to your Pi accordingly)

Step 9. Power on this Raspberry Pi screen.

top

Advanced course

Use ssh tool to control Raspberry Pi remotely

Step 1. After installing the touch driver, put a keyboard and mouse into Raspberry Pi USB ports, and open terminal, and enter the following command to get the Raspberry Pi’s IP address

hostname -I

Step2. Enter the following command to enable SSH.

sudo raspi-config

Step 3. You will go to configuration menu, select Interface Options ->SSH -> Yes ->OK ->Finish

Step 4. Install ssh tool in your computer (If you want to learn how to Use ssh tool to control Raspberry Pi’s remotely, please visit https://osoyoo.com/2017/06/20/raspberry-pi-3-basic-tutorial/)
Here we take PuTTY for windows users as example. Please download PuTTY from: https://www.chiark.greenend.org.uk/~sgtatham/putty/ and install this exe. in your Windows PC

Step 5. Open PuTTY and click Session on the left tree-alike structure (generally it’s collapsed upon PuTTY startup):

Step 6. Enter the IP address you got from step1 under Host Name (or IP address) and 22 under Port (by default it is 22) ,then click open.

Step 7. Note that when you first log in to the Raspberry Pi with the IP address, you’ll be prompted with a security reminder. Just click Yes. When the PuTTY window prompts login as: type in the user name: pi, and password: raspberry (the default one, if you haven’t changed it).
Note: when you’re typing the password in, the window shows nothing just null, but you’re in fact is typing things in. So just focus on typing it right and press Enter. After you log in the RPi successfully, the window will display as follows:

top

Rotate the display direction

Step1. Enter ssh tool to control Raspberry Pi remotely

Step2. After installing the touch driver, you can rotate display 90 degrees clockwise direction by running the following commands (Note: #90 can be 0, 90, 180 and 270. Indicates that the display rotates 0 degrees, 90 degrees, 180 degrees and 270 degrees clockwise direction, respectively.)

cd LCD-show/
sudo ./lcd35b-show 90

top

Install Virtual Keyboard

Step 1. Enter ssh tool to control Raspberry Pi remotely

Step 2. Update matchbox-keyboard

sudo apt-get install update sudo apt-get install matchbox-keyboard
Step 3. Run the following command to create file toggle-matchbox-keyboard.sh under /usr/bin

sudo nano /usr/bin/toggle-matchbox-keyboard.sh

Step 4. Copy the statements below to toggle-matchbox-keyboard.sh and press ctrl + X then Y to save this file, then click “enter” to exit nano editor(Note: press right key of keyboard to paste statements in Putty terminal).

#!/bin/bash
#This script toggle the virtual keyboard
PID=`pidof matchbox-keyboard`
if [ ! -e $PID ]; then
killall matchbox-keyboard
else
matchbox-keyboard -s 50 extended&
fi

Step 5. Execute the commands:

sudo chmod +x /usr/bin/toggle-matchbox-keyboard.sh
sudo mkdir /usr/local/share/applications


Step 6. Run the following command to create file applications/toggle-matchbox-keyboard.desktop under /usr/local/share/applications/

sudo nano /usr/local/share/applications/toggle-matchbox-keyboard.desktop

Step 7. Copy the statements to toggle-matchbox-keyboard.desktop and and press ctrl + X then Y to save this file, then click “enter” to exit nano editor.(Note: press right key of keyboard to paste statements in Putty terminal)

[Desktop Entry]
Name=Toggle Matchbox Keyboard
Comment=Toggle Matchbox Keyboard`
Exec=toggle-matchbox-keyboard.sh
Type=Application
Icon=matchbox-keyboard.png
Categories=Panel;Utility;MB
X-MB-INPUT-MECHANSIM=True

Step 8. Execute commands as below. Note that you need to use “Pi ” user permission instead of root to execute this command.

sudo nano /etc/xdg/lxpanel/LXDE-pi/panels/panel

6. Find the statement which is similar to below: (It maybe different in different version. You can use ctrl + W to search button to find this part)

Plugin {
type = launchbar
Config {
Button {
id=lxde-screenlock.desktop
}
Button {
id=lxde-logout.desktop
}
}

7. Append these statements to add an button option, and press ctrl + X then Y to save this file, then click “enter” to exit nano editor.(Note: press right key of keyboard to paste statements in Putty terminal)

Button {
id=/usr/local/share/applications/toggle-matchbox-keyboard.desktop
}

8. Run the following command to reboot your Raspberry Pi. If the virtual keyboard is installed correctly, you can find that there is a keyboard icon on the left of the bar

sudo reboot

top

Control Backlight Brightness with GPIO

Step 1: Installed the wiringpi on your RPi

Make sure you have installed the wiringpi on your RPi, if not , please follow below operations:
1) Run the following command to update the package list::

sudo apt-get update

2) Run the following command to install git:

sudo apt-get install git

3) Run the following command to clone the wiringPi library:

sudo git clone https://github.com/WiringPi/WiringPi.git

4) Run the following command to enter the wiringPi directory:

cd WiringPi/

5) Run the following command to build and install wiringPi:

sudo ./build

6) After the installation is complete, you can check the version of wiringPi by running the following command:

gpio -v

7) Check the GPIO status by running the following command

gpio readall

Note: Run “gpio readall”,  if you get “Oops – unable to determine board type… model:17”,  Open the Raspberry Pi terminal and type:

cd /tmp
wget https://project-downloads.drogon.net/wiringpi-latest.deb
sudo dpkg -i wiringpi-latest.deb

Step 2: Backlight ON/OFF Control
1)Set the pin mode to OUT by typing the following command:

gpio -g mode 18 out

2) Run “gpio readall” to check the status of the control pin, you should see result as following picture.
Note: 12 is physical pin number, 18 is BCM number, 1 is wiringpi number

3) turn off the backlight by the following command:

gpio -g write 18 1

turn on the backlight by the following command:

gpio -g write 18 0

Step 3: Adjust Backlight Brightness
1) Set the pin to PWM mode by typing the following command:

gpio -g mode 18 pwm

2) Run “gpio readall” to check the status of the control pin, you should see result as following picture.

3) Run the following command to adjust backlight brightness(Note: Please use the value between 0~1024 to replace X, and the larger the value, the darker the backlight. vice versa):
gpio -g pwm 18 X

top