Skip navigation
2015

Introduction

This post and few other will appear as annex to the Essential Raspberry Pi Peripherals #2. The reason is that when it was planned this series of tutorials the 7" touch-LCD created for the PI was not yet on the market. When the first unit has been received, I started immediately to study the hardware and software; in these #2 annexes we explore some mods and installation that can be helpful for the users to get the best from this incredible accessory inside their projects.

 

Taking advices and suggestions here and there and seeing some issues that may occur with the 7" touch screen display for the Raspberry PI I have done a prototype of a frame to secure the display when mounted with the control board and the Raspberry PI. My actual usage is for an Info-Point based on the Raspberry PI 2 Mod B.

 

Note that this blog post will show the prototype building of a full working frame for the display while the "commercial" version will be done with white plastic laser-cut based on the same design. The second part will show the building of the back side enclosure to cover the electronic parts. Until now I have not yet found a protective frame of the display also for the front side including the back parts.


Where to find it

You can find the product at Drobott.com Don't forget to apply the Element14 discount code W0E49MYQ (10% off) reserved to the community users!


How the product appears

IMG_20150930_153223.jpg IMG_20150930_153150.jpg IMG_20150930_151106.jpg

The full description by images can be found on the following Google Album.

 

Creating the frames

Measuring the display on both sides I have created three different frames: one front-frame and two back frames.

 

Front frame

IMG_20150924_192652.jpg

Front view of the front-frame; the two extra-area corresponding to the top and bottom sides are used to keep the front and back frames together. This model is so shaped because these are also the supports that keep the display inside the info-pointsupport. A further version with a full thick border will be producer with the same characteristics.

 

IMG_20150924_192620.jpg IMG_20150924_192635.jpg

Back of the front-frame. The two elements that are part of the structure will also help to keep correctly positioned the touch surface over the LCD surface.

 

Back frames

There are two frames on the back side of the screen. The first is locked with four allen screws with the front-frame while the second frame protect the remaining part and offers the base for the back cover of the electronic parts (cables, dipslay control board and Raspberry PI). The opacity in the frames of the images below depends on the prototype manual refining. In this prototype I have used a 2.5 mm thick acrylic but the right final material should be opaque, white 3 mm thick.

 

IMG_20150924_192607.jpg

First back-frame, the nearest to the screen surface.

 

IMG_20150924_194723.jpg

Second back-frame.

 

Assembling

After the pieces are done, the assembly phase is very easy:

 

IMG_20150924_192719.jpg

1) Put the front-frame on a flat surface and the screen device on it (the Raspberry PI should not yet be fixed with screws on the display controller board) remember to remove the protective label from the front side of the screen.

IMG_20150924_193543.jpg

2) Place the first back-frame on the screen and insert the four allen screws. Then close firmly the four nuts.

IMG_20150924_201353.jpg

3) place the second back-frame and fix it to the aluminium display four holes with screws. Last, fix with the four screws the Raspberry PI over the display control board.

In the image above the top frame is locked with two black pieces of plastic, that can be replaced with a 3D printed cover to protect all the electronic parts.

 

Ready to use

The following image shows the finished frame.

IMG_20150924_205738.jpg

The first peripheral we'll take a look at is the HDMI monitor, connected to the Raspberry Pi. As connecting an HDMI monitor to the board is extremely simple it's surprisingly difficult to find information on the Internet about how to solve issues and setup the monitor visualisation that best reflects our needs, so this is actually a great starting place for us.

 

What Your Need for HDMI on Raspberry Pi

As the Raspberry Pi includes a standard, full-size HDMI connector (as opposed to the smaller, micro-HDMI connectors that are starting to appear on similar devices) the only thing you need is a cable like the one shown below.

HDMI_TypeA_to_TypeC_cable_6ft.jpg

Ok, so there's nothing easier than connecting the monitor to the Raspberry PI, yes? Well, almost.

 

Standard Screen Configuration on Raspberry Pi

