(UPDATED 21-7-19.... The circuit will need to be modified for 3D printers that use 256x microstepping. I have uploaded updated instructions that include the resistor value change that is needed for this. ....UPDATED)
(UPDATED 21-7-19.... I have improved the box design to allow the idler arm to move back from the filament further to allow a larger rubber o-ring to be used if desired. I have also removed a section of the right axle support to allow more adjustment of the location of the photodiode and phototransistor board, as I found that sometimes the disc would touch the photodiode causing the disc to stop turning resulting in a false jam detection. I have also adjusted the dimensions of the filament inlet to the device so a 4mm PTFE tube will fit more snugly. ....UPDATED)
This filament sensor is designed to detect either filament runout or filament jams. It uses an optoelectronic sensor to detect the rotation of a slotted wheel that is turned by filament movement and compares this with an extruder step signal from the 3d printer mainboard. The detection and comparison is performed by some electronics that do not use a microprocessor. Using a comparison means that the detector should work at whatever speed the printer is running.
If the filament movement that is detected is less than the movement expected the sensor will send a signal back to the printer mainboard to pause the print.
The sensor detects filament run-outs and most types of under extrusion or filament jams and then pauses the print so that the problem can be fixed. In many cases the print can then be resumed.
For full details and instruction s read the file "INSTRUCTIONS.pdf" in the Thing Files
I printed this in ABS but any plastic should be fine. I recommended printing the parts at 0.1mm layer height, and print slowly to increase accuracy. Because the parts are small print times should not be a problem.
As well as the printed parts, the project also needs some electronic parts, firmware modification and a single rubber O-ring and a 2mm axle. For full details, read the detailed instructions in "INSTRUCTIONS.pdf" in the Thing Files.
The plastic parts were designed in Onshape. The electronic circuit was designed and modified by me over a number of months.