Difference between revisions of "5inch HDMI LCD (B)"

From Waveshare Wiki
Jump to: navigation, search
 
(41 intermediate revisions by 5 users not shown)
Line 1: Line 1:
[[Category:OLEDs / LCDs]] [[Category:LCD]] [[Category:Raspberry Pi LCD]]
+
<div class="wiki-pages jet-green-color">
{{Infobox item|colorscheme=blue
+
{{Infobox item
 
|name=[[5inch HDMI LCD (B)]]
 
|name=[[5inch HDMI LCD (B)]]
 
|brief=Supports various systems
 
|brief=Supports various systems
|img=[[File:5inch-HDMI-LCD-B-intro.jpg|250px|link=http://www.waveshare.com/5inch-HDMI-LCD-B.htm]]
+
|img=[[File:5inch-HDMI-LCD-B-intro.jpg|250px|{{Amazon_nolink|default={{#ifeq: {{#urlget:amazon|0}}|{{#urlget:Amazon|0}}| default|}}|url=link=http://www.waveshare.com/5inch-HDMI-LCD-B.htm}}]]
 
|caption=5 inch Resistive Touch Screen LCD, HDMI interface, supports various systems
 
|caption=5 inch Resistive Touch Screen LCD, HDMI interface, supports various systems
 
|platform=Supports various systems
 
|platform=Supports various systems
Line 9: Line 9:
 
|userdefinedinfo=Part Number|userdefinedvalue=5inch HDMI LCD (B)
 
|userdefinedinfo=Part Number|userdefinedvalue=5inch HDMI LCD (B)
 
|brand=Waveshare
 
|brand=Waveshare
|{{#urlget:amazon|default}}=display
+
|{{#ifeq: {{#urlget:amazon|0}}|{{#urlget:Amazon|0}}| default|}}=display
|website_cn=[http://www.waveshare.net/ 官方中文站点]
+
|website_cn=[https://www.waveshare.net/shop/5inch-HDMI-LCD-B.htm 5inch HDMI LCD (B)]
|website_en=[http://www.waveshare.com/ Waveshare website]
+
|website_en=[https://www.waveshare.com/5inch-hdmi-lcd-b.htm 5inch HDMI LCD (B)]
 
|interface1 =USB
 
|interface1 =USB
 
|interface2 =HDMI
 
|interface2 =HDMI
 
|related=
 
|related=
 +
{{Product List|Mini PC/Raspberry Pi/Displays}}
 
}}
 
}}
== Introduction ==
+
== '''Introduction''' ==
5 inch Resistive Touch Screen LCD, HDMI interface, supports various systems
+
5-inch Resistive Touch Screen LCD, with a resolution of 800 × 480, supports Raspberry Pi and can also be used as a computer monitor.
  
{{Amazon|{{#urlget:amazon|default}}=display
+
{{Amazon|{{#ifeq: {{#urlget:amazon|0}}|{{#urlget:Amazon|0}}| default|}}=display
 
|More = [http://www.waveshare.com/5inch-HDMI-LCD-B.htm More]}}
 
|More = [http://www.waveshare.com/5inch-HDMI-LCD-B.htm More]}}
== Working with PC ==
 
Turn on the "backlight" switch then connect the LCD to your PC (USB Port of LCD -> USB Port of PC; HDMI Port of LCD -> HDMI Port of PC. Please first connect the USB Ports then connect the HDMI Port). A new touch drive will be recognized by Windows and you can use the LCD as a human interface device. When multiple displays are detected by your PC, the LCD can only be used to control the cursor on main display. So it is proposed to set the LCD as the main display.
 
  
== Working with Raspberry Pi ==
+
=='''Features'''==
For the Windows OS on PC, the resolution of the LCD is automatically identified. Hence, you do not need to make the relative settings. When working with Raspberry Pi, you should set the resolution of the LCD by yourself, or else the LCD screen will not work. For more detail information, please read the following section.
+
*800 x 480 hardware resolution.
 +
*Resistive touch control.
 +
*Using Raspberry Pi, it supports Raspberry Pi OS / Ubuntu / Kali and Retropie system.
 +
*Using as a computer monitor, it supports Windows 11/ 10 / 8.1 / 8 / 7.
 +
*Support backlight control, more power saving.
 +
==='''Video'''===
 +
<youtube>
 +
https://youtu.be/rZtAvrfVTD0
 +
</youtube>
 +
{{5inch HDMI LCD (B) user manual}}
 +
{{5inch HDMI LCD (B) Resources}}
  
Turn on the "backlight" switch then connect the LCD to your Pi (HDMI Port of LCD -> HDMI Port of Pi; USB Port of LCD -> USB Port of Pi; 5V~2A power supply). Download the Raspbian image from [https://www.raspberrypi.org/downloads/ Raspberry Pi web site]. Write the image to a TF card and append the following lines to the config.txt file which is located in the root of your TF card:
+
=='''FAQ'''==
 +
{{FAQ|How could I disable the rainbow screen?
 +
|Please add the following command to /boot/config.txt
 
<pre>
 
<pre>
max_usb_current=1
+
dusable_splash=1
hdmi_group=2
 
hdmi_mode=87
 
hdmi_cvt 800 480 60 6 0 0 0
 
hdmi_drive=1
 
 
</pre>
 
</pre>
You must make sure that there are no spaces on either side of the equal sign.
+
}}
 
+
{{FAQ|How to change the splash screen of Pi?
Save and connect the TF card to your Pi then power up.
+
|You can replace the splash.png from the path /usr/share/plymouth/themes/pix/splash.png to yours.
 
+
}}
(Touch input working well means that the LED firmware is Rev2.1. If the LCD firmware is 1.1, see [[#About LCD revision]])
+
{{FAQ|How to set long press touch on Raspberry Pi capacitive touch screen?
 
+
|
Note: Resolution of Ubuntu Mate OS or Windows 10 IoT Core OS can also be set properly by editing config.txt.
+
===Raspberry Pi Long-press Right-click Software Installation===
 
+
'''Test environment: 2022-04-04-raspios-bullseye-armhf 32-bit system'''<br/>
=== Calibration in Raspbian ===
+
''' Supported models: Support Waveshare DSI LCD, DPI LCD, and HDMI LCD capacitive touch screen series.'''
If a latest Raspbian OS is in used, you should connect your Pi to the internet and install xserver-xorg-input-evdev.
+
===Software Installation===
sudo apt-get install xserver-xorg-input-evdev
+
<source lang="c">
* Just be sure that evdev.conf has a higher number than 40-libinput.conf. For example, rename 10-evdev.conf to 45-evdev.conf. this forces evdev to load after libinput.
+
wget https://files.waveshare.com/upload/1/18/Evdev-right-click-emulation.zip
sudo cp -rf /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/45-evdev.conf
+
unzip Evdev-right-click-emulation.zip
sudo reboot
+
cd evdev-right-click-emulation
 
+
sudo apt install build-essential libevdev2 libevdev-dev
This LCD can be calibrated using a program called xinput_calibrator and you should get and install the program manually with
+
cd 'evdev-right-click-emulation'
sudo apt-get install -y xinput-calibrator
+
sudo cp 'out/evdev-rce' '/usr/local/bin/'
Enter the following commands for touch screen calibration:  
+
sudo chmod +x '/usr/local/bin/evdev-rce'
sudo DISPLAY=:0.0 xinput_calibrator
+
</source>
or select Menu -> Preferences -> Calibrate Touchscreen.
+
Enter the command:<br/>
 
+
<pre>sudo evdev-rce</pre>
After running these commands, there will be a prompt for four-point calibration shown in the LCD screen. Click the points one by one to finish the touch calibration. Then, the new calibration data will be displayed in the terminal, as shows below. Please get these data for future use.
+
After running, you can touch and long press to realize the right-click function.
Doing dynamic recalibration:
+
====Set IP====
Setting new calibration data: 3919, 208, 236, 3913
+
<source lang="c">
 
+
sudo usermod -G 'input' -a pi
Enter the following command to edit 99-calibration.conf:
+
echo 'uinput' | sudo tee -a /etc/modules
sudo nano /etc/X11/xorg.conf.d/99-calibration.conf
+
sudo nano /etc/udev/rules.d/99-uinput.rules
 
+
</source>
Then, the old calibration data will be displayed in the terminal:
+
Add in 99-uinput.rules file.<br/>
Section "InputClass"
+
<pre>
Identifier "calibration"
+
KERNEL=="uinput", MODE="0660", GROUP="input"
MatchProduct "ADS7846 Touchscreen"
+
</pre>
Option "Calibration" "160 3723 3896 181"
+
save it and run it in the terminal.<br/>
Option "SwapAxes" "1"
+
<source lang="c">
EndSection
+
sudo udevadm control --reload-rules
 
+
sudo udevadm trigger
Modify the calibration data to the new calibration data displayed in the step 2):
+
</source>
Section "InputClass"
+
Then reboot:<br/>
Identifier "calibration"
+
<pre>
MatchProduct "ADS7846 Touchscreen"
+
sudo reboot
Option "Calibration" "3919 208 236 3913"
+
</pre>
Option "SwapAxes" "1"
+
Run after reboot (no sudo needed at this point)<br/>
EndSection
+
<pre>
 
+
evdev-rce
Press the keys Ctrl+X, and select the option Y to save the modification.
+
</pre>
 
+
After running, you can touch and long press to realize the right-click function.<br/>
The modification will be valid after rebooting the system. Enter the following command for system reboot:
+
====Set Startup====
sudo reboot
+
Enter the terminal<br/>
 
 
== About LCD revision ==
 
An LCD with Rev 2.1 firmware does not require any drivers, that is, touch function works properly without installing any software. So we did not provide any drivers and images for Rev 2.1 LCDs. The following drivers are only available for the LCD with Rev 1.1 firmware. But if you install the driver for the Rev 2.1 one, it will lead touch function not to work.
 
=== Rev2.1 New Features ===
 
* Standard HID protocol, easy to be integrated into your system.
 
* For the Raspberry Pi, supports Raspbian, Ubuntu Mate, single touch, and driver free.
 
* When work as a computer monitor, supports Windows 10/8.1/8/7, single points touch, and driver free.
 
 
 
=== Rev1.1 and before ===
 
* For the Raspberry Pi, comes with Raspbian driver (works with your Raspbian directly), and Ubuntu image
 
* When work as a computer monitor, touch function is unavailable
 
=== How to distinguish ===
 
<!-- * See the backside of your LCD. The Revision number "Rev2.1" printed means that the LCD firmware is Rev 2.1.
 
* However, "Rev1.1" printed on the backside doesn't mean that the LCD firmware must be Rev 1.1. -->Generally speaking, a LCD shipped after June 2016 is often a Rev 2.1 one.
 
 
 
'''Note:'''
 
The only difference between Rev 1.1 and Rev 2.1 is the firmware, but hardware solutions, placement and routing are all the same. (PCB printings might be different due to different production batches.)
 
 
 
You can verify the firmware by these steps:
 
 
 
1. Using Raspberry Pi: Connect the LCD to your Pi (HDMI Port of LCD -> HDMI Port of Pi; USB Port of LCD -> USB Port of Pi; 5V~2A power supply). Download the image, e.g. Raspbian 2015-11-21 jessie or Raspbian 2015-05-05 wheezy, from [https://www.raspberrypi.org/downloads/ Raspberry Pi web site]. Write the image to a TF card and add the following code to the end of /boot/config.txt:
 
 
<pre>
 
<pre>
max_usb_current=1
+
sudo mkdir ~/.config/autostart
hdmi_group=2
+
sudo nano ~/.config/autostart/right_click.desktop
hdmi_mode=87
 
hdmi_cvt 800 480 60 6 0 0 0
 
hdmi_drive=1
 
 
</pre>
 
</pre>
You must make sure that there are no spaces on either side of the equal sign.
+
Add the following in right_click.desktop.<br/>
 +
<pre>
 +
[Desktop Entry]
 +
Version=1.0
 +
Type=Application
 +
Name=evdev-rce
 +
GenericName=Enable long-press-to-right-click gesture
 +
Exec=env LONG_CLICK_INTERVAL=1000 LONG_CLICK_FUZZ=200  /usr/local/bin/evdev-rce
 +
Terminal=true
 +
StartupNotify=false
  
Save and connect the TF card to your Pi then power up. If touch works, that means the firmware revision is Rev 2.1.
+
#If you want to modify the sensitivity, you can modify the size of the two parameters, LONG_CLICK_INTERVAL=1000 LONG_CLICK_FUZZ=200.
 +
</pre>
 +
||}}
  
2. Without Raspberry Pi: A PC (Windows 10/8.1/8/7) is required which cannot connect with other display device. Connect the LCD to your PC (USB Port of LCD -> USB Port of PC; HDMI Port of LCD -> HDMI Port of PC. Please first connect the USB Ports then connect the HDMI Port). If a new touch drive is recognized by Windows, that means the firmware revision is Rev 2.1. In this case, after the driver successfully installed, you can use the LCD as a human interface device.
+
{{FAQ|Do I need an external power supply when I use a 5-inch HDMI LCD (B) connect to Raspberry Pi?
<!--
+
|When the Raspberry Pi is powered by a 5V 2A power adapter and connects to 5-inch HDMI LCD (H), it doesn’t require an external power supply by default. However, if the user uses the Raspberry Pi to drive other high-power devices at the same time, the USB interface on the Raspberry Pi may be insufficiently powered, at this time an external power supply is required.
* If the touch function doesn't work properly after these steps, the firmware revision is often Rev 1.1, which can also work by other methods, see [[7inch HDMI LCD (B) (Firmware Rev 1.1) User Manual|Rev 1.1 Manual]].  
+
}}
 +
{{FAQ|What can I do if the thin red lines appear on the edge of the screen?
 +
|
 +
*Edit the config.txt and add this line at the end of the config.txt file:
 +
<nowiki>hdmi_drive=1</nowiki>
 +
}}
 +
{{FAQ|How to use the touch function when connected to a Linux PC that is non-designated?
 +
|You can try to compile the universal touch driver "hid-multitouch" into the kernel, which generally can make the touch function work.
 +
}}
 +
{{FAQ|What is the consumption of 5inch HDMI LCD (B)?|
 +
With 5V power input, the working current is about 385mA when the backlight is on, and 195mA when the backlight is off.
 +
}}
 +
{{FAQ|Can the brightness of 5-inch HDMI LCD (B) be adjusted by modifying the resistance?
 +
|The screen brightness can be changed by modifying the resistance of the resistor in the figure below, the default resistance is 2.7 ohms.
  
== Detailed information ==
+
[[File:5inch HDMI LCDB FAQ2.png|400px]]
Depending on the firmware, please view the instructions of different revision:
+
|||}}
* [[7inch HDMI LCD (B) (Firmware Rev 2.1) User Manual]]
+
{{FAQ|What is the refresh rate of this screen?
* [http://www.waveshare.com/wiki/7inch_HDMI_LCD_(B)_(Firmware_Rev_1.1)_User_Manual 7inch HDMI LCD (B) (Firmware Rev 1.1) User Manual(Not support Raspberry Pi 3 Model B)]
+
|
-->
+
60Hz.
{{5inch HDMI LCD (B) Resources}}
+
||}}
 +
{{FAQ|Does the screen not automatically rest, or do I have to execute a command to rest the screen?
 +
|
 +
It depends on the system, if the system has hibernation, the screen will also be black. If it is the official system of Raspberry Pi, the default is about ten minutes without action to have hibernation.
 +
||}}
  
== Anti-Piracy ==
+
== '''Anti-Piracy''' ==
 
{{RPi LCD Anti-Piracy}}
 
{{RPi LCD Anti-Piracy}}
== <font color=red>Beware of knock-offs</font> ==
+
== <font color=red>'''Beware of knock-offs'''</font> ==
 
{{Beware of knock-offs}}
 
{{Beware of knock-offs}}
 
==Support==
 
==Support==
{{Service00}}
+
{{Servicebox1}}
 +
 
 +
[[Category:OLEDs / LCDs|OLEDs / LCDs]] [[Category:LCD|LCD]] [[Category:Raspberry Pi|Raspberry Pi]] [[Category:Raspberry Pi LCD|Raspberry Pi LCD]]
 +
</div>

Latest revision as of 03:12, 8 December 2023

5inch HDMI LCD (B)
Supports various systems
5inch-HDMI-LCD-B-intro.jpg

5 inch Resistive Touch Screen LCD, HDMI interface, supports various systems
{{{name2}}}

{{{name3}}}

{{{name4}}}

{{{name5}}}

Introduction

5-inch Resistive Touch Screen LCD, with a resolution of 800 × 480, supports Raspberry Pi and can also be used as a computer monitor.

More

Features

  • 800 x 480 hardware resolution.
  • Resistive touch control.
  • Using Raspberry Pi, it supports Raspberry Pi OS / Ubuntu / Kali and Retropie system.
  • Using as a computer monitor, it supports Windows 11/ 10 / 8.1 / 8 / 7.
  • Support backlight control, more power saving.

Video

Working with PC

This LCD can support Windows 7 /8 /8.1 /10 /11 system.

1) Turn on the backlight switch on the back of the LCD.

2) Connect the Touch interface of the LCD to the USB interface of the PC. Wait for a while, the windows will automatically recognize the touch function.

3) Connect the HDMI interface of the LCD to the HDMI interface of the PC.

Normally you can see an interface similar to the following figure. (Some PCs may need to be restarted to display.)

5inch-HDMI-LCD-B-Rev2.1-00.jpg

Calibration touch on Win 10 PC

Take the windows10 system as an example:

  • 1. Enter the Windows settings of the system, type in the search bar, and click "Calibrate the screen for pen or touch input" (as shown in the picture below).

Win10 touch011.png

Win10 touch02.png
  • 2. Click "Setup" in the pop-up "Tablet PC Settings" interface:


  • 3. The following text prompt will appear on the screen. Please tap the touch screen with your finger, and the computer will recognize it as a touch screen.

【Note】If the touch screen is blank, press the "Enter" key, and the text prompt will switch to the touch screen. (The screen which displays the text prompt will be used as a touch screen!)

Win10 touch03.png

Working with Raspberry Pi

This LCD can support Raspberry Pi OS / Ubuntu / Kali / Retropie systems. When the LCD works on systems such as Raspberry Pi, the resolution must be set manually, otherwise, it will cause an abnormal display. There is no such problem when the LCD works on the PC version of Windows.

Please download the latest version of the image from the Raspberry Pi official website.

1. Download the compressed file to the PC, and extract the img file.
2. Connect the TF card to the PC and use SDFormatter to format the TF card.
3. Open the Win32DiskImager software, select the system image prepared in step 1, and click write to burn the system image.
4. After the programming is completed, open the config.txt file in the root directory of the TF card, add the following code at the end of config.txt, and save it.

hdmi_group=2
hdmi_mode=87
hdmi_cvt 800 480 60 6 0 0 0
hdmi_drive=1

You must ensure that there are no spaces around the equal sign.
5. Insert the TF card into the Raspberry Pi and turn on the backlight switch on the back of the LCD.
6. Connect the Touch port of the LCD to the USB port of the Raspberry Pi.
7. Connect the HDMI port of the LCD to the HDMI port of the Raspberry Pi, power on the Raspberry Pi, and wait for a few seconds to display normally.

Calibration in Raspbian

Install related software:

sudo apt-get install xinput-calibrator
sudo apt-get install xserver-xorg-input-evdev
sudo cp -rf /usr/share/X11/xorg.conf.d/10-evdev.conf /usr/share/X11/xorg.conf.d/45-evdev.conf
sudo reboot
  • There will be an additional Calibrate Touchscreen in Menu->Preferences, run the demo to calibrate.
  • Perform touch calibration according to the displayed prompt. After calibration, there should be a good touch effect (if the error is relatively large, you can re-run the calibration procedure).
  • If you want to save these touch values, you need to create a new 99-calibration.conf file in the following path:
/etc/X11/xorg.conf.d/99-calibration.conf
  • Save information similar to the following to 99-calibration.conf.

5inch HDMI LCD FAQ1.jpg

Resources

Software

Resources

Note: We don't recommend you do any hardware modification, which may damage the LCD if you are not good at it. So be careful when you follow this manual.

FAQ

 Answer:
Please add the following command to /boot/config.txt
dusable_splash=1
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
You can replace the splash.png from the path /usr/share/plymouth/themes/pix/splash.png to yours.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:

Raspberry Pi Long-press Right-click Software Installation

Test environment: 2022-04-04-raspios-bullseye-armhf 32-bit system
Supported models: Support Waveshare DSI LCD, DPI LCD, and HDMI LCD capacitive touch screen series.

Software Installation

wget https://files.waveshare.com/upload/1/18/Evdev-right-click-emulation.zip
unzip Evdev-right-click-emulation.zip
cd evdev-right-click-emulation
sudo apt install build-essential libevdev2 libevdev-dev
cd 'evdev-right-click-emulation'
sudo cp 'out/evdev-rce' '/usr/local/bin/'
sudo chmod +x '/usr/local/bin/evdev-rce'

Enter the command:

sudo evdev-rce

After running, you can touch and long press to realize the right-click function.

Set IP

sudo usermod -G 'input' -a pi
echo 'uinput' | sudo tee -a /etc/modules
sudo nano  /etc/udev/rules.d/99-uinput.rules

Add in 99-uinput.rules file.

KERNEL=="uinput", MODE="0660", GROUP="input"

save it and run it in the terminal.

sudo udevadm control --reload-rules
sudo udevadm trigger

Then reboot:

sudo reboot

Run after reboot (no sudo needed at this point)

evdev-rce

After running, you can touch and long press to realize the right-click function.

Set Startup

Enter the terminal

sudo mkdir ~/.config/autostart
sudo nano ~/.config/autostart/right_click.desktop

Add the following in right_click.desktop.

[Desktop Entry]
Version=1.0
Type=Application
Name=evdev-rce
GenericName=Enable long-press-to-right-click gesture
Exec=env LONG_CLICK_INTERVAL=1000 LONG_CLICK_FUZZ=200  /usr/local/bin/evdev-rce
Terminal=true
StartupNotify=false

#If you want to modify the sensitivity, you can modify the size of the two parameters, LONG_CLICK_INTERVAL=1000 LONG_CLICK_FUZZ=200.

{{{5}}}


 Answer:
When the Raspberry Pi is powered by a 5V 2A power adapter and connects to 5-inch HDMI LCD (H), it doesn’t require an external power supply by default. However, if the user uses the Raspberry Pi to drive other high-power devices at the same time, the USB interface on the Raspberry Pi may be insufficiently powered, at this time an external power supply is required.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
  • Edit the config.txt and add this line at the end of the config.txt file:
hdmi_drive=1
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
You can try to compile the universal touch driver "hid-multitouch" into the kernel, which generally can make the touch function work.
{{{3}}}
{{{4}}}

{{{5}}}


 Answer:

With 5V power input, the working current is about 385mA when the backlight is on, and 195mA when the backlight is off.

{{{3}}}
{{{4}}}

{{{5}}}


 Answer:
The screen brightness can be changed by modifying the resistance of the resistor in the figure below, the default resistance is 2.7 ohms.

5inch HDMI LCDB FAQ2.png



 Answer:

It depends on the system, if the system has hibernation, the screen will also be black. If it is the official system of Raspberry Pi, the default is about ten minutes without action to have hibernation.

{{{5}}}


Anti-Piracy

Since the first-generation Raspberry Pi released, Waveshare has been working on designing, developing, and producing various fantastic touch LCDs for the Pi. Unfortunately, there are quite a few pirated/knock-off products in the market. They're usually some poor copies of our early hardware revisions, and comes with none support service.

To avoid becoming a victim of pirated products, please pay attention to the following features when purchasing:

RPi-LCD-Anti-Piracy.jpg

(Click to enlarge)

Beware of knock-offs

Please note that we've found some poor copies of this item in the market. They are usually made of inferior materials and shipped without any testing.

You might be wondering if the one you're watching or you've purchased in other non-official stores is original, feel free to contact us.

Support



Technical Support

If you need technical support or have any feedback/review, please click the Submit Now button to submit a ticket, Our support team will check and reply to you within 1 to 2 working days. Please be patient as we make every effort to help you to resolve the issue.
Working Time: 9 AM - 6 AM GMT+8 (Monday to Friday)