Friday 23 October 2015

Official Raspberry Pi Touchscreen Display

Official Raspberry Pi Touchscreen Display

David Briddock examines the latest official Raspberry Pi accessory

It’s been a long wait, but on the September 8th the Raspberry Pi Foundation launched its official Raspberry Pi touchscreen display kit. Since then, the display has been available for purchase from the Pi Swag Store (goo.gl/SFNms5) for £48, or from RS Components/Allied Electronics, Premier Farnell/Newark and others at a similar price.


Originally envisaged to be a six month project it overran by around 18 months, partly due to a change of focus and priority in particular releasing the Raspberry Pi Model B+, Model A+ and Pi 2 boards. But, just like the popular Pi camera module (which also arrived much later than originally planned), quality and affordability were goals than couldn’t be compromised.So let’s see if the wait was worth it.

Design


The Foundation’s goal was to offer a quality, embeddable display for the Raspberry Pi. Something easy to setup, yet more capable and better value than alternative Pi displays already on the market. After an extensive hardware evaluation process the final choice was a 7” industrial-quality display from the UK-based Inelco Hunter (inelcohunter.co.uk). The display’s key features are as follows:

• 7” touchscreen
• 800 x 480 pixel resolution
• RGB 24-bit colour
• 60fps video support
• 10-point capacitive touchscreen
• 70° viewing angle
• Metal back with Pi mount holes

Compatibility is an important element. However, at the time of writing, the screen is only compatible with the new Pi 2 Model B, the Model B+ and the Model A+. Which means owners of the older Raspberry Pi Model A or Model B are currently out of luck. At the rear of the display there’s a special adapter board. The Raspberry Pi is mounted on this board and can power the display directly from power pins on the Pi’s GPIO connector. Power can alternatively be sourced from a separate USB power supply rated for at least 500mA.

This adapter board is also used to handle video signal conversion. In particular the parallel signals from the display’s native interface are converted to ones compatible with the Pi’s builtin Display Serial Interface (DSI) port. The decision to go with DSI wasn’t a straightforward one, though, and a significant percentage of the two year gestation period was apparently dedicated to deciding on the most appropriate type of display connection technology.

Display Technology Choice


The Pi already has an HDMI socket, a universal interface capable of supporting high resolutions and not susceptible to electro-magnetic interference. However, the HDMI electronics required to convert between HDMI and the native panel interface can be quite expensive.

A Display Bus Interface (DBI) is another option, but it’s a rather old display technology and, once again, the memory and hardware requirements mean DBI screens tend to be quite expensive. By way of contrast, Display Parallel Interface (DPI) screens are readily available and relatively cheap. Yet, sometimes, they have been known to generate troublesome electromagnetic noise and are prone to high power consumption. DPI connection would also use quite a few GPIO connector pins, which would preclude the connection of other GPIO accessories.

Every Pi already has a high-speed Display Serial Interface (DSI) port. The electromagnetic noise is minimal and power consumption is low. Unfortunately DSI displays are typically made on request, for special niche products.

After much thought the final solution was to employ both DPI and DSI. Quality DPI displays (with high contrast, rich colour, accurate pixel resolution and wide viewing angles) could be obtained at the right price. And DSI ensures the GPIO port pins remain free. All this means the kit has a ribbon cable that goes from the special adaptor board to the Pi’s built-in DSI port.

Official Raspberry Pi Touchscreen Display

Kit Form


For the time being official touchscreen displays are only available in kit form, which is inline with the general Pi maker philosophy. And it proved to be no problem for consumers judging by the initial rush to own the touchscreen display, with initial stocks disappearing almost overnight. The display kit includes:

• 7” Touch Display
• Adapter Board
• Adapter Board mount and screws
• Adapter Board GPIO jumper wires
• DSI Ribbon cable
• Perspex frame (in various colours)

As you can see, and as you would probably expect, some basic assembly is required. As always care needs to be taken to ensure electronic components or other parts aren’t damaged in the process and that all the connections are made correctly. You’ll need to be careful, and then double-check everything, especially connections to the GPIO pins.

You can find a number of step-by-step kit construction explanations online that will walk you through the process. There are a few video demonstrations too, for example this handy little talk/walk-through video created by Alex Eames for his RasPi.tv blog (goo.gl/QaC9Wu).

You will need to type in a few commands to install the display hardware drivers:

