Raspberry Pi 5 inch Touch screen with HDMI


Raspberry Pi 5 inch Touch screen with HDMI

January 2016

The Raspberry Pi 2 is a capable PC and therefore is worth putting a screen on it for some applications.

I bought a 5 inch screen with touchscreen from eBay. It was titled "5-inch Resistive Touch Screen LCD Display HDMI for Raspberry Pi XPT2046".

It cost ~USD$40 (January 2016)

It has a resolution of 800x480.

Hardware



This model requires no other connections. The HDMI board happily connects to both the Raspberry Pi 2 and the screen.  Further this screen has a female IDC header on the back which exactly mates with the GPIO header on the Raspberry Pi 2.

This means installation is as easy as connection the screen to the Raspi and plugging in the HDMI board.

Note the power is shared as well so you only need one power supply to power the Raspi and the screen.

The GPIO header makes the necessary connections to allow the touchscreen data to be seen by the Rapsi.

Configuration


It is likely you will need to set up the screen to display properly.


The easiest way to do this is to modify the contents of your /boot/config.txt file.


I SSH'd in from a desktop machine and then used nano on the command line to edit the file:

sudo nano /boot/config.txt


Then you need to make sure your config.txt has the following lines in it to make sure the screen resolution is set:

#Configure 800x480 hdmi screen

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

#Configure the touchscreen SPI feed from the ADS7846 / XPT2046 
#touchscreen controller

dtparam=spi=on
dtoverlay=ads7846,penirq=25,speed=10000,penirq_pull=2,xohms=150


After a reboot, that should allow your screen to display the full 800x480 with touchscreen controller available.


If you have issues, make sure you have at least 128 Mb available for graphics. You can do this by running "sudo raspi-config" at the command line and setting 128Mb or 256Mb for graphics under the memory split option.



Links:
https://blog.ask-a.ninja/?p=48 
http://www.waveshare.com/product/mini-pc/raspberry-pi/expansions.htm

Comments