This sensor cannot be connected directly.
Requires voltage conversion (24V to 5V or 3.3V) and output inversion.
Since it detects by reflecting infrared rays, it will not work properly if there is paint or fine dust or dirt on the build plate.
https://miscsolutions.wordpress.com/mini-height-sensor-board/
The author marked this model as their own original creation.