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

From Wiki
Jump to: navigation, search
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
==Intrduction==
 
==Intrduction==
 +
 
[[File:inch1.jpg]]<br>
 
[[File:inch1.jpg]]<br>
This monitor is specially designed for Raspberry Pi. You're recommended to download and install the image we provide. It is written based on the Raspbian Jessie 2016-9-23 version and we've pre-installed the driver and pre-set the calibration program. So you can just burn it on your card for use. If you want to change the calibration, you can just find the program and alter it. <br>
+
 
Download the image at the bottom of the page, unzip the package downloaded and you'll see a .img file. Burn it to your TF card by win32imager.<br>
+
This is a 5inch HDMI resistive touch screen designed for Raspberry Pi with a resolution of 800x480.
Next, connect the monitor to the Raspberry Pi, and the HDMI board. plug in the TF card with the image file burnt. Connect the power and you can start the use.  
+
The backlight can be controlled by a switch on the back, which can be turned on or off as needed.
Or, you may install the driver based on the instructions we provide in the package. <br>
+
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>
<font color="red">Note:</font><br>
+
 
1) If you're doing this on an HDMI display, you're suggested to plug in the 5inch display into the Raspberry Pi. After the driver is installed and the Raspberry Pi is rebooted, you can see the 5'' screen shows the desktop of the Raspberry Pi, while the HDMI displays the CLI (command line interface).<br>
+
  
 
==Pin Description==
 
==Pin Description==
 +
 
[[File:5inch.png]]
 
[[File:5inch.png]]
==Application==
 
  
This 5 Inch LCD touch screen monitor can be applied to Raspberry Pi 1 model B and B+, 2 model B and 3 model B.
 
  
==Operation Procedures==
+
==Features==
  
[[File:inch5.jpg]]
+
* 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.
  
'''Download''' the simplified installation package below (or [https://s3.amazonaws.com/sunfounder/Raspberry/images/LCD-show.tar.gz here]). Transfer it to the Raspberry Pi.
 
  
Finish the installation with Installation Guide which comes along with the product.
 
  
==Touch Screen Calibration==
+
==Hardware Connection==
  
1.If there's any deviations of the touch screen, you need to calibrate it. On the touch screen, use a mouse, to click '''Menu''' -> '''Preference''' -> '''Calibrate Touchscreen'''. 
+
With the HDMI bridge board, connect the Raspberry Pi to the HDMI port of the display, and turn on the backlight control switch.
  
[[File:inch2.jpg]]
+
    [[File:inch5.jpg]]
  
2.Then the screen will show 4 points. You need to tap them one by one to calibrate.
 
  
[[File:inch3.jpg]]
+
<font color="red">Note:</font>the Raspberry Pi Zero / Zero 2 W requires its own HDMI cable
  
3.After calibration, you will get the following. Copy the contents in the red box. 
+
==Install Raspberry Pi OS==
  
[[File:inch4.jpg]]
+
An operating system needs to be installed onto the Micro SD card before inserting it into the Raspberry Pi.
  
4.In the terminal, type in
+
<font color="red">Note:</font>Skip this chapter if the Raspberry Pi already has an operating system installed.
  
sudo nano /etc/X11/xorg.conf.d/99-calibration.conf
 
Paste what you have copied just now to the file
 
  
Press '''Ctrl + X''', select''' Y''', and then press '''Enter''' to save the file
+
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.
 +
 
 +
[[File: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.
 +
 
 +
[[File: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'''.
 +
 
 +
[[File:3d33.png]]
 +
 
 +
 
 +
Select the SD card you are using.
 +
 
 +
[[File:3d4.png]]
 +
 
 +
Click the '''WRITE''' button.
 +
 
 +
[[File:3d5.png]]
 +
 
 +
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>No spaces on either side of the = sign.
 +
 
 +
<pre>
 +
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
 +
</pre>
 +
 
 +
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 <code>xinput-calibrator</code>.
 +
 
 +
Execute the following command to install the relevant software.
 +
 
 +
<pre>
 +
sudo apt-get update
 +
sudo apt-get install xserver-xorg-input-evdev xinput-calibrator
 +
</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>
 +
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
 +
</pre>
 +
 
 +
Add the following code to the <code>99-calibration.conf file</code>.
 +
 
 +
<pre>
 +
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
 +
</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, click on '''Menu''' -> '''Preference''' -> '''Calibrate Touchscreen'''. 
 +
 
 +
[[File:inch2.jpg]]
 +
 
 +
Then the screen will show 4 points. You need to tap them one by one to calibrate.
 +
 
 +
[[File:inch3.jpg]]
 +
 
 +
You will get the following results after calibration. Please copy the contents of the red box. 
 +
 
 +
[[File:inch4.jpg]]
  
5.In the terminal, type in
+
Open the <code>99-calibration.conf</code> file again.
sudo reboot
+
After rebooting, the calibration will be done. 
+
  
==Attention==
+
<pre>
<font color="red">Warning:</font>sometimes the driver installation may fail to be completed, and will further cause data missing, so you will need to reburn the system. You should clear about the risk.<br>
+
sudo nano /etc/X11/xorg.conf.d/99-calibration.conf
<font color="green">Suggestion:</font>Copy the important information on SD card to another one before driver installation.<br>
+
</pre>
<font color="blue">Here is how:</font>Connect the Raspberry Pi to the display, click '''menu -> Accessories -> SD Card Copier''', and select the proper device to start.<br>
+
[[File:SD-1.png]]<br>
+
[[File:SD-2.png]]<br>
+
  
=='''Resource'''==
+
Paste the copied text into the file. You can save the file by pressing '''Ctrl+X''', selecting '''Y''', and then pressing '''Enter'''.
[https://s3.amazonaws.com/sunfounder/Raspberry/images/5LCD-Show/5.0-inch-LCD-2016-09-23-raspbian-jessie.zip 5.0-inch-LCD-2016-09-23-raspbian-jessie] [[File:ZIP.jpg]]<br>
+
  
[https://s3.amazonaws.com/sunfounder/Raspberry/images/LCD-show.tar.gz LCD-show][[File:ZIP.jpg]]
+
Reboot the Raspberry Pi again and you will see that the touch screen is working properly.

Latest revision as of 07:05, 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.