This is my take on a filament encoder which achieves sub-mm sensing resolution, uses minimal parts and can attache to the outside of a printer using 2020 extrusions. I installed this on the rear of my Voron 2.4, but the mounting is generic.
BOM for the encoder:
1 x optical endstop with cable : https://shop.lerdge.com/products/lerdge-optical-endstop?_pos=1&_sid=fca4102b0&_ss=r
1 x 608 bearing
2 x O ring (ORB #6 0.468" ID x 0.07" CS or 12mm ID x 2mm CS)
4 x M3 heatset inserts (Voron spec)
4 x M3x20mm screws (SHCS)
2 x M3x6mm screws (FHCS)
Some 4mm PTFE tubing
BOM for mounting (optional):
2 x M3x12mm screws (SHCS)
2 x M3 t nuts
Printed 5mm spacer to compensate for rear panel on Voron 2,4 printers
Blue locktite
Printing profile (recommended):
LAYER HEIGHT: 0.2mm
EXTRUSION WIDTH: Forced 0.4mm
INFILL TYPE: Grid
INFILL PERCENTAGE: 40%
WALL COUNT: 4
SOLID TOP/BOTTOM LAYERS: 5
SUPPORTS: None
Assembly Instructions:
Print out all the parts using your preferred filament, I used ASA but ABS or PETG should be fine.
Clean out the holes in the covers and the mounting flanges using a 1/8" drill bit. There is a sacrificial layer in the two covers that needs to be removed.
Install 4x heatset inserts in the housing bottom
Press fit / tap in the encoder wheel onto the hex shaft, making sure the shaft end is flush with the outside of the wheel.
Slide the 608 bearing onto the hex shaft.
Press fit / tap in the filament wheel onto the hex shaft, making sure the shaft end is flush with the outside of the wheel.
Install the endstop in the housing bottom using 2 x M3x6mm screws (FHCS). These are threaded into the plastic, do not over tighten.
Install the shaft assembly into the housing bottom, aligning the bearing into the recess and the encoder wheel into the gap on the endstop. Make sure the encoder wheel spins freely,
Install the bearing cover on the housing bottom, securing the bearing in place. Fasten with 2 x M3x20mm screws (SHCS). Again, make sure the encoder wheel spins freely,
Install the cable into the endstop, aligning it with the slot in the housing bottom.
Install the encoder cover on the housing bottom. Fasten with 2 x M3x20mm screws (SHCS).
Installation Instructions:
Install 2 x M3x12mm screws (SHCS) into the desired mounting flanges for your desired mounting orientation.
Apply blue locktite (optional) to the tips of the M3 screws and install the M3 t nuts
Attache the assembly to your printer's 2020 frame, use the 5mm spacer as needed to compensate for your panels.
Install PTFE tubing to both sides of the assembly.
Plug the other end of the cable into your main board. You may need to adjust the cable pinout to match your main board.
Klipper settings to add to your printer.cfg, make sure you adjust the switch_pin to match where you connected the senor:
[filament_motion_sensor runout_sensor]
detection_length: 4.0 # Length of filament to trigger a state change on the switch_pin
extruder: extruder # Extruder this sensor monitors
switch_pin: PG15 # Pin this sensor is connected to
pause_on_runout: True # Should we pause if no filament motion is detected?
#runout_gcode: # Additional G-Code to run after the pause code is executed
#insert_gcode: # G-Code to run when filament insertion is detected
#event_delay: # Ignore events that occur within this time of the last event
#pause_delay: # Delay (s) between pause and runout G codeThe encoder will generate a transition with every 0.8mm of filament travel, the above 4mm detection length should generate 5 transitions. If you get false positives due to filament slippage, you can increase this number. Klipper default is 7mm for your reference.
Revisions:
28-DEC-2025 : Updated the bearing cover to reduce the amount of friction on the filament, previous version was causing filament slippage in my extruder.
The author marked this model as their own original creation.