How to Calibrate Raspberry Pi Touch-screen Display

When using the Raspberry Pi as a server or industrial monitoring device, a touch screen is an essential requirement. We’ll show you how to calibrate the touchscreen pointer for enhanced touch precision in this article. Many individuals have told me that their touchscreen display isn’t pointing correctly, so if you’re having this problem, please read this post all the way through. Before you begin with this calibration setup, we recommend that you first set up your display properly. So let’s get this party started.

Touchscreen Calibration

Let’s start with the touch control calibration stage first. The pointer will be much more accurate and easy to use as a result of this. We’ll take it one step at a time.

Step 1:  This procedure must be carried out with superuser (root) rights. To enter root mode, type sudo su at the command prompt:

1.0 Root Mode

Step 2: Now we must install the  xinput_calibrator; for calibration utility, as well as various filters for adjusting the touchscreen response. Install the tslib library by entering aptitude install libts-bin:

More to read on Raspberry Pi :

  • Raspberry pi 400
  • Putty Configuration Raspberry Pi
  • Connect Raspberry Pi to Laptop

1.1 Installing Calibration tool

This will produce a file named /etc/ts.conf that contains variance and jitter parameters that can be tweaked to improve pointer response. Information about configuring ts.conf may be found here.

Step 3: The ts_calibrate calibration utility will be used. We’ll also use a programme named ts test to examine the calibration’s results. In order to use ts_calibrate and ts_test, we must first set proper environmental variables. Enter export TSLIB_TSDEVICE=/dev/input/event0 into the command prompt, then enter export TSLIB_FBDEVICE=/dev/fb1 :

1.2 ts_calibrate command

If you log out of PuTTY or reboot your Raspberry Pi, you’ll have to re-enter these two lines each time you wish to use ts calibrate or ts test.

Step 4 : Now we can use ts_calibrate. Enter ts_calibrate at the command prompt (make sure you are still in root mode) to run the ts_calibrate program. The programme will display five crosses in a row on various regions of the screen, which you must tap as precisely as possible:

1.3 Calibration utility

After the calibration is finished, PuTTY will print the calibration data:


1.4 Calibration data

This calibration information will be saved in a file called /etc/pointercal. Enter cat /etc/pointercal at the root command prompt to see the contents of this file.

Step 5: We should now test the calibration by using the ts_test program. Enter ts_test at the root command prompt to start the program:

1.5 Test Program

To check the calibration’s accuracy, drag the cross around the screen and see how closely it follows your finger or stylus. To access the drawing mode, use the “Draw” button:

1.6 Test precision

To check the calibration’s accuracy, move your finger or pen around the screen. Press Ctrl-C to stop the test.


1.7 ts calibrate test

If necessary, run ts_calibrate again to improve the calibration. At the command prompt, type sudo reboot to reboot, and you should be ready to explore the Raspbian desktop on your LCD touch screen. This is Quite lengthy task, but it is well worth it if you want to correctly calibrate the LCD touchscreen.

Leave a Reply

Your email address will not be published.