Difference between revisions of "5 Inch LCD Touch Screen Monitor for Raspberry Pi"

From Wiki
Jump to: navigation, search
Line 3: Line 3:
 
[[File:inch1.jpg]]<br>
 
[[File:inch1.jpg]]<br>
  
Designed for Raspberry Pi, the 5 inch HDMI display screen monitor holds a resistive touch screen with a resolution of 800x480. It supports back-light control with a button on the backside to control. With the HDMI interface, it doesn’t occupy any I/O port of Raspberry Pi. This touch screen monitor supports touch screen control and 800 x480 resolution, providing a perfect visual experience for you.<br>
+
This is a 5inch HDMI resistive touch screen designed for Raspberry Pi with a resolution of 800x480.
 +
The backlight can be controlled by a switch on the back, which can be turned on or off as needed.
 +
All versions of Raspberry Pi are compatible with it, but the Raspberry Pi Zero / Zero 2 W requires its own HDMI cable.
 +
The monitor can also be used as a computer monitor, but then the touch functionality will not work.
 +
 
  
 
If you have any problem, please feel free to contact us, by email to service@sunfounder.com or posts on our FORUM. We'll reply you ASAP. Thanks for support!<br>
 
If you have any problem, please feel free to contact us, by email to service@sunfounder.com or posts on our FORUM. We'll reply you ASAP. Thanks for support!<br>
Line 15: Line 19:
 
==Features==
 
==Features==
  
* 硬件分辨率为800×480
+
* Resolution of 800×480
* 电阻式触摸控制
+
* Resistive touch
* 兼容并可直接插入任何版本树莓派(树莓派Zero / Zero 2 W需另配HDMI连接线)
+
* Compatible and can be plugged into any Raspberry Pi (Raspberry Pi Zero / Zero 2 W requires its own HDMI cable)
* 支持Raspberry Pi OS / Ubuntu / Kali和Retropie系统
+
* Supports Raspberry Pi OS / Ubuntu / Kali and Retropie systems
* 可作为计算机显示器,无触摸功能(接入计算机须另配HDMI线)
+
* Can be used as a computer monitor without touch function (additional HDMI cable is required to connect to computer)
* 仅用于显示,不占用任何I/O资源(使用触摸功能,占用I/O)
+
* Only for display, does not occupy any I/O resources (use touch function, occupy I/O)
* 支持背光控制,更省电
+
* Support backlight control, more power saving.
  
  
==硬件连接==
 
  
将树莓派插入到显示屏上,把HDMI桥接板接入屏幕和主板的HDMI接口,并把LCD背后的Backlight拨到“ON”。
+
==Hardware Connection==
 +
 
 +
With the HDMI bridge board, connect the Raspberry Pi to the HDMI port of the display, and turn on the backlight control switch.
  
 
     [[File:inch5.jpg]]
 
     [[File:inch5.jpg]]
  
  
注:树莓派Zero / Zero 2 W需另配HDMI连接线进行连接。
+
<font color="red">Note:</font><br>the Raspberry Pi Zero / Zero 2 W requires its own HDMI cable
  
==软件设置==
+
==Install Raspberry Pi OS==
  
 
An operating system needs to be installed onto the Micro SD card before inserting it into the Raspberry Pi.
 
An operating system needs to be installed onto the Micro SD card before inserting it into the Raspberry Pi.
  
<font color="red">Note:</font><br>
+
<font color="red">Note:</font><br>Skip this chapter if the Raspberry Pi already has an operating system installed.
 
+
Skip this chapter if the Raspberry Pi already has an operating system installed.
+
  
  
Line 45: Line 48:
  
 
Browse to the Raspberry Pi Imager site and download the version that matches the computer or laptop\'s  operating system (www.raspberrypi.org/software). When the download is complete, launch the installer program and follow the prompts to install the Raspberry Pi Imager.
 
Browse to the Raspberry Pi Imager site and download the version that matches the computer or laptop\'s  operating system (www.raspberrypi.org/software). When the download is complete, launch the installer program and follow the prompts to install the Raspberry Pi Imager.
 
  
 
[[File:3d1.png]]
 
[[File:3d1.png]]
Line 56: Line 58:
 
In the Raspberry Pi Imager, click '''CHOOSE OS''' -> '''Raspberry Pi OS'''.
 
