Google Chat: zj734465502@gmail.com
+86-0755-88291180
sales01@spotpear.com
dragon_manager@163.com
services01@spotpear.com
manager01@spotpear.com
WhatsApp:13246739196
The 3.5-inch RPi LCD (F) is equipped with a capacitive touch screen with a resolution of 320 × 480, supporting two connection methods: Pigo pin communication and GH1.25 13PIN cable connection, and providing example materials for Raspberry Pi, ESP32, Pico, Arduino, etc.
Parameter Name | Parameter |
Supply Voltage | 5V |
Logic Voltage | 3.3V |
LCD type | IPS |
Communication interface | Display: SPI |
Touch: I2C | |
Controller Chip | Display: ST7796S |
Touch: GT911 | |
Resolution | 320 (H) x 480 (V) |
Display Size | 49.36 (H) x 73.84 (V) mm |
Dimensions | 61.00 (H) x 92.44 (V) mm |
This product supports two connection methods to Raspberry Pi
Function pin | BCM encoding | Board physical pin number |
TP_RST | 17 | 11 |
TP_INT | 4 | 7 |
TP_SCL | 3 | 5 |
TP_SDA | 2 | 3 |
LCD_BL | 18 | 12 |
LCD_RST | 27 | 13 |
LCD_DC | 22 | 15 |
LCD_CS | 8 | 24 |
SCLK | 11 | 23 |
MOSI | 10 | 19 |
MISO | 9 | 21 |
GND | GND | 6 |
VCC | 5V | 4 |
Enter the following command in the terminal:
sudo raspi-config nonint do_spi 0 sudo raspi-config nonint do_i2c 0
sudo apt-get update sudo apt-get install python3-pip sudo apt-get install python3-pil sudo apt-get install python3-numpy sudo apt-get install python3-spidev sudo apt-get pip install smbus2
wget https://files.waveshare.com/wiki/3.5inch%20RPi%20LCD%20(F)/3inch5_RPI_LCD_F_RPI.zip unzip 3inch5_RPI_LCD_F_RPI.zip cd 3inch5_RPI_LCD_F_RPI sudo python ./main.py
uname -a
This command will output the complete kernel version information. For example, executing this command on Raspberry Pi 5 may produce the following output:
Linux raspberrypi 6.6.51+rpt-rpi-2712 #1 SMP PREEMPT Debian 1:6.6.51-1+rpt3 (2024-10-08) aarch64 GNU/Linux
This indicates that the kernel version number of this system is 6.6.51+rpt-rpi-2712, and it uses 64-bit ARM (AArch64) architecture.
# Step 1: Download and enter the Waveshare-st7796s driver folder wget https://files.waveshare.com/wiki/common/Waveshare-st7796s.zip unzip Waveshare-st7796s.zip cd Waveshare-st7796s
# Step 2: cd to the directory of the corresponding kernel version number # Run the following command as in the example above cd 6.6.51/64/rpi-2712-RPi5
# Copy the corresponding version of st7796s.ko to the current system sudo cp st7796s.ko /lib/modules/$(uname -r)/kernel/drivers
# Make sure the module is loaded at boot time, add the module name to the /etc/modules file: sudo nano /etc/modules
# Add at the end st7796s
Enter the following statement in the terminal to handle kernel module dependencies:
sudo depmod -a
cd wget https://files.waveshare.com/wiki/common/Waveshare35f.dtbo sudo cp Waveshare35f.dtbo /boot/overlays/
Refer to the steps here first #Install Driver Module
sudo nano /boot/firmware/config.txt
Comment out the dual-screen configuration statements
Add the following statements at the end of [all]
dtparam=i2c_arm=on dtparam=i2c_arm_baudrate=50000 dtparam=spi=on dtoverlay=Waveshare35f,fps=60,speed=48000000,rotate=90,ts_rotate_90 hdmi_force_hotplug=1 max_usb_current=1 hdmi_group=2 hdmi_mode=87 hdmi_cvt 480 320 60 6 0 0 0 hdmi_drive=2
Create 98-spi-screen.conf file
sudo nano /etc/X11/xorg.conf.d/98-spi-screen.conf
Add the following parameters to 98-spi-screen.conf file
Section "Device" Identifier "SPI Screen" Driver "fbdev" Option "fbdev" "/dev/fb0" EndSection
Note: After the entire process operation is completed, if they are not displayed, modify "/dev/fb0" to "/dev/fb1" and then restart it
sudo raspi-config nonint do_wayland W1
Restart to take effect
It must be operated based on the bookworm lite version, 64-bit lite or 32-bit lite
Refer to the steps here first #Install Driver Module
sudo nano /boot/firmware/config.txt
Comment out the KMS and dual-screen configuration statements
Add the following statements at the end of [all]
dtparam=i2c_arm=on dtparam=i2c_arm_baudrate=50000 dtparam=spi=on dtoverlay=Waveshare35f,fps=60,speed=48000000,rotate=90,ts_rotate_90 hdmi_force_hotplug=1 max_usb_current=1 hdmi_group=2 hdmi_mode=87 hdmi_cvt 480 320 60 6 0 0 0 hdmi_drive=2
sudo apt-get install --no-install-recommends xserver-xorg -y sudo apt-get install --no-install-recommends xinit -y
sudo apt install lightdm -y
sudo apt install raspberrypi-ui-mods -y
sudo apt install git -y
sudo apt install chromium-browser -y
sudo apt install vlc -y
Open the Raspberry Pi terminal and execute:
sudo apt install libraspberrypi-dev -y sudo apt-get install unzip -y sudo apt-get install cmake -y sudo wget https://files.waveshare.com/wiki/common/Rpi-fbcp.zip sudo unzip ./Rpi-fbcp.zip cd rpi-fbcp/ sudo rm -rf build sudo mkdir -m 777 ./build cd ./build sudo cmake .. sudo make -j4 sudo install fbcp /usr/local/bin/fbcp
sudo nano ~/.bashrc
Add the following code to the end of the file
if [ "$(cat /proc/device-tree/model | cut -d ' ' -f 3)" = "5" ]; then # rpi 5B configuration export FRAMEBUFFER=/dev/fb1 startx 2> /tmp/xorg_errors else # Non-pi5 configuration export FRAMEBUFFER=/dev/fb0 startx 2> /tmp/xorg_errors fi
sudo nano /etc/systemd/system/fbcp.service
Add service configuration in the file
[Unit] Description=Framebuffer Copy for Raspberry Pi After=network.target [Service] ExecStartPre=/bin/sleep 20 ExecStart=/usr/local/bin/fbcp Restart=always User=root Group=root [Install] WantedBy=multi-user.target
Reload the systemd configuration
sudo systemctl daemon-reload
The service enables auto-start at boot
sudo systemctl enable fbcp.service
Test the startup service
sudo systemctl start fbcp.service
sudo raspi-config nonint do_boot_behaviour B2 sudo raspi-config nonint do_wayland W1 sudo reboot
Note1: Make sure that the username of the Raspberry Pi is pi, otherwise it will not be able to log in automatically
Note2: After setting all the configurations above, the system takes longer to restart each time, and SSH also requires a moment to enter
uname -a
This command will output the complete kernel version information. For example, executing this command on Raspberry Pi 5 may produce the following output:
Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
This indicates that the kernel version number of this system is 6.1.21, and it uses 64-bit ARM (AArch64) architecture.
# Step 1: Download and enter the Waveshare-st7796s driver folder wget https://files.waveshare.com/wiki/common/Waveshare-st7796s.zip unzip Waveshare-st7796s.zip cd Waveshare-st7796s
# Step 2: cd to the directory of the corresponding kernel version number # Run the following command as in the example above cd 6.1.21/64/
# Copy the corresponding version of st7796s.ko to the current system sudo cp st7796s.ko /lib/modules/$(uname -r)/kernel/drivers
# Make sure the module is loaded at boot time, add the module name to the /etc/modules file: sudo nano /etc/modules
# Add at the end st7796s
Enter the following statement in the terminal to handle kernel module dependencies:
sudo depmod -a
cd wget https://files.waveshare.com/wiki/common/Waveshare35f.dtbo sudo cp Waveshare35f.dtbo /boot/overlays/
Refer to the steps here first #Install Driver Module
sudo nano /boot/config.txt
Comment out the KMS and dual-screen configuration statements
Add the following statements at the end of [all]
dtparam=i2c_arm=on dtparam=i2c_arm_baudrate=50000 dtparam=spi=on dtoverlay=Waveshare35f,fps=60,speed=48000000,rotate=90,ts_rotate_90 hdmi_force_hotplug=1 max_usb_current=1 hdmi_group=2 hdmi_mode=87 hdmi_cvt 480 320 60 6 0 0 0 hdmi_drive=2
Open the Raspberry Pi terminal and execute:
sudo apt install libraspberrypi-dev -y sudo apt-get install unzip -y sudo apt-get install cmake -y sudo wget https://files.waveshare.com/wiki/common/Rpi-fbcp.zip sudo unzip ./Rpi-fbcp.zip cd rpi-fbcp/ sudo rm -rf build sudo mkdir -m 777 ./build cd ./build sudo cmake .. sudo make -j4 sudo install fbcp /usr/local/bin/fbcp
sudo nano /etc/rc.local
Before adding the following code to exit 0, be sure to add "&" to run in the background, otherwise the system may not start.
sleep 20 fbcp &
Restart to take effect
Monday-Friday (9:30-6:30) Saturday (9:30-5:30)
Email: services01@spotpear.com