Modified Raporfx great part to mount easily on my custom Hypercube/Hypercube Evolution made out of 2525 aluminum. I also modified the part so the optical sensor wouldn't sit so deep into the part. I had issues with the sensor tripping my prints even though it still had filament.
I connected the sensor directly to my raspberry pi (GPIO pin, 3.3V, and ground) and am using the Filament Sensor Reloaded plugin with OctoPrint. It's worked great on my printer!