Product: Osoyoo 3.5″ HDMI Resistive Touchscreen
Applicable OS: Raspberry Pi OS Bookworm & Trixie (2025-05-13 and later)
Compatible: Raspberry Pi 5, 4, 3B+, 3, 2, Zero
Calibration Method: evtest + config.txt
This tutorial guides you through setting up the OSOYOO 3.5″ HDMI Resistive Touchscreen on Raspberry Pi with the latest Bookworm and Trixie operating systems. This method uses the evtest calibration approach for precise touch alignment.
swapxy=1 parameter in config.txt for simplified calibration, and the evtest tool for measuring precise touch boundaries.1. Connect the GPIO interface
Raspberry Pi leads out 40 GPIO pins, while the screen leads out 12 pins. When connecting, pay attention to the corresponding pins and Raspberry Pi pins.
2. Connect the HDMI connector
Connect the HDMI connector to the HDMI port of the screen and the Pi.
The hardware connection is as shown below (Pi3B+/Pi4/Pi5):


1) Install the Bookworm or Trixie image as the official website or follow our tutorial.
2) After the image has finished writing, open the config.txt file in the root directory of the TF card, add the following code at the end of config.txt, then save and quit the TF card safely.
hdmi_force_hotplug=1
hdmi_group=2
hdmi_mode=87
dtoverlay=bw-ads7846,penirq=25,xmin=3900,xmax=240,ymin=240,ymax=3900,speed=50000,swapxy=1
3) Download the bw-ads7846.dtbo file. Copy this file to the overlays directory (/boot/overlays/).
Or you can download bw-ads7846.dtbo via SSH after connecting your Raspberry Pi to the network:
sudo wget -O /boot/firmware/overlays/bw-ads7846.dtbo https://osoyoo.com/driver/HDMI-3.5/bw-ads7846.dtbo
4) Quit the TF card safely.
5) Insert the TF card into the Raspberry Pi, power on the Raspberry Pi, and wait for more than 10 seconds to display normally. Generally, touch functions will work normally after system restart. However, if touch inaccuracies occur, perform touch calibration following next steps.
6) Change the Screen Configuration
Click the Raspberry Pi icon → Preferences → Control Centre → Screens, in the new window, click layout → screen → HDMI → resolution → 640×480, then click Apply, and click OK in the new pop. We recommend setting the resolution to 640×480.
If you find that your touch cursor does not align with your finger, you need to calibrate the limits in your config.txt. Since we use swapxy=1, the standard X and Y definitions are transposed. Use this guide to ensure perfect alignment.
Every touch panel has slight manufacturing variances. We use the evtest tool to capture the Raw Absolute Values of our specific screen.
Install & Run:
sudo apt-get install evtest -y
sudo evtest
Select Device:
Choose the ID corresponding to ADS7846 Touchscreen. (The serial number displayed on different users’ Raspberry Pi’s may not be the same, depending on the user’s actual serial number)
| Physical Edge | Record this evtest Value | Mapping to Parameter |
|---|---|---|
| Top Edge | ABS_Y value at the top |
→ xmin |
| Bottom Edge | ABS_Y value at the bottom |
→ xmax |
| Left Edge | ABS_X value at the left |
→ ymin |
| Right Edge | ABS_X value at the right |
→ ymax |
In your /boot/firmware/config.txt, use this base line:
dtoverlay=bw-ads7846,penirq=25,xmin=[ABS_Ymax],xmax=[ABS_Ymin],ymin=[ABS_Xmin],ymax=[ABS_Xmax],speed=50000,swapxy=1
If our measured values are:
You need to edit the config file:
sudo nano /boot/firmware/config.txt
You can see the original setting was:
dtoverlay=bw-ads7846,penirq=25,xmin=3900,xmax=240,ymin=240,ymax=3900,speed=50000,swapxy=1
Replace the above content with:
dtoverlay=bw-ads7846,penirq=25,xmin=3500,xmax=200,ymin=280,ymax=4000,speed=50000,swapxy=1
Save and exit: Press Ctrl+O, then Enter, then Ctrl+X.
This is the more accurate touch range of the current touch device, and finally typing the following to reboot to take effect the current configuration:
sudo reboot
After a sudo reboot, if the cursor still doesn’t reach the very edge, follow these simple rules to adjust your numbers:
| If the cursor… | Action to take |
|---|---|
| Stops before the Top edge | Increase the xmin value |
| Stops before the Bottom edge | Decrease the xmax value |
| Stops before the Left edge | Decrease the ymin value |
| Stops before the Right edge | Increase the ymax value |
Click the Raspberry Pi icon → Preferences → Screen Configuration, in the new window, click layout → screen → HDMI → orientation → Select the appropriate direction, then click Apply, and click OK in the new pop.
Need help or have feedback? Submit a ticket and our team will get back to you within 1-2 working days.
Working Time: 9 AM – 6 PM GMT+8 (Monday – Friday)
Contact Us: [email protected]
© 2026 Osoyoo | osoyoo.com
DownLoad Url osoyoo.com