How to Add Auto Bed Leveling Sensor to Geeetech Prusa I3 3D Printer DIY Kit

From RepRap
Revision as of 23:00, 18 September 2016 by Geeetech (talk | contribs) (Electrical)
Jump to: navigation, search


3DTouch Auto Leveling Sensor 2.jpg 3DTouch Auto Leveling Sensor 3.jpg

3DTouch is an auto leveling sensor for 3D Printers that can precisely measure the tilt of your print surface. 3DTouch can greatly improve the printing precision of your 3D Printer.

3DTouch features simple, smart and precise. It could work with nearly any kind of bed materials, such as glasses, woods, metals and so on.The main functions and controls of 3DTouch are the same as most auto bed leveling sensors, which consists of a RC servo and a micro switch.Thus,3DTouch can be used on almost every 3D printer control board.

By using progressively designed solenoid and hall sensor, 3DTouch can integrate high precision in such a simple structure. To make it more user-friendly and to bring you more enjoyable printing experience we add many smart functions such as self-test, false alarm, alarm release and test mode for M119.


1 Simple

3DTouch can be easily applied, since it has a small and simple structure. Gathering information & firmware setting will be an easy task, because 3DTouch works as usual auto bed leveling sensor.

2 Smart

Self-test: The push pin is operated three times to test when the power is on Alarm: The LED light blinks if a problem found on a self-test or on an operation

3 High-precision

3DTouch’s Standard Deviation in repeatability is around 0.005mm, at that precise. If you choose 3DTouch, your 3D printer will be high-class masterpiece, giving you an enjoyable experience.

4. Innovative Solenoid: Ultra Power Saving

On idle state, while the push-pin is whether pulled out or retracted, there are not any electric current flowing on solenoid, and standby electric current in the whole device is below 15mA on average, whereas on working state, while the pin is moving in sudden about 100ms, under 300mA flows in the device. Low power consumption even further drops joule heating, preventing from heat problem.

5 Technologies

3DTouch consists of Atmel ATtiny13A, solenoid, and a push pin.

6 wide Selection of Bed

3DTouch does not uses either optical, nor proximity (inductive/capacitive) sensor. 3DTouch is controlled by Hall Effect, providing high precision. Thus the bed material can be selected freely.

7 Optimized structure: Larger Build Size

3DTouch is a small and technology-intensive one. Build size can be set larger than other existing auto bed leveling sensor. 3DTouch uses existing RC Servo motor signal intactly, so just plug 3DTouch on the same pins after removing servo motor.

3DTouch Auto Leveling Sensor 5.jpg 3DTouch Auto Leveling Sensor 6.jpg


Voltage: 5V

Current: 15mA

Max. Current: 300mA

Cable len3Dh: 150mm

Weight: 10g


3-pin: Brown (-, GND) Red (+5V) Orange (control signal)

2-pin: Black (-, GND) White (Z min)



3D Touch.jpg

Use of 3DTouch


You will need a suitable mount to attach the 3DTouch sensor to your printer.

Here is a 3DTouch sensor mount for Geeetech Prusa I3 pro B, pro C and A pro.

3DTouch sensor mount-1.jpg

1. Download the stl file here and print one.

2.Fix the mount on the Extruder holder with 2 M3*6mm screw.

3DTouch sensor mount-3.jpg
3DTouch sensor mount-2.jpg

3.Fix the 3DTouch sensor on the sensor mount with 2 M3*16mm screws and 2 M3 nuts.

3DTouch sensor mount-4.jpg
3DTouch sensor mount-5.jpg

Thingiverse also has mounts for many other printer are some examples

Example 1

File:3D touch mount.jpg

Example 2

File:3D Touch mount-2.jpg

The mount needs to be adjustable so that the distance between the bottom of the sensor (not the pin) needs to be 8.3mm above the tip of the nozzle. The sensor should also be at least 15mm away from the hot bits.


The 3DTouch Auto Leveling sensor has 5 wires, 3 for the first servo connection and 5v and 2 for the Z min end stop, negative and signal pins.

3DTouch can be operated in the following condition.

One I/O for control (PWM or Software PWM)

One I/O for Z min (Z Probe)

GND and +5V power

let's take our geeetech GT2560 3D Printer control board as an example.

There are several ways to connect the 3DTouch Auto Leveling sensor to GT2560, here is the easiest way.

step 1. Remove the Z max connector from the board and replace it with a 3Pin Straight Pin.You need to use soldering iron here.

GT2560 3Pin Straight Pin.jpg.jpg

step 2. Use Dupont wire to extend the wires of 3DTouch. It doesn't matter if you cannot find the wires with the same color,but do not mix the wires up.

3DTouch sensor mount-6.jpg

step 3. Connect the extended wire to the GT2560 control board.

Connect the 3 pin wire to the Z max pin.

