Do your prints fail because filament gets tangled or because filament runs out? This octoprint-based system maybe the solution for your problem. This blog post has complete information about how it works and what it does:
................ http://e-nable.org/2017/10/17/do-your-prints-fail-because-filament-gets-tangled-or-because-filament-runs-out/
Here's a link to the instructable and videos on how to assemble and setup:
............. https://www.instructables.com/id/3D-Printer-Filament-FAULT-Detector-Octoprint/
The STL files have been updated with an improved design, but the assembly instructions are still correct although the parts look a little different.
The design was created on Tinkercad and has been made public. You can remix on Tinkercad here:
............ https://www.tinkercad.com/things/35xk9N2MT2E-7290-filament-fault-detector
This design works well with all filament sizes!
https://www.youtube.com/watch?v=IAAubhDdlUY
https://youtu.be/20-Xy4wnJKs
https://youtu.be/I55Vw4bN8ws