My 3.5 inch TFT LCD Touch Screen is finally working!

I purchased a 3.5" TFT LCD with Touch Screen at a local shop. Had tough time making it work.
Trying to share my work, so that it may be useful to others.

My LCD is similar to this one:


  1. Assuming you have the latest Adafruit_GFX and Adafruit_TFTLCD Libraries.

  2. In Adafruit_TFTLCD.cpp file, make sure following lines are correct to define proper size.

#define TFTWIDTH 320
#define TFTHEIGHT 480
//#define TFTWIDTH 240
//#define TFTHEIGHT 320

  1. Download MCUFRIEND_kbv library. Better to to do it through Arduino IDE.

  2. Run the example - LCD_ID_readreg.ino.
    Observe serial monitor output. See line mentioned below to ensure ILI 9486 is detected.
    reg(0x00D3) 00 00 94 86 ILI9341, ILI9488

  3. Next, run the example file - diagnose_Touchpins.ino.
    Observe serial monitor output. See lines mentioned below to ensure touch pin connections.
    Testing : (A2, D8) = 25
    Testing : (A3, D9) = 32
    Diagnosing as:-
    XM,XP: (A2, D8) = 25
    YP,YM: (A3, D9) = 32

  4. Goto the link given below. Under sub heading LCD Touch Screen:, Click on SC3A. Download the
    The examples given work perfectly. No need to calibrate touch also.
    We already have all the libraries required. Only the TouchScreen library from this zip is useful.
    Documents and recources,Support & Tutorials

  5. Under examples run the DisplayString.ino. It must work. If colors are inverted,
    add - tft.invertDisplay(1);
    after the line - tft.begin(identifier);
    // you may have to keep doing this for all your sketches.

  6. Under examples run the graphictest_kbv.ino. It must work.

  7. Copy any four, 16 bit or 24 bit .bmp pics 480X320 size to SD Card. Do not give fancy names. Better to call them 01.bmp etc. Insert micro sD Card in the shield.

  8. Under examples run the ShowBMP.ino. Make sure you have given proper BMP file names in the code.

  9. In the Kumantech zip file, under Install libraries folder, copy the TouchScreen folder to your libraries folder. This folder has touchscreen library files.

  10. Under examples run the tftpaint.ino

  11. Under examples run the phonecal.ino


I have tried with UNO only. Attachment shows my display and the rear of the LCD Shield.

My TFT LCD is ILI9486. Pin connections are given below for the shield.

UNO = A0 A1 A2 A3 A4 A5

LCD = D7 D6 D5 D4 D3 D2 X X
UNO = 7 6 5 4 3 2 1 0

UNO = AREF GND 13 12 11 10 9 8


Hello, I have spent a LOT of time figuring out how to use mine, as well. I do know how to use all of it (programming wise) but I would like to ask you if you understand how to program the touchscreen part of the device and the SD card (image thing), as well. Please help if you know how.


I have seen your request today only. I do not know if I have the time to post a tutorial for you. So, I am enclosing the program I wrote to test a simple menu with touch. It has a small bmp pic handling also.

I do not know if your display is identical to mine. DO follow steps mentioned in my original post before trying the attached program.

The code posted is an improvement of code from examples given in MCUFRIEND_kbv library and a few ideas from the internet.

Use any .bmp file of 60x60 pixels size and name it home1.bmp and save it to your sd card of tft.

TFT_03_F.ino (14.3 KB)

Hello everybody.
My first post!
Thanks a lot everybody for all the answers I picked over the last year.

Thank you for this post on tft.
Works fine even if number 5: diagnose_touchpins says nothing in serial. :slight_smile:
Have not tried yet with Sd

Hi Yakopra,

We proceed up to point 5 as ouaichletoph done.
We had nothing in serial during diagnose_touchpins.

It like touch-screen doesn't work.

We tested with TouchScreen_Calibr_Native showed "BROKEN TOUCHSCREEN" on LCD

Any suggestion for us ?

Thank you

Post a link to the actual screen that you have bought e.g. Ebay sale

Say which library version e.g. from IDE Library Manager

Say which library example sketch gives a problem e.g. paste from Serial Terminal.

We have to repeat exactly the same advice to every newcomer.
Yes, it takes you 10 minutes to prepare your question with the necessary information.

The "bonus" is that you get an accurate solution in one reply.


I got mine off Amazon for about $18.

I have mine working and ready to start my project. It worked fine out of the box after installing the lib files from the CD into the arduino libraries directory. Great looking display. I am impressed so far.

I am building my project off of the phone keypad demo code that came with the touch screen.
I need to control a couple of the digital outputs and read a couple of analog inputs.

I am using the mega 2560. I need to know what digital and analog pins are available that are not being used by the display.

Anyone know what pins are available for me to use?



Broken touchscreen as well in TouchScreen_Calibr_Native :
TouchScreen.h GFX Calibration
Making all control and bus pins INPUT_PULLUP
Typical 30k Analog pullup with corresponding pin
would read low when digital is written LOW
e.g. reads ~25 for 300R X direction
e.g. reads ~30 for 500R Y direction

