Today we will test the kit Waveshare consisting of a touch screen 7 inches (1024×600 pixels) and an acrylic support in the back of which it is possible to install a Raspberry Pi or another Mini PC. In the previous two articles, we discovered the ePaper screens from the Chinese manufacturer Waveshare (2.7” ePaper screen test and a weather station project connected to Jeedom). Waveshare also manufactures a full range of LCD / TFT touch screens for the Raspberry Pi (all models). These screens are also compatible with Windows, Linux and other mini-PCs such as the Banana Pi. By compatible, I mean that Waveshare is developing the drivers supporting the touch screen function for Windows, Debian (x86 and ARM). To make this tutorial, I used the kit 7 ” marketed for about €45 / $55 on Gearbest (excluding shipping and without the Raspberry Pi 3) and followed the steps on the official Waveshare WiKi.
Unpacking the Waveshare LCD / TFT 7” Touch screen Kit for Raspberry Pi
The kit is delivered in a box of very good quality. The touch screen is properly packaged in a protective foam. The kit includes
- A 7” LCT / TFT touch screen
- An HDMI cable
- USB cable for touch
- The inclined support to assemble. The support is composed of acrylic plate 3mm thick
- Fasteners: spacers, nylon screws, 8 brass spacers to fix the Raspberry Pi
- A CD Rom with the image of Raspbian, the drivers for Windows
- A felt to clean the screen
Only regret, it lacks a pencil. If you do not have too big fingers, it’s not a big problem with a 7 ” screen. At least, it avoids losing it
Assembling the Waveshare LCD / TFT 7” Touch Kit for Raspberry Pi
Begin by removing the sheet of protective paper on each piece of acrylic structure. We will start the assembly by the inclined foot. As you can see, there are two angles of inclination.
To assemble the foot, a screen must be inserted into the white crossbar slot. The two pins are inserted into the housing on the vertical sides. We finish the assembly by screwing the black screw M3.
Inclined support assembled
Take the white frame. The notch in the frame down (it allows the passage of the web of the touch system). Insert a white screw into each hole. On the other side, place a white nylon spacer. Position the screen inside the frame. Place a new spacer.
Then prepare the fixing of the Raspberry Pi. For the Raspberry Pi 3, use the holes # 2. Turn the back plate so that the side notch (HDMI and USB cables) is on the left and up. Secure the 4 spacers with an M3 nut.
Then attach the Raspberry Pi 3 (HDMI output upwards) using 4 M3 screws.
Place the back plate on the screen and complete the assembly by screwing the 6 nuts onto the white screws. Hand tighten.
Now connect the screen to the Raspberry Pi using the HDMI cable and the micro-USB (touch) output to a USB port of the Raspberry Pi 3.
That’s it, the editing is over.
At the first start, it is necessary to modify the configuration of the display. Here is the picture you will definitely get when starting Raspbian.
The config.txt configuration file is located in the /boot folder at the root of the distribution. Open the configuration file by running the command nano /boot/config.txt and add these configuration lines to the end of the file
max_usb_current=1 hdmi_group=2 hdmi_mode=87 hdmi_cvt 1024 600 60 6 0 0 0 hdmi_drive=1
Save with the key combination CTRL + X then Y and reboot the system with the sudo reboot command.
The configuration is almost the same from one screen to another. It will be necessary to indicate the resolution and the refresh rate with the parameter hdmi_cvt.
It is possible to change the orientation of the screen by adding the option display_rotate to the configuration. This option can take as value:
- 1 for 90°
- 2 for 180°
- 3 for 270°
Driver installation and touch configuration
Waveshare screens use the USB port to manage the touch which leaves the GPIO of Raspberry Pi 3 totally free for your projects. The drivers are available online on the repositories of the distribution. No need to copy any file from the delivered CDRom. Run this command to install the driver
sudo apt-get install xserver-xorg-input-libinput
We must then create a configuration file for X11
sudo mkdir /etc/X11/xorg.conf.d
Then copy the file a configuration file delivered with the driver
sudo cp /usr/share/X11/xorg.conf.d/40-libinput.conf /etc/X11/xorg.conf.d/
You have to make a small modification to the file
sudo nano /etc/X11/xorg.conf.d/40-libinput.conf
On the official Wiki, it is indicated that you must add this line option “CalibrationMatrix” “0 1 0 -1 0 1 0 0 1” below the option MatchIsTouchscreen “on”. Do not do this unless you have changed the orientation of the screen.
# Match on all types of devices but tablet devices and joysticks Section "InputClass" Identifier "libinput pointer catchall" MatchIsPointer "on" MatchDevicePath "/dev/input/event*" Driver "libinput" EndSection Section "InputClass" Identifier "libinput keyboard catchall" MatchIsKeyboard "on" MatchDevicePath "/dev/input/event*" Driver "libinput" EndSection Section "InputClass" Identifier "libinput touchpad catchall" MatchIsTouchpad "on" MatchDevicePath "/dev/input/event*" Driver "libinput" EndSection Section "InputClass" Identifier "libinput touchscreen catchall" MatchIsTouchscreen "on" #Option "CalibrationMatrix" "0 1 0 -1 0 1 0 0 1" MatchDevicePath "/dev/input/event*" Driver "libinput" EndSection
If you need to orient the screen, here are the calibration settings to insert into the configuration file. It is necessary to restart the system after each modification.
- 90°: “CalibrationMatrix” option “0 1 0 -1 0 1 0 0 1”
- 180°: Option “CalibrationMatrix” “-1 0 1 0 -1 1 0 0 1”
- 270°: “CalibrationMatrix” option “0 -1 1 1 0 0 0 0 1”
This 7 inch diagonal LCD is of good quality. The touch system is accurate and responsive. At times, I noticed the appearance of streaks that move quickly from bottom to top in less than a second. I did not find the source of the problem. It may just be the power supply of my old PC that I use to develop in 32-bit Linux that is the cause. The acrylic support delivered with this screen is a real plus. For less than €45 / $55 on Gearbest (excluding postage and without the Raspberry Pi 3), we have a complete display solution for the Raspberry Pi.
- Get Started with HC-SR04, measure distance by ultrasound. Arduino code example
- ESP32, GPIO pins and associated functions. I/O, PWM, RTC, I2C, SPI, ADC, DAC
- ESP32-CAM pinout and equipments. ESP-EYE, AI Thinker, TTGO T-Camera, M5Stack Timer Camera …
- ESP32-CAM. Which model to choose? ESP-EYE, AI Thinker, TTGO T-Camera, M5Stack Timer Camera …
- M5Stack Atomic GPS. ESP32 TinyGPS++ tracker, GPX export on SD card, visualization on Google Maps or VSCode
- Home Assistant. Install the snap on Synology NAS on an Ubuntu Virtual Machine