I found two great designs for a DIY sensor that achieve both filament runout and filament jam detection in one unit.
A clever design that only uses one microswitch as follows:
Source: Thingiverse.com
Another design using two microswitches, as follows:
Source: Thingiverse.com
I am not sure about the reliability of either yet, and I initially liked the design with one more switch. Then I realized there was no way to distinguish what event occurred (runout or jam), so I plan to make the second two microswitch versions instead. However, how would I wire this in a way so that my Ender 3 V2 running Marlin, specifically mriscoc firmware, would be able to interpret both signals separately and interpret them as two distinguishable events so that the exact event is reported (runout or jam)?
Alternatively, I could wire it to my Raspberry Pi, since I always print from OctoPrint only, and implement it there instead. However, I'd prefer to wire it to the printer board and have the firmware handle it.
Lastly, in comparison to these two specific designs, would an encoder wheel approach add benefits other than runout and jam detection?
Suggestions for better designs or approaches are also welcome.