ID = 0x9486

With this one :

Display works fine.
But the touch is not working.

I'm using
Adafruit GFX 1.5.6
MCUFriend 2.9.8

And the sketch comes from

I tried to log every getPoint and always got Z=0 and very high value for X and Y (over 600).

At this point I don't know if I need to calibrate something or if it's a hardware problem.

Any help appreciated.

LCD_ID_readreg tells :
Read Registers on MCUFRIEND UNO shield
controllers either read as single 16-bit
e.g. the ID is at readReg(0)
or as a sequence of 8-bit values
in special locations (first is dummy)

reg(0x0000) 00 00 ID: ILI9320, ILI9325, ILI9335, ...
reg(0x0004) 00 54 80 66 Manufacturer ID
reg(0x0009) 00 00 61 00 00 Status Register
reg(0x000A) 00 08 Get Power Mode
reg(0x000C) 00 66 Get Pixel Format
reg(0x0061) 00 00 RDID1 HX8347-G
reg(0x0062) 00 00 RDID2 HX8347-G
reg(0x0063) 00 00 RDID3 HX8347-G
reg(0x0064) 00 00 RDID1 HX8347-A
reg(0x0065) 00 00 RDID2 HX8347-A
reg(0x0066) 00 00 RDID3 HX8347-A
reg(0x0067) 00 00 RDID Himax HX8347-A
reg(0x0070) 00 00 Panel Himax HX8347-A
reg(0x00A1) 00 93 30 93 30 RD_DDB SSD1963
reg(0x00B0) 00 00 RGB Interface Signal Control
reg(0x00B4) 00 00 Inversion Control
reg(0x00B6) 00 02 02 3B 3B Display Control
reg(0x00B7) 00 06 Entry Mode Set
reg(0x00BF) 00 00 00 00 00 00 ILI9481, HX8357-B
reg(0x00C0) 00 0E 0E 0E 0E 0E 0E 0E 0E Panel Control
reg(0x00C8) 00 00 00 00 00 00 00 00 00 00 00 00 00 GAMMA
reg(0x00CC) 00 04 Panel Control
reg(0x00D0) 00 00 00 Power Control
reg(0x00D2) 00 00 00 00 00 NVM Read
reg(0x00D3) 00 00 94 86 ILI9341, ILI9488
reg(0x00D4) 00 00 00 00 Novatek ID
reg(0x00DA) 00 54 RDID1
reg(0x00DB) 00 80 RDID2
reg(0x00DC) 00 66 RDID3
reg(0x00E0) 00 0F 21 1C 0B 0E 08 49 98 38 09 11 03 14 10 00 GAMMA-P
reg(0x00E1) 00 0F 2F 2B 0C 0E 06 47 76 37 07 11 04 23 1E 00 GAMMA-N
reg(0x00EF) 00 80 00 10 60 40 ILI9327
reg(0x00F2) 00 18 A3 12 02 B2 12 FF 10 00 00 00 Adjust Control 2
reg(0x00F6) 00 54 80 66 Interface Control

Touch shield new tells :
Most Touch Screens use pins 6, 7, A1, A2
But they can be in ANY order
e.g. right to left or bottom to top
or wrong direction
Edit name and calibration statements

Please Calibrate.
Screen is 320x480
Calibration is:
LEFT = 907 RT = 136
TOP = 942 BOT = 139
Wiring is always PORTRAIT
YP=15 XM=16
YM=7 XP=6

ID = 0x9486

Surely this tells you something.

I deliberately ran the Calibration sketch on a broken ILI9486 screen.

TouchScreen.h GFX Calibration
Making all control and bus pins INPUT_PULLUP
Typical 30k Analog pullup with corresponding pin
would read low when digital is written LOW
e.g. reads ~25 for 300R X direction
e.g. reads ~30 for 500R Y direction

Testing : (A1, D7) = 38
ID = 0x9486

There is a diagonal crack in the glass at the bottom left side of the screen.
So it is obvious that the X-direction is broken.
The Y direction is ok for most of the screen.

The sketch finds 38 instead of a typical 30. i.e. it is finding Y
But does not find any valid resistance between A2, D6 i.e. broken X

A successful diagnosis of X, Y pins looks like this:

Testing : (A1, D7) = 30
Testing : (A2, D6) = 23
Diagnosing as:-
YP,YM:  (A1, D7) = 30
XM,XP:  (A2, D6) = 23
ID = 0x9341

Your report finds no X and no Y e.g.

e.g. reads ~25 for 300R X direction
e.g. reads ~30 for 500R Y direction

ID = 0x9486

Have you tried measuring resistance between A1,D7 with a DMM ?

Have you got a cracked glass?
Have you got any Touch panel fitted to the TFT ?
Touch panels have a gold stripe around the active TFT area. Eventually leading to a 4-stripe that goes to a 4-way ribbon.


