This is a filament runout sensor upgrade for a flashforge creator 4. The original sensors are crap and do not function reliably.
I designed a new case that uses the old PCB. You need to desolder the old switch from the PCB and solder wires from the pcb to a roller lever omron switch SS-10GL2.
It is recommended to print both housing parts in a low friction filament (e.g nylon, igus iglidur i180/i190). I used nylon for this and printed the parts with a 0.25mm nozzle.
The brass inserts in the housing are cnc kitchen m2 short (2 pieces to mount the switch) and standard m3 (2 pieces for the housing).
You can also find the assembly as a step file in the attachments, if you want to modify or remix it.
The author marked this model as their own original creation.