This uses a mechanical endstop to act as a filament sensor. I took one already found on Thingiverse, added points to mount it to a 2020 extrusion and a bowden PC4-M6 mounting point as that's what I am using. Filament passes through this and when it triggers as empty, can send a signal to the printer for a filament change.
Bowden Fitting: http://a.co/iI2eXjH
Connecting to Raspberry PI:
- Voltage to PIN 1
- Ground to PIN 6
- Signal to PIN 7
In OctoPi, I use the Filament Sensor Reloaded plugin. Set it to Pin 7 with Normally Open and a 250 debounce and you should be good to go!
Print at high resolution so the threads work.