3-pin: Brown (-, GND) Red (+5V) Orange (control signal)

3d touch wiring-1.jpg

Connect the 2 pin wire to the Z min pin.

3d touch wiring-2.jpg

3d touch wiring-3.jpg

Note the wire order.

  • When using 3DTouch Auto Leveling sensor, you do not need to connect the orignial Z min endstop wires.

That's all for the wiring of the 3DTouch Auto Leveling sensor and GT2560.

Firmware Setting

Changes need to be made for the configuration.h file in the Marlin source code for 3DTouch. The required changes are similar to how you would setup a mechanical servo sensor.

Step1. Open your firmware in Arduino IDE. Find the following code in Configuration.h: Modify the code in the red box into:

Define servo.png

// Number of servos


// If you select a configuration below, this will receive a default value and does not need to be set manually

// set it manually if you have more servos than extruders and wish to manually control some

// leaving it undefined or defining as 0 will disable the servo subsystem

// If unsure, leave commented / disabled


#define NUM_SERVOS 1 // Servo index starts with 0 for M280 command

// Servo Endstops


// This allows for servo actuated endstops, primary usage is for the Z Axis to eliminate calibration or bed height changes.

// Use M206 command to correct for switch height offset to actual nozzle height. Store that setting with M500.


#define SERVO_ENDSTOPS {-1, -1, 0} // Servo index for X, Y, Z. Disable with -1

#define SERVO_ENDSTOP_ANGLES {0,0, 0,0, 10,90} // X,Y,Z Axis Extend and Retract angles

Step2. Find the codes regarding to Bed Auto Leveling in Configuration.h.

//=============================Bed Auto Leveling=======================

#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove //at the start of the line)

  1. define Z_PROBE_REPEATABILITY_TEST // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.



// set the rectangle in which to probe



Step3: scroll down to find the codes to Define the probe offset


  1. else // not AUTO_BED_LEVELING_GRID


Step4. Find the following code in pins.h If you do not find the pins.h tab on Arduino IDE, please open it separately, after the modification, please save it.

Find the code as shown in the red box:


  • Ultimaker pin assignment
                                                                                                                                    • /
  2. define KNOWN_BOARD

#define Z_MAX_PIN -1//32

  1. define Z_ENABLE_PIN 35

  1. define SUICIDE_PIN 54 //PIN that has to be turned on right after start, to keep power flowing.

#define SERVO0_PIN 32//13 // untested

Now, we have finished the firmware; please upload the modified firmware to your control board.


When the 3DTouch is first powered up it does a self test – Starting with the pin up it them goes down/up 3 times and ends up the the LED on solid. Continuous flashing means that there is an obstruction or fault.

The BLTouch acts on the following gcode that can be used manually to diagnose faults etc but you don’t need to normally worry about them.

M280 P0 S10 ; pushes the pin down

M280 P0 S90 ; pulls the pin up

M280 P0 S120 ; Self test – keeps going until you do pin up/down or release alarm

M280 P0 S160 ; Release alarm

Alarm – The 3DTouch can sense when something is wrong and then goes into alarm mode which is continuous flashing. Alarm can be triggered like an obstruction that stops the pin going up and down freely, it could be dirt etc.

Printer setting

Providing the firmware is correctly configured, the sensor responds to the same codes as any other sensor eg inductive, capacitive or IR. The Start Code in you slicer should contain the sequence G28 followed by G29 to do the auto bed levelling.

  • Don’t put another G28 after the G29 as it will just remove the G29 results.

Open Slicer>printer setting

Print set-1.jpg

Add G29 command right after G28

Print set-2.jpg

  • Don’t put another G28 after the G29 as it will just remove the G29 results.

The G29 command should be added every time.

Here is a video of using the 3DTouch Auto Leveling Sensor on Geeetech Prusa I3 pro B 3d printer.


These instructions are written to explain how to calibrate using a computer connected through the USB port to your printer. This process also assumes that the EEPROM has been enabled in Marlin.

From the command window of Repetier Host or Simplify3D etc enter the following:

M851 ; note the number

M851 Z0 ; set the offset to zero


G1 Z0

The LCD display should show Z = 0

From the display go to the Menu then Prepare/Move axis/0.1mm/Move Z

Now move the Z axis slowly down until the nozzle is the right distance from the build plate (folded piece of paper or thin card).

*Note the Z axis value on the display it should be something like -1.5

M851 Z-1.5 ; to set the offset you got in the previous step.

M500 ; Stores the values in EEPROM so that it is not reset when you power the printer off and on.

Now you are ready to print.

If you find that you need to increase or decrease the gap then do:

M851 Z-1.4 ; this would make the gap bigger or

M851 Z-1.6 ; this would make the gap smaller

M500 ; to save the value to EEPROM

*Remember the -1.4, -1.5 and -1.6 are just examples , yours will be different.

where to buy

geeetech official online store