Last weekend I spent ~30 minutes calibrating three pens manually. Annoyed, I decided to automate this process as well. For complete pen alignment we need to offset the XYZ coordinates -- the offsets are stored in a RFID tag (more details).
A Resistive Touch Panel was used to build a new plotter bed. By probing a tool over the panel at several location we can know the three spatial coordinates.


I used a Cheap Yellow Display (CYD) 2.8" which contains an XPT2046 resistive touch controller and panel. I removed the display entirely and soldered pigtails to four touch panel pins. Then I used another larger resistive panel that I reclaimed from an old car GPS. Magnetic Pogo Pins allow connecting the panel when needed.
The new bed is 2.5mm thick and magnetic alignement is highly repeatable. I posted a demo video of it in action.
Hardware
To connect the touch panel to klipper, I'm currently keeping the CYD in use.
- The CYD outputs a 3.3V 10ms pulse whenever a touch event is detected.
- An OR gate built with two NPN transistors combines the BLTouch Probe
Signal and the touch signal, output of which is used as PROBE_ENDSTOP on klipper. - Now, when running Bed Mesh or Probe calibration, the toolhead stops when
EITHER resistive touch event or BLTouch trigger is detected. - This essentially means that basic Z offset calculation work using BLTouch with no changes to klipper.
- CYD is connected to Klipper Pi over USB.
- There's a screen protector layer over the panel and the software will implement wear leveling to use the entire panel evenly.
Software
The CYD runs a very basic ESPHome firmware. It logs out the XY and Pressure values via serial port and can be read by a Python script. Klipper macros can use CLI command to run the script when probing to read the coordinates.
A PROBE_TOOLS macro will automate the whole process:
- Partial BLTouch bed mesh over the touch panel.
- Docks `reference tool` (T0) and probe at 4 locations. Stores the coordinates and scaling factor.
- Following steps are repeated from tool T1 to T4:
- Dock Tool
- Slow Probe to find tool Z offset
- Fast Probe at 4 locations
- Calculate XYZ offset from reference pen
- Write the offset to pen's RFID tag
- Undock Tool
- Partial bed mesh on paper area (A6 size).
- Repeat from T0 to T4:
- Dock Tool (also reads the tag)
- Draw alignment pattern
- Undock
- User/Camera confirmation
Roughly 10 units of displacement on the touchscreen corresponds to 1-2mm toolhead movement, in my observation. I'll work on alignment script next, given that I seem to have all the required parameters about tools available.
Github repo will be updated soon containing the config changes.
PS: The screen that comes with the CYD is also sufficient, I just had some extra available. It was slightly thicker as well since I couldn't easily remove the display layer.

Prashant Sinha
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.