Tiny Screens for Raspberry Pi - Waveshare 3.5 Inch LCD

Updated 16 February 2023

There is a whole range of Sub-4 Inch Displays that attach directly to the GPIO pins of Raspberry Pi Palm-Sized Computers. Many of them are touch devices and increase the usability of your Raspberry Pi whilst making almost no size sacrifices. Letting you create a literal Pocket Computer! They all go through a very similar process to set up and have running effectively on top of your Raspberry Pi Boards.

Often you will find terminology like TFT and IPS to describe the LCD screen. TFT (stands for thin-film transistor) are lower cost screens when compared to IPS (in-plane-switching) displays. IPS screens are an improvement on TFT screens as they will have a wider viewing angle, accurate colour in all directions, and a faster response time. The other comparison between these displays is between capacitive or resistive touch. Resistive touch screens use pressure on the screen as the input (thus can be used with gloves very well) and are cheaper to produce than a capacitive screen. Capacitive screens are the method most modern smart phones utilise and their operation relies on the electrical properties of the human body as the input. These screens are more enjoyable to interact with and can work with multi-points of simultanous input.

So, this guide is the specific process to set up the Waveshare 3.5 Inch LCD 480x320 for the Raspberry Pi which is the perfect example to dive into this world. The process here is readily transferable for whatever Raspberry Pi GPIO Display you have. See contents below.

- What You Need

- Initial Set-Up

- Terminal Commands

- Screen Sizing (Resolution Adjustment)

- Touch Screen Calibration

Extra Settings Tweaks To Increase Speed with This Display

For scenarios where a high frame rate is valuable/desired, such as playing retro games, whilst keeping the same form factor the display methods I would direct you to use IPS HDMI screens as you will get fantastic results straight away. The HDMI ports on the Raspberry Pi boards are very powerful and more effective at transferring video data than the GPIO pins. Often the GPIO will still be used with these boards for the touch functionality and screen stability. Another method to get a video display out of a Raspberry Pi that you can have both large screens and fast frame rates is by connecting the screen to the DSI port via a Ribbon port. if you are interested in connecting up an LCD via the DSI Ribbon Cable we have the guide for you.

But for situations where you only desire a simple UI with touch and one you can set up whilst completely avoiding using a Raspberry Pi headless then these small displays are perfect. The GPIO also offers a very rugged sturdy connection and together make for a compact nugget of practical computing power. The process will be done in this guide so that you do not need to access the Raspberry Pi headless. This is a much easier way to approach setting up a Raspberry Pi system with a GPIO display for beginners but you can definitely do this process remotely. A great guide to get you up to speed with headless is this but it is not crucial knowledge for this tutorial.

As always if you have any questions, queries, or things to add please let us know your thoughts!


What You Need

Below is everything you need to set up your Raspberry Pi With a GPIO Display HAT.Waveshare 3.5 Inch Display looking pretty in a multicolour case

- A Raspberry Pi (in my case I use a Raspberry Pi 4 Model B 2GB but this display is perfect for an earlier lower-spec Pi like the Raspberry Pi 3)
- Waveshare 3.5inch LCD 480x320 
Micro SD Card flashed with Raspberry Pi OS 
Power Supply 
- Monitor
HDMI Cord 
Mouse and Keyboard

Part of this process will involve connecting a Raspberry Pi 4 Model B directly to a monitor, if any of that makes you feel out of your depth this guide will get you right up to speed.


Initial Set-Up

This 3.5-inch display is perfect for static user interfaces and control where a high framerate is not crucial. Scenarios where you have created virtual buttons to control light switches or solenoids by pressing the UI on the screen comes instantly to mind. With the screen installed you will be able to physically touch the screen for navigation and see the whole Raspberry Pi OS displayed on the screen.

Start by connecting the Raspberry Pi 4 Model B to the screen by lining up the GPIO pins and carefully pressing the two together. See below for an image of this. If you're connecting an IPS Touch board you will have an extra connection between the two HDMI ports

The two parts separated and then pressed together making sure to line up the GPIO Pin correctly

 

With that complete, insert your SD card (which has been flashed with Raspberry Pi OS), connect your Raspberry Pi to the monitor, keyboard, and mouse, and power up the system. See below for an image of all these ports being filled on the Raspberry Pi 4 and what the attached GPIO screen will display when powered at this stage.

What the device will look like once you connect it

 

You will see on your monitor that comforting Raspberry Pi OS as the Raspberry Pi 4 Model B will boot up as it should. At this stage connect the Raspberry Pi 4 Model B to the internet (using the WIFI button on the top right of the screen and supplying it with Country and WIFI details). With that complete, you are now ready to open up the terminal. 


Terminal Commands

The Terminal can be opened up by using the black button located on the top left of the Raspberry Pi OS Screen. It is here that we will download from the internet several important drivers and tell the Raspberry Pi 4 to display to the Waveshare screen. With the Terminal opened up like the image below type and enter the following into the terminal.

git clone https://github.com/waveshare/LCD-show.git