In the Raspberry Pi Imager, click '''CHOOSE OS''' -> '''Raspberry Pi OS'''.
  
[[File:3d3.png]]
+
[[File:3d33.png]]
  
  
Line 63: Line 65:
 
[[File:3d4.png]]
 
[[File:3d4.png]]
  
Click the **WRITE** button.
+
Click the '''WRITE''' button.
  
 
[[File:3d5.png]]
 
[[File:3d5.png]]
  
烧写完成后,打开TF卡根目录的config.txt文件,在config.txt最后加入以下代码,保存并安全弹出TF卡。
+
After writing, open the config.txt file in the \boot directory of the TF card.
 +
 
 +
[[File:3d5.png]]
 +
 
 +
Add the following code at the end of <code>config.txt</code>, then save and eject the TF card.
 +
 
 +
<font color="red">Note:</font><br>No spaces on either side of the = sign.
  
 
<pre>
 
<pre>
Line 77: Line 85:
 
</pre>
 
</pre>
  
将TF卡插入树莓派,给树莓派上电,正常等待十几秒后可正常显示。但此时触摸的是有问题的,需要对触摸进行校准。
+
When you insert the TF card into the Raspberry Pi, power it up, and wait for a while, the Raspberry Pi will start normally. In this case, the touch may be faulty and needs to be calibrated.
  
  
==触摸校准==
+
==Touch Calibration==
  
该显示屏可以通过xinput-calibrator进行校准。
+
The display can be calibrated with <code>xinput-calibrator</code>.
  
执行以下命令,安装相关软件:
+
Execute the following command to install the relevant software.
  
 
<pre>
 
<pre>
 +
sudo apt-get update
 
sudo apt-get install xserver-xorg-input-evdev xinput-calibrator
 
sudo apt-get install xserver-xorg-input-evdev xinput-calibrator
 
</pre>
 
</pre>
  
如果执行失败可以查看这里能遇到的问题
+
Copy the contents of <code>10-evdev.conf</code> to <code>45-evdev.conf</code>, then open the <code>99-calibration.conf</code> file.
 
+
执行以下命令:
+
  
 
<pre>
 
<pre>
Line 99: Line 106:
 
</pre>
 
</pre>
  
在99-calibration.conf添加下以代码:
+
Add the following code to the <code>99-calibration.conf file</code>.
  
 
<pre>
 
<pre>
Line 113: Line 120:
 
</pre>
 
</pre>
  
重启树莓派
+
Touch will work normally after '''restarting''' the Raspberry Pi. With different resistive screens, the accuracy may not be very good using the default calibration parameters, so you need to follow the guide below.
  
On the touch screen, use a mouse, to click '''Menu''' -> '''Preference''' -> '''Calibrate Touchscreen'''. 
+
On the touch screen, click on '''Menu''' -> '''Preference''' -> '''Calibrate Touchscreen'''. 
  
 
[[File:inch2.jpg]]
 
[[File:inch2.jpg]]
Line 123: Line 130:
 
[[File:inch3.jpg]]
 
[[File:inch3.jpg]]
  
After calibration, you will get the following. Copy the contents in the red box. 
+
You will get the following results after calibration. Please copy the contents of the red box. 
  
 
[[File:inch4.jpg]]
 
[[File:inch4.jpg]]
  
In the terminal, type in
+
Open the <code>99-calibration.conf</code> file again.
  
 
<pre>
 
<pre>
Line 133: Line 140:
 
</pre>
 
</pre>
  
Paste what you have copied just now to the file
+
Paste the copied text into the file. You can save the file by pressing ''''Ctrl+X'''', selecting ''''Y'''', and then pressing ''''Enter''''.
 
+
Press '''Ctrl + X''', select''' Y''', and then press '''Enter''' to save the file。
+
 
+
5.In the terminal, type in
+
 
+
<pre>
+
sudo reboot
+
</pre>
+
  
After rebooting, the calibration will be done. 
+
Reboot the Raspberry Pi again and you will see that the touch screen is working properly.

Revision as of 06:38, 28 July 2022

Intrduction

Inch1.jpg