There's no standard, default configuration that relates to a Raspberry Pi's screen, and this can confuse new users. As a matter of fact, there are two important factors that influence the screen characteristics.

 

The first is the display memory. In the Raspberry Pi (all models) the video memory is a part of the system memory (the RAM) that's shared to manage the graphical display. This means that any memory space we reserve for the display means the less system RAM we have (and vice-versa). This is a parameter to take in account when obtaining the best results we need from the user interface; keeping sufficient memory to run the system and the applications.

 

Note: As almost all the same things run well on the Raspberry Pi 2 and the previous models with only the half of the memory available (the Pi 2 has 1GB of RAM against the 512MB of the other models) on the Pi 2 we are free to be more tolerant when reserving video memory.

 

My suggestion for a better optimisation is to start reserving an initial amount of 64MB for the GPU memory (the Graphic Processing Unit) and eventually increasing this value if we need higher resolution images. The tests done in several working conditions show better graphic results without compromising the processor speed and capabilities suggests that it's possible to share up to 128MB of RAM for the GPU on a Raspberry PI 2 (1/4 of the entire RAM in the previous models!).

 

The easiest way to configure the GPU memory is through th raspi-config utility. The images below shows the menu sequence to set the desired GPU memory in the system.

 

Note: It is possible to set any amount of memory but it is the worth testing the suggestions of the script screen, selecting multiples of 16MB of RAM for the better management of the GPU.

 

From a terminal, launch the command:

sudo raspi-config




































 

From the main menu select Advanced Options.

Screen Shot 2015-08-29 at 16.34.05.png

Then select Memory Split.

Screen Shot 2015-08-29 at 16.34.19.png

Finally, select the desired amount of memory and confirm with the <Ok> button.

Screen Shot 2015-08-29 at 16.34.32.png

 

HDMI Audio on Raspberry Pi

The Raspberry Pi includes a good quality stereo audio Jack (output only). Due to several potential issues, most depending on the other peripherals connected to the board, it's not unusual that the audio quality decreases at times, producing a worse sound than expected.


However, from the Advanced Options menu it's possible to configure the audio output, forcing the sound sent to via the HDMI output instead of the 3.5mm Jack.

Screen Shot 2015-08-29 at 16.52.54.png

Also in the case where the display is not needed (which occurs in lot of portable projects) or, for example, we are using the PiFace CADPiFace CAD or the 2.4" Raspberry Pi Touch Panel2.4" Raspberry Pi Touch Panel, we can still take advantage of the quality of the HDMI audio using a specific HDMI audio cable, as shown in the example below.

Best-Selling-1-5m-1080P-HDMI-Male-to-3-RCA-Audio-Video-Component-Cable-Adapter-For.jpg

 

Fine-tuning the Screen Resolution

We have at least two reasons to fine-tune the screen resolution in the Raspberry Pi settings; the first is that there are HDMI screens with different aspect-ratios, and the second is that we need to change the screen resolution depending on the kind of use, the display size etc.

 

Those who are used to working with the PC know that these parameters are set up and/or detected when the system starts, and in most cases part of the settings are done by changing some BIOS parameters. Other settings - inside a predefined range - can be changed further with proper screen configuration programs like those in Ubuntu desktop and Windows.

 

As the Raspberry Pi does not have a conventional BIOS, most of the configuration parameters, including the screen settings, are loaded by the GPU before the kernel starts from a simple text file named config.txt stored in the system folder /boot

 

Note: the raspi-config utility script we have used above to set the audio channel or the GPU's dedicated RAM make automatic changes to this configuration file, but we can also edit the file directly.

 

The /boot/config.txt file doesn't just contain the graphic display and screen settings, but a lot of other useful information to tailor the behaviour of our system when it starts; in particular for the screen, we can set the resolution, size, aspect ratio, and scan frequency.

 

Take a look at the following group of settings from the config.txt file (some settings are generated automatically by the NOOBS while installing the operating system):

 

