I'm really frustrated, as I've been working on this for weeks and I can't get it to work. I have a V-Minion and I wanted to add a filament runout sensor. I've had one on my modified Ender for a long time and it works well.
I first tried with a BTT Smart Filament Runout Sensor. This type of sensor sends pulses as the filament moves through it so that it can detect jams where the filament is loaded but is prevented from moving. I plugged it into E0_DET port on the SKRat. This is a 3-pin port, which has 5V, Ground, and the Detection pin, and I used the following config:
[filament_motion_sensor runout_sensor]
detection_length: 10.0
extruder: extruder
switch_pin: PF4
runout_gcode: PAUSE
This sensor worked at first, but started to stop the print periodically because it wouldn't send enough pulses to the mainboard. This ended up being caused by jams and also because the filament was slipping on the drive wheel inside instead of turning it.
I gave up on that filament detection sensor and bought the same one I use on the Ender. It's also a 3-pin connector, with the same signals as the BTT, but doesn't sent pulses, it just sends a simple high or low signal as to whether the filament is detected.
I have verified 9 ways to Sunday that the wiring is correct, but I cannot get RatOS to report the correct detection state. The config file is as follows:
[filament_motion_sensor runout_sensor]
extruder: extruder
switch_pin: PF4
runout_gcode: PAUSE
I have tried all 6 combinations of inverting the switch pin as well as applying pull-up or pull-down resistors (PF4, !PF4, ^PF4, ^!PF4, ~PF4, ~!PF4). None of them will get proper detection.
I know the detector is working properly. It has a blue LED that turns on when the filament is inserted, and turns off when it's removed. I also measured the voltage on the detection pin, it's 3.3V when empty, 0.126V when filament is inserted.
What could I possibly be doing wrong here?