Soemarko Ridwan

iOS & Web Developer ⟡ Coffee Addict ⟡ Scuba Diver

Tiny Touch (the smallest DIY Z-probe) for Anet A8

Update 15 Oct 2019: Updated for Tiny Touch MK2.

I made a thing. Well, I remix it, all credits should go to the original creator.

Bill of Materials (BOM)

  1. Printables, one of everything, body, flag, cap, and mount. While technically the cap is optional, I measured the mount with the cap on. You can also use a slightly longer M3 screw. MK2 only requires the new flag, and body. The mount is the same.
  2. Optical endstop (Aliexpress) — It’s cheap, nothing wrong with getting spares as you’ll need to de-solder it.
  3. Tiny linear servo (Aliexpress) — R (right) version. I got a pair, local shop sells it as pairs. I think you can get away with L version if you just mirror the body, and possibly flip the servo angles. I have build a back-up probe with my L (left) servo, we can keep the angles. I can use it as straight replacement.
  4. 4 M3x12 bolts.
  5. 2 M3 nuts.
  6. 1 M3x20 bolts. Not needed for MK2
  7. 3 tiny screws. Like the ones for glasses, I use spare iPhone repair screws.
  8. 1m of 4pin wire. LED strip wire like this one works really well. I’ve tried USB cable on my previous z-probe too, too thick and stiff for my X-axis chain.
  9. 1 female 3pin JST-XH connector (2.54mm pitch). Though getting a pair can be useful for testing while working on this.
  10. 1 pair (male and female) of 4pin JST-XH connector, or 4pin Molex, or anything 4pin with 2.54 pitch really. I use molex cause that’s what I have in my spare box.
  11. 1 pair (male and female) of Dupont connector.
  12. Optional: spare LCD cable, incase you fucked up cutting the 3rd wire. It consist of 10pin ribbon cable + 2 10pin IDC connector, if you want to get it as parts.

The Probe

Tiny Touch

Once everything is printed, it should be easy to put everything together;

  1. Plop the flag into the body from the top.
  2. Screw the M3x20 to the bottom of flag.
  3. Pop the cap onto M3x20. Step 2 and 3 are not applicable for MK2.
  4. Screw in the optical endstop above the flag.
  5. Screw in the linear servo from the bag with the tiny screws.

The flag should move smoothly up and down (MK2 has better tolerances too). The servo is tiny and weak. Any snags will stall the motor. File down wherever it snags. I also add a little bit of electrical tape on top of the flag to make the flag more flaggy (?). I find that without the tape, the flag is not forward enough. The flaggy flag will cut off all of the light for the endstop.

The original recommends using neodymium magnets or spring, I just use gravity. I’d rather not weigh the servo beyond the weight of the flag and screw.

Next you need to de-solder the 3pin JST-XH on the endstop, and soldered in the 4pin connector (some bending of the 4th pin may be needed). And splice the power to the servo. As usual, black to G; red to V; and white to the empty pin.

The cables

LED cable

If you use the LED strip wire like I do, it’ll be nicely color coded. Black for ground (G). Green for endstop signal (S). Red for 5V (V). Blue for servo signal. Straight forward crimping for this end.

Anet A8 board S_Z pin-out

The other end, crimp blue with one of the Dupont connector ( I use female because the JST connector for the other 3 pins are also female). The JST connector is a bit trickier because it only goes in one way and the crazy way of Anet board aligning things. So for this connector, following the pin out diagram above, with the hooks at the bottom, you crimp in black - red - green.

LCD cable

Next is the LCD cable, this one is easy but also easy to fuck up. Count to the third wire from red, separate it from the ribbon, cut it, and crimp in the male Dupont connector. ez pz.

Test and Confirm the Build (optional)

If you have a spare Arduino lying around, you can use this tiny-touch-test.ino to test and confirm your build. You can just look at the code for the pins connection.

Like in this clip, pop open the Serial Monitor and type in s to stow, and d to deploy. The internal LED should correspond with the endstop, the LED on Arduino turns on when the flag is up.

The Configuration.h File

#define Z_MIN_ENDSTOP_INVERTING false  // set to true to invert the logic of the endstop.
#define Z_MIN_PROBE_ENDSTOP_INVERTING false  // set to true to invert the logic of the probe.

#define Z_PROBE_SERVO_NR 0   // Defaults to SERVO 0 connector.
#define Z_SERVO_ANGLES {160,30}  // Z Servo Deploy and Stow angles
// please test and find the angle that works best for you.

#define X_PROBE_OFFSET_FROM_EXTRUDER -24   // X offset: -left  +right  [of the nozzle]
#define Y_PROBE_OFFSET_FROM_EXTRUDER -47   // Y offset: -front +behind [the nozzle]
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0   // Z offset: -below +above  [the nozzle]
// again, break out your ruler to confirm. do the Z in the final tweaks step

#define Z_MIN_PROBE_REPEATABILITY_TEST // if you want M48 enabled


// Sensor at the front-left

#define LCD_BED_LEVELING // nice to have


#define NOZZLE_PARK_FEATURE // if you enabled the advanced pause in Configuration_adv.h file

#define SLIM_LCD_MENUS // need this so the firmware would fit into the board

#define NUM_SERVOS 1


Final Tweaks

You need terminal access to the printer, either the terminal tab on OctoPrint, or connect the printer to your computer and use Printrun. You should the these following steps.

  1. M280 P0 S[angle] ; Test the servo angles. In my case, I use M280 P0 S160 to deploy and M280 P0 S30 to stow.
  2. M119 ; While doing step 1, confirm the Z endstop status by sending It should return open when deployed, and TRIGGERED when stowed.
  3. M851 Z0 ; Reset the existing Z-offset to zero. It should already at zero if you just flash your firmware, but just to be 100% sure.
  4. G28 ; Home all, or by clicking on the button.
  5. G1 X110 Y110 Z0 ; Move everything to center bottom
  6. M211 S0 ; Disable software endstop, so you can go below Z0
  7. Now slowly move the nozzle down until it barely touching the bed (do the paper dance).
  8. Look at the LCD, and take note of the Z value. For example its -1.2
  9. M851 Z-1.2 ; Set the Z offset
  10. M211 S1 ; Enable software endstop
  11. M500 ; Save settings to EEPROM
  12. M501 ; Load EEPROM
  13. M503 ; Confirm settings (unless you have this disabled)

Now, jump back to the Marlin’s Configuration.h file, set the new Z-probe offset value #define Z_PROBE_OFFSET_FROM_EXTRUDER -1.2 and save it. This way you don’t need to do this section again if you need to flash the firmware for other reason.

Finished! Also remember to add G29 ; Auto Bed Leveling right after G28 in the starting gcode of your slicer.

Bonus: after you made this, I highly recommend replacing the spring bed mount to a solid bed mount.