# NOOBS Auto-generated Settings:
hdmi_force_hotplug=1
config_hdmi_boost=4
overscan_left=24
overscan_right=24
overscan_top=16
overscan_bottom=16
disable_overscan=0
start_x=0
gpu_mem=128
core_freq=250
sdram_freq=400
over_voltage=0
dtparam=spi=on
dtparam=i2c0=on
dtparam=i2c_arm=on





 

The format of the file is really simple to read and with a minimum of experience, and also to change without damaging the Raspberry Pi's performance. The character '#' is used for a comment line while every parameter is set in the format; <parameter>=<value>

 

Yes, just as in the unbelievable Windows .ini files and some other settings in the Linux environment. So, the only thing we should know is what is the exact meaning of these parameters to set the values in a consistent way. Some parameters are numeric (with a range of accepted values) and some parameters are boolean (can assume only the value yes or no).

 

Before Changing the config.txt Settings

First of all, temporarily disable the automatic graphic desktop when the system starts with the raspi-config configuration script as shown in the following images:

Screen Shot 2015-08-29 at 19.41.52.png

Screen Shot 2015-08-29 at 19.42.17.png

After setting the text console at start up, the system needs to reboot.

 

This operation is for preserving the automatic desktop start up if we see that any settings have gone wrong and the display is unreadable. In this configuration after the system boots we only see the Login prompt; after logging in to launch the graphic desktop we should launch the command startx

 

After every change to the display settings, we reboot and if, after launching the startx command the desktop is unreadable, we can simply roll back the settings to the last correct value.

 

Display Setup Parameters

To correctly manage the display settings we should know the exact aspect ratio and scan frequency of the monitor we will use. The following settings shows an example of the standard PAL settings for Europe on a 1024x768 resolution monitor.

 

# Set sdtv mode to PAL (as used in Europe)
sdtv_mode=2
# Force the monitor to HDMI mode so that sound will be sent over HDMI cable
hdmi_drive=2
# Set monitor mode to DMT
hdmi_group=2
# Set monitor resolution to 1024x768 XGA 60 Hz (HDMI_DMT_XGA_60)
hdmi_mode=16
# Make display smaller to stop text spilling off the screen
overscan_left=20
overscan_right=12
overscan_top=10
overscan_bottom=10












 

A full, comprehensive and detailed look at all the parameters we can set for the best screen performance is described in the attached document RpiConfig, from elinux.org

 

An Overview on the Next Posts

What you will see soon in this series:

 

#3 Kivy: an open source solution for the User Interaction

How to install and use Kivy, a powerful python framework on the Raspberry PI for the best User Interaction on small touch screen devices..

 

#4 An introductory approach to wired and wireless networking

There are more options than simply plugging the LAN cable in the Ethernet port of the Raspberry PI. In this post we'll see how the Raspberry Pi can be a flexible networking device, acting as bridge, access point, wireless device and more.

 

#5 The Raspberry Pi camera beyond the webcam limits

Thanks to the power of Python and the specific characteristics of the Pi Camera it's possible to specialise the Raspberry Pi as a video/photo station: shooting, filming, image processing for a lot of possible applications; from photography to security, from stop-motion to the time-lapse filming.

 

#6 Lirc and IR controller: extending the limits of keyboard and mouse

With a very simple hardware approach we introduce the first non-conventional peripheral connection. Thanks to the Linux lirc library we can use a simplified HID (Human Interface Device) - a TV infrared control - to manage programs, device behaviour, and more.

 

#7 Enhancing our Pi projects with the Pi touchscreen

We will see how we can setup and integrate in our projects the Raspberry Pi 2.4" touch screen device.

 

#8 Enhancing our Pi projects with the PiFaceCAD LCD display

When a simple message is sufficient to control the Raspberry Pi behaviour but some control buttons would be useful, the PiFaceCAD (Control and Display) is the ideal device, which can be stacked on our Raspberry Pi for mobile, battery-powered applications.

 

#8 A multi-sensor system with the Raspberry PI Sense HAT

Coming soon ...