$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo reboot

However, once this is done the Raspberry Pi automatically detects the screen and assigns it to be the default display rather than the one connected to the HDMI out).

Dual Displays


For greater flexibility it’s possible to use both the new touch display and an HDMIconnected display at the same time. However, at present this requires a bit of fiddling around with settings, and therefore some knowledge of Linux video drivers. This should change pretty soon, maybe with new Pi configuration options to make the dual display experience an easier process.

Apps will embrace a dual display mode too. In fact, the Omxplayer video player app (elinux.org/Omxplayer), which came out of the popular XBMC project, already has the capability to handle secondary display output.

You can play a video on the touch display (assuming it’s the default display) by typing:

$ omxplayer video.mkv

Then start another video onto the HDMI display by typing:

$ omxplayer --display=5 video.mkv

Touch Unfriendly OS


Having a touchscreen is great, but there is a little problem. For now at least, what’s possible through touch interaction is rather limited. The official Linux-based Raspbian operating system doesn’t come in a finger-friendly configuration as standard. Nor does any other alternative Pi OS for that matter.

To help with this, though, the touchscreen driver outputs both standard mouse events and full multi-touch (10-finger) events, and therefore can imitate a mouse. Also, there's a virtual on-screen keyboard integrated into the latest Raspbian OS release. However, at normal display resolutions the typical stubby finger stab has problems with those mouse-optimised menu selections and buttons. Just making everything bigger drastically reduces the working screen area. Yet, with a little software hacking it’s possible to improve this situation yourself.

Kivy To The Rescue


Kivy is a Python GUI development tool for cross-platform app development. The original goal was to provide an open source development tool for touchscreen devices like smartphones and tablets. Being cross-platform means it also runs fine on the Raspbian OS or other Linux-based operating systems. So, thanks to Kivy you can create touch-friendly apps and games for the touch display.

Pi team member Matt Richardson (goo.gl/iWOXTH) has been experimenting with Kivy and created a touch interface that can interact with Raspberry Pi’s General Purpose IO (GPIO) ports. It’s a pretty basic demo at present, yet the short video (goo.gl/9JUEii) does give a glimpse of Kivy’s potential.

If you’d like to find out more about Kivy, or install it onto your own Raspberry Pi, there’s loads of information at kivy.org/docs.

Official Raspberry Pi Touchscreen Display

Hardware Options


It’s early days for this kit, but the overall quality seems assured if the time the Foundation spent sourcing the components and ensuring Raspberry Pi compatibility is anything to go by. Some things may change, though, like the fact that the touchscreen currently comes in kit form. Even a no-soldering setup doesn't suit everyone, so we can expect to see prebuilt options appearing soon. If it could cost around $100, it will still be great value.

It’s also possible that this touchscreen could be incorporated into all-in-one, fullyintegrated products. For example portable infotainment systems and various embedded scenarios, such as a Pi-powered imitations of an iPad mini or a smaller-sized Android tablet. Most of the innovation is likely to come from the maker community, though, as the display’s portability will itself give rise to a multitude of new options. It should be interesting, and no doubt entertaining, to see what sort of devices and hardware hacking projects appear over the next year.

Software Options


The biggest changes are likely to come from software, however. As we mentioned earlier the user experience (UX) needs to be adjusted for touch-centric operations, which is a significant challenge. The scope of this could be anything from a completely new touchfriendly UX layer, to specific apps and games that take full advantage of touch interaction (maybe using the Kivy toolkit).

The Raspberry Pi Foundation has already announced a number of touch-enabled educational apps, which it hopes will help to simplify learning and coding activities on the Raspberry Pi, and the official Raspbian operating system could itself see some additional updates; switching into a touchfriendly UX mode at boot-up, for example, or a much simpler way to set up a dual display configuration. The potential in the games area alone is enormous. What about touch-enhanced versions of popular retrostyle games? Or even gesture-enabled bigname classics like Elite and Minecraft?

Bright Future


This is the most impressive Raspberry Pi accessory since the 5MP camera module (which is now just £21 from The PiHut). Just like the camera module, the quality and functionality offered at the price is outstanding. It may be enough to entice commercial organisations to build a range of associated accessories, which in turn could fuel many new open source software projects. All of a sudden, the Raspberry Pi enthusiast's world looks a whole lot more interesting.