I got pissed off when the smart sensor I bought cracked at a stress point and blew up, so I decided to do my own. :)
Criteria: low drag for the filament, bi directional, and easy to see when there are problems.
It's a trapped bearing that rests on two bolts wired to a socket so the existing plug goes in. I used M2 bolt and nut with a washer combined with one of those crimpy things that has a washer at the end.
Pause the print before it narrows and drop the bearing in, no supports needed, then put a magnet underneath, 1 cm diameter, 5 mm tall, it just exerts a tiny bit of pressure, may work without it, I had one handy.
That's about it. Includes the freecad file.
Oh, you need to invert the logic, put a ! in front of the pin setup in klipper, similarly for marlin.
[filament_switch_sensor runout]
pause_on_runout: True
switch_pin: !PA5
EDIT:
I added a rotary encoder hat to go on top of it, just add some glue to prevent the inner bit in the bearing from rotating. you need to create a 3 wire connector, same idea just needs the power line, but you can use the existing anycubic connection and just use one or the other.
Klipper:
[filament_motion_sensor filament_sensor]
detection_length: 10
extruder: extruder
switch_pin: ^PA5
pause_on_runout: True
This is what I used:
https://www.amazon.ca/dp/B081W4KMHC?psc=1&ref=ppx_yo2ov_dt_b_product_details
The author marked this model as their own original creation.