Sunday, January 19, 2014

Remote 7" Touchscreen for the Raspberry Pi

There is already a large number of touchscreen solutions for the Raspberry Pi. I present yet another one. The special feature of this solution is that you just need a single HDMI cable to connect the touchscreen to the Raspberry Pi. There is no need for an additional USB cable or any proprietary solution for transmitting the touch information. Therefore, with a long HDMI cable it is easy to place the touchscreen and the Raspberry Pi at different places (e.g. at the wall and inside a cupboard).

The touchscreen itself is the popular 7" AT070TN9X (AT070TN90 or AT070TN92). You can purchase it at your preferred china auctioneer or you invest a litte more money and buy it as A13-LCD7-TS at popular electronic distributors. The second option provides you the advantage of an adapter board by Olimex with convenient pin headers (instead of a flexible flat cable (FFC)) and some voltage regulators for providing the various voltages needed for driving a TFT.

The second thing you need is a PCB that converts from the HDMI signal to the parallel interface of the TFT and provides the circuitry for the touch functionality. It is not available for purchase, but feel free to do whatever you want with the material provided below under the terms of the Creative Commons Attribution 4.0 International License.

The above picture presents the components on the PCB. A LM2675M switching regulator on the right side provides 3.3 V for driving the display as well as the components on the board.

The touchscreen is connected via a large pin header that matches the one on the Olimex board. As already mentioned, the TFT display is driven by a digital parallel interface. It consists of 8 bit per color channel (red, green and blue). Furthermore, it contains a clock signal, a HSYNC and VSYNC (for indicating line and frame starts) and a DE line for indicating blank times. The remaining signals on the header are for power supply, enable display (EN), backlight (BKL), orientation (LR, UD) and touchscreen (TP*).

For converting the HDMI signal to the parallel digital interface, a TFP401A by Texas Instruments is used. A predecessor (the TFP101A) was previously used by Till Harbaum to connect a TFT to the BeagleBoard. The TFP401A is available in a TQFP100 package. Hand soldering is therefore doable with some practice.

Most of the pins are connected to the pin header, while the other major part is connected to the HDMI connector that is shown below. Besides the video signal itself, the HDMI standard provides a I2C interface that is of interest for the remaining parts. As explained in a previous blog post, this is mainly used for transmitting information about the display. For this purpose, one can connect a EEPROM to this interface as shown in the picture below. For the Raspberry Pi, this is not needed and might even cause troubles (as I have experienced...).

Apart from that, other I2C devices can be connected to the Raspberry Pi via this interface, too. It has 5 V signal levels. In order to connect 3.3 V devices, a level shifting logic as explained some time ago is needed.

Two devices are connected to the left side. The first one is a MCP4726 DAC for providing the reference voltage for the backlight. With this device it is possible to set the backlight intensity of the TFT with a simple command by the Raspberry Pi.

The second device is a AD7879-1W touchscreen controller by Analog Devices. Since it is a resistive touchscreen, the controller is responsible for measuring the resistance between the screen layers. This measurement is subject to noise resulting in imprecise measurements. The advantage of the AD7879-1W (compared to a previously tested TSC2003) is the integrated combined median- and mean-filtering to reduce this noise. Furthermore, it is one of the few remaining touchscreen controllers than can be soldered by hand. Most of the modern ICs are provided in QFN packages. This trend has advantages for the compactness of end-user devices, but induces problems for prototyping and hobby projects (unless until someone explains to me how to solder them by hand).

The following pictures show the final PCB as drawing and in reality (unpopulated).

Last but not least it is possible to use prototyping boards instead of a dedicated PCB, but I would not suggest that ;-)