This is a 5inch HDMI resistive touch screen designed for Raspberry Pi with a resolution of 800x480. The backlight can be controlled by a switch on the back, which can be turned on or off as needed. All versions of Raspberry Pi are compatible with it, but the Raspberry Pi Zero / Zero 2 W requires its own HDMI cable. The monitor can also be used as a computer monitor, but then the touch functionality will not work.


If you have any problem, please feel free to contact us, by email to service@sunfounder.com or posts on our FORUM. We'll reply you ASAP. Thanks for support!


Pin Description

5inch.png


Features

  • Resolution of 800×480
  • Resistive touch
  • Compatible and can be plugged into any Raspberry Pi (Raspberry Pi Zero / Zero 2 W requires its own HDMI cable)
  • Supports Raspberry Pi OS / Ubuntu / Kali and Retropie systems
  • Can be used as a computer monitor without touch function (additional HDMI cable is required to connect to computer)
  • Only for display, does not occupy any I/O resources (use touch function, occupy I/O)
  • Support backlight control, more power saving.


Hardware Connection

With the HDMI bridge board, connect the Raspberry Pi to the HDMI port of the display, and turn on the backlight control switch.

   Inch5.jpg


Note:
the Raspberry Pi Zero / Zero 2 W requires its own HDMI cable

Install Raspberry Pi OS

An operating system needs to be installed onto the Micro SD card before inserting it into the Raspberry Pi.

Note:
Skip this chapter if the Raspberry Pi already has an operating system installed.


Raspberry Pi Imager is a quick and easy way to install the Raspberry Pi operating system to a Micro SD card from a computer or laptop.

Browse to the Raspberry Pi Imager site and download the version that matches the computer or laptop\'s operating system (www.raspberrypi.org/software). When the download is complete, launch the installer program and follow the prompts to install the Raspberry Pi Imager.

3d1.png

If the Windows operating system prevents the application from launching, click on More info and then click on Run anyway to install the Raspberry Pi Imager.

3d2.png

Insert the Micro SD card into the computer or laptop's SD card slot. If the computer or laptop only has a full-size port for SD cards, use a Micro SD card adapter. In the Raspberry Pi Imager, click CHOOSE OS -> Raspberry Pi OS.

3d33.png


Select the SD card you are using.

3d4.png

Click the WRITE button.

3d5.png

After writing, open the config.txt file in the \boot directory of the TF card.

3d5.png

Add the following code at the end of config.txt, then save and eject the TF card.

Note:
No spaces on either side of the = sign.

hdmi_group=2
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0
hdmi_drive=1
dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=3900

When you insert the TF card into the Raspberry Pi, power it up, and wait for a while, the Raspberry Pi will start normally. In this case, the touch may be faulty and needs to be calibrated.


Touch Calibration

The display can be calibrated with xinput-calibrator.

Execute the following command to install the relevant software.

sudo apt-get update
sudo apt-get install xserver-xorg-input-evdev xinput-calibrator

Copy the contents of 10-evdev.conf to 45-evdev.conf, then open the 99-calibration.conf file.

sudo cp -rf /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/45-evdev.conf
sudo nano /usr/share/X11/xorg.conf.d/99-calibration.conf

Add the following code to the 99-calibration.conf file.

Section "InputClass"
        Identifier      "calibration"
        MatchProduct    "ADS7846 Touchscreen"
        Option  "Calibration"   "208 3905 288 3910"
        Option  "SwapAxes"      "0"
        Option "EmulateThirdButton" "1"
        Option "EmulateThirdButtonTimeout" "1000"
        Option "EmulateThirdButtonMoveThreshold" "300"
EndSection

Touch will work normally after restarting the Raspberry Pi. With different resistive screens, the accuracy may not be very good using the default calibration parameters, so you need to follow the guide below.

On the touch screen, click on Menu -> Preference -> Calibrate Touchscreen

Inch2.jpg

Then the screen will show 4 points. You need to tap them one by one to calibrate.

Inch3.jpg

You will get the following results after calibration. Please copy the contents of the red box. 

Inch4.jpg

Open the 99-calibration.conf file again.

sudo nano /etc/X11/xorg.conf.d/99-calibration.conf

Paste the copied text into the file. You can save the file by pressing 'Ctrl+X', selecting 'Y', and then pressing 'Enter'.

Reboot the Raspberry Pi again and you will see that the touch screen is working properly.