First Terminal Command
 
 
This will have successfully downloaded all the information needed for this Waveshare Screen. If you are using a different screen check this page as it will supply you with the specific terminal command required for your screen. Each GPIO screen manufacturer for Raspberry Pi has a Wiki similar to this, often almost identical in formatting. For instance, here is the wiki documentation for the 3.5 inch TFT Touchscreen for Raspberry Pi by DFROBOT.

Now with that complete, type and enter the three following lines into the Terminal. The image below will show the effect that this will have (which is as soon as you enter that third one the system will reboot and you will have the Raspberry Pi OS displayed on both your monitor and your GPIO Screen).

cd LCD-show/
chmod +x LCD35-show
./LCD35-show

Its alive and Working!

 

Now if your screen is upside-down from the direction that you want a quick terminal command will fix you right up. If you want to do a full 180-degree rotation type the following into the terminal (replace 180 with 90 or 270 if you want other cardinal orientations).

cd LCD-show/
./LCD35-show 180


Screen Sizing (Resolution Adjustment)

Getting the correct screen sizing on your little monitor is the next step. This Waveshare 3.5 Inch screen has a more uncommon 15:9 size ratio so it will not automatically go to the optimal size.

The fastest way to change this is to click the top left Tool-Bar Button (the one with the Raspberry Symbol on it), then clicking Preferences, and then clicking on the Raspberry Pi Configuration Button. With this open navigate to the Display tab, see image below for this. In this browser, you will see two important settings. First is Underscan. Set this to Disabled so that way no matter what your display will not have black borders. Next is Set Resolution. Click this and select your resolution, in this case for the Waveshare 3.5 Inch screen select the CEA mode 109 480x320 59Hz 15:9. See this setting highlighted in the image below. With that done run a restart and these settings will be locked in.

Setting the Screen Resolution


Touch Screen Calibration

If you have a problem accurately selecting objects on your 3.5-inch touch screen that problem can quickly be rectified by running a touch calibration. First, we need to install the xinput-calibrator program which will allow us to run this application. Type and enter the following into a new terminal window to download this program.

sudo apt-get install xinput-calibrator

This will run a quick downloader. With that complete, you can then find this program by clicking on the top left Tool-Bar Button (which has a Raspberry Symbol on it), then clicking on Preferences and clicking on the Calibrate Touchscreen Button. This will run a quick wizard as you can see in the image below which when completed correctly will calibrate your screen. Calibrate it correctly by clicking in the middle of each subsequent red X as they appear. See the image below of this occurring.

Calibration time!


Extra Settings Tweaks To Increase Speed with This Display

So it is now working and you want to squeeze out some extra performance from your screen by diving into the configuration files. Type the following two lines into a new terminal (the image below will show the effect that this will have once you press enter on this). 

cd /boot
sudo nano config.txt

 

Secret Menu

 

In this terminal, now with all the blue text, you can navigate your cursor around it with your Arrow keys on your keyboard. Take the time to read the options available to you. By 'uncommenting' a line (which really means deleting the hash/number key) you can turn on that setting. You have a lot of control in this area. For instance, you can lower the resolution to seriously improve FPS and response time. You can even directly type your own settings. For this particular Waveshare screen, the two settings I add/uncomment are listed below. The first will increase the CPU speed of the Raspberry Pi and the second will increase the speed of the screen and push it towards working at 30FPS. Each particular screen will have different settings but all will be able to be adjusted via this configuration text file. 

arm_freq = 800
dtoverlay=waveshare35a:speed=41000000,fps=30

Having done this press Ctrl-X, Y, and then Enter Key to save and lock in these changes. Run a reboot and the changes will become active. Now will have a noticeably faster Waveshare 3.5 Inch LCD. Once again, for gaming, I would recommend the IPS version or even better a larger screen so you won't feel like you need a magnifying glass the whole time.

If I wanted to lower the resolution I would add and save the below line to the configuration text file. See the image below for all these settings added to the configuration text file and which are about to be saved. A quick explore online will often provide you excellent hidden settings to adjust for each particular mini screen. You can even find and add new firmware and drivers to directly control the screen's processor if you dive deep into the world.

hdmi_cvt 320 240 60 6 0 0 0 

 Configuration with new settings

Have a question? Ask the Author of this guide today!

Please enter minimum 20 characters

Your comment will be posted (automatically) on our Support Forum which is publicly accessible. Don't enter private information, such as your phone number.

Expect a quick reply during business hours, many of us check-in over the weekend as well.

Comments


Loading...
Feedback

Please continue if you would like to leave feedback for any of these topics:

  • Website features/issues
  • Content errors/improvements
  • Missing products/categories
  • Product assignments to categories
  • Search results relevance

For all other inquiries (orders status, stock levels, etc), please contact our support team for quick assistance.

Note: click continue and a draft email will be opened to edit. If you don't have an email client on your device, then send a message via the chat icon on the bottom left of our website.

Makers love reviews as much as you do, please follow this link to review the products you have purchased.