How to Configure BLTouch in Ender 3 2018 using Klipper and Mainsail

Introduction

If you’re looking to improve your Ender 3’s print quality and speed, installing Klipper firmware with a BLTouch for auto bed leveling is a great choice. This guide walks you through the setup process step by step, ensuring a smooth installation.

Why Use Klipper with BLTouch on an Ender 3?

  • Faster Print Speeds – Klipper leverages your printer’s hardware for improved performance.
  • Better Precision – The BLTouch sensor enables automatic bed leveling, ensuring optimal first-layer adhesion.
  • Enhanced Features – Advanced macro support, better motion control, and remote monitoring options.

Prerequisites

Before starting, ensure you have:

  • A Creality Ender 3 with Klipper
  • A Raspberry Pi (or another host device) with Klipper installed and Mainsail
  • BLTouch Installed (genuine or clone)
  • USB cable to connect the printer to the Pi
  • Access to a terminal (SSH or Serial)

Step: 1 Configure BLTouch in Klipper

  1. Import a default printer.cfg downloading it from GitHub
  2. Update the printer.cfg file:
    • Include mainsail.cfg in printer.cfg
    • Open your printer.cfg in Mainsail or via SSH:
nano ~/printer_data/config/printer.cfg
  1. Add this line at the top (if it’s missing):
[include mainsail.cfg]

3. Add the bltouch configuration:

  • Under [stepper_z] replace the endstop_pin value to be like:
endstop_pin: probe:z_virtual_endstop

4. Add the BlTouch section

[bltouch]
sensor_pin: ^PA1 
control_pin: PA0 
x_offset: -45 
y_offset: -10 
z_offset: 2.5

5. Save the configuration and restart Klipper.