Thank you for your quick reply.

As you asked about the glass and so on I attach some pictures here.

I noticed something : a ribbon connector at the bottom looks weakly plugged would you agree?

The shield was received like that so I don’t know if it is normal or not.

(Weird fact I have in common with other comments here : the screen protection film had a red line on it. Handwritten with a Sharpie or so)

I have no electrical equipement to measure resistance at the moment.

To get straight to it : should I return it ? Or is it (maybe) just a configuration issue?

Thank you in advance for you wisdom

There is no Touch Panel in your photos.
The diagnostic showed no resistive panels.

If the shop advertised it as a TFT with Touch screen, you can ask for your money back.

Otherwise, put it down to experience. The TFT should give a nice display.


Problem solved I guess.
Thanks for your time and expertise

Good Morning,

I am new Arduino User since January 2019. My first Project is a Driver information Display for Audi and it work well. The Setup is Arduino Mega, Seeed Can Bus Shield, K-Line Shifter 9637D.
The Window in the Cluster ist a little bit bigger than the actualy used 2,8" TFT. I like to use the full Window and i need to change the TFT on 3,2". The Qita 3.2 TFT fits good in the cluster but ther are to many Wire for Conection an there ist a Hardware Inpact with the Can Bus Shild. Probably wrong Deffinition of the two SD Slots.
Waveshare TFT 3,5 fit perfect in the cluster but the TFT do not work. Only the Testcode works fine but nothig else.
The Display, HX 8357/ ILI9684/ SPI do not accept change to Portrait Mode, do not accept UTFT, UTFT Geo, McuFriend Code at all. I Buy the Adafruit 3,5 TFT an hope to find a SPI code that let the Waveshare TFT work because the SPI Hardware Description is identic whit the Waveshare. Different is the DC Pin. Adafruit 9, Waveshare 7. I made the Change by Wire up the Dsiplay. No Chance.
The Waveshare Testcode based on Adafruit Code.
The Codes i try are the Example Code from master MCUFriend, Adafruit GFX, TFTLCD, UTFT, HX8357, ILI 9341 on UNO, Mega and DUE with the correct Wireing Setup. Every metionated Code, with fited Wireing work fine whit Adafruit Display but not whit Wavechare. The same Problem with Waveshare 2,8 ; HX 8347D. The Wireing is correct because the Adafruit BreakOut Display works with the mentionated Code properly.
Bodmers, Schreibfaul Code do not go over the Compiler.

The TestCode from waveshare will be sufficient if i can setRotation to Prortrait and use sevenSegNumFont
Do somebody know a Soution for :
better than that, to Use UTFT or MCUFriend on Waveshare Display ?

Thank You in advance!


Please post a link to the actual display that you have bought. e.g. Ebay sale.

Then you will get an accurate reply.



The Displays are not from e-bay.

Waveshare 3,5 TFT:


Thanks for the link.
You have a Waveshare Display that uses Shift Register to drive an 8080-16 parallel interface.

MCUFRIEND_kbv does not support this. I have no intention of supporting it.
UTFT does not support this.

Bodmer supports it for ESP32, ESP8266
I think that Impulsive has written a library that supports it for MEGA2560. Look at this message



i try the Bodmers lib without succes.

I also read carefully Your posts befor post my Question. That was the Reason to try to solve the Problem with Adafruit 3,5. Seek the SPI Code and aply to Waveshare. Wrong :frowning:

The Adafruit Display use the SPI Way only (or SPI/8Bit) also with a Register. Hope not to make a thinking Mistake: the MC send Data serial to the Shield. The Register store Data on Block to 8 Bit an send them on 8 Bit Bus to the Screen. Right?
It should be the same Principle as usen by Waveshare. 16 Bit Bus ? Like this :

Qita 3.2

This works great whit UTFT / UTFT Geo by seting ITDB32S_V2
The Seting for 4.0" ILI9486 ist CTE40. CTE35 for 3,5" ILI 9486 ist not the Solution.

Modifying the Waveshare TestCode to set Rotation to Portrait and more Fonts will be enough. But how ?



Thank You for the Link.

i know this Code and i already make some Modifications with Commands from the .cpp. The central Problem stay in Stage: the Rotation.


Calvin has very kindly produced this library.

If you have a problem, describe the problem carefully. Raise an Issue on Calvin's GitHub page.

Then Calvin or a reader might be able to help.

Rotations are easy to resolve. Especially since the controller is known to be an Ilitek ILI9486.
Although I have a low opinion of the WAveshare "shift register", I trust Waveshare when they say ILI9486.


I looked at Calvin's GitHub. No one has posted any Issues. No Forks.

Explain what you see for each rotation. PORTRAIT, LANDSCAPE, PORTRAIT_REV, LANDSCAPE_REV i.e. 0, 1, 2, 3
This means for Calvin's code.

If you have mods, make a Fork. Then we can see your changes.

Note that PORTRAIT rotation means ribbon at bottom of screen.