Raspberry Pi – My New MHS 3.5inch LCD Touch Screen

Date:  March 9, 2019

Me getting old.  May be the best way is to document down how I did what, did everything on my RP4 (Raspberry Pi 4).  I will also share what went wrong, and what is correct too.  Learning from mistake will make it work.

The other day, I bought a LCD screen for my RP4.  I believe it is a MHS-3.5inch Clone.

BBEDEF37-A296-4C74-9D9D-C5BC13C5A8A3_1_105_c

Why I know?  Because there is no MHS word there.  But I know it can work with the LCD driver from MHS as the chipsets used is the same.

Why there is a fan there?

30357B24-38E2-4E64-8C35-4DA0DB7CABB7_1_105_c

This is the nice casing I bought from Amazon.

732D64CC-16FB-4BA4-8052-C95A4F3B37C0_1_105_c

This is how you fit the the screen onto the RP4.

7219871C-FF68-49E6-AB9B-E36665E4C2AA_1_105_c

Remember we asked why there is a fan there?

It is to reduce heat from the RP4.  The new RP4 runs at much high speed, and produce a lot of heat.  So, they need a fan to clean those heat.

Won’t make a lot of diff, but at least there is a fan there.

84E808F9-400D-431C-92D2-49DD5DAF1D5B_1_105_c

You cover the box, it becomes like this.  And since it is a touch screen, you can use a sylus with the screen.

But trust me, the screen is too small for anything.  But you can write simple GUI that can touch the button for your program.

8082ABAF-FCEE-4C67-8711-C07AE4354C2D_1_105_c

http://www.lcdwiki.com/MHS-3.5inch_RPi_Display

Let’s install the driver.  As you can see, when you boot up the RP4, the 3.5 inch screen is blank white.

FAC5B224-8937-4464-8C14-EE0B11D0F5DC_1_105_c.jpeg

Do the following…

sudo rm -rf LCD-show

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

chmod -R 755 LCD-show

sudo ./MHS35-show

This will correctly set the launch code to use specific screen.  It will reboot to the correct HDMI screen.

But if you also connect the RP4 to HDMI, then, by right both screen should appear.  Unfortunately, for me, HDMI working fine, but the small 3.5″ screen still give a blank white screen.

Seems like a lot of people are angry with the issue that it does not work.  So, you have to read thru and try and error.

https://www.raspberrypi.org/forums/viewtopic.php?t=178443

So, for me, a simple fix is…

sudo apt-get install fbi

sudo reboot

I suspect this has something to do with the frame buffer interface.  So, once you install this, and I can see my small 3.5″ is rebooted correctly.  (sorry, I have to place it upside down like that.  But I think I can change that too!)

54011E5A-1F64-44E3-B6A8-283A35E2BF8D_1_105_c.jpeg

So, the stupid case has the USB-C and mini HDMI on one side.  So, my whole screen is upside down.  No problem.

cd /boot

sudo nano config.txt

change the line that has

dtoverlay=mhs35:rotate=90

to

dtoverlay=mhs:rotate=270

sudo reboot

And now, the orientation of the screen is correctly done.

8B4FD5E4-397C-41BC-8009-6FFB1A818998_1_105_c.jpeg

This is what the config.txt file should look like for the last few lines.

5E9626DD-0531-48D1-BA91-E9AC8A08449F_1_105_c.jpeg

Now, I am happy.

For you guys, if you bought the 3.5 inch screen, in general, it should work, but you should know which one you bought.  So that you can run the correct installation scripts.

Something that I did not mentioned, is the default installation script will change the screen resolution to very very low resolution.  So, all you need is to go to Preference -> Raspberry Pi Configuration -> Display Tab -> Set Resolution to “CEA mode 4 1280×720 60Hz 16:9”.  You can actually try a few so that it is correct for you.

Next, let’s try to see if we can optimize a bit here and there.  Some will work, some won’t.

Don’t do the following.  Changing it to /dev/fb1 will hang the screen.

Screenshot 2020-03-09 at 9.27.43 AM.png

When the screen is hung, it looks like this.  Not to worry, simply go to the iMac to SSH into your RP4.  The screen is hung, but not the OS.  So, you still be able to revert all changes.

3E461E04-DC86-4A54-89FD-8CFFF43BB13C_1_105_c.jpeg

The other thing I found something wrong is, the touch screen is not callibrated at all!

See from the following… When I use the stylus to touch the screen, the stylus goes hay-wired.  So, we need to fix this.

Forget about again, all the below.  It does not work well.

Screenshot 2020-03-09 at 9.36.46 AM.png

just go and install the following.

sudo apt-get install -y xinput-calibrator

Then, you go to

Menu -> Prefernce -> Calibrate Touchscreen

And remember to Edit the new calibration into the 99-calibration.conf file

Screenshot 2020-03-09 at 9.45.00 AM.png

After changing all these, everything works.  Next time, I. also have a reference point to refer to, configure my 3.5″ LCD screen and the Touch Screen.

4FE6946B-DA9B-46ED-9DED-1D6810398AF4_1_105_c.jpeg

 

 

 

 

Leave a Reply