first of all: the circuit that i draw is untested, never plug an circuit without testing it on a breadboard fist.
The idea is, as you have an NPN sensor, it will sink the current. that means, current will flow through it, so when no metal is present, the circuit would let the current flow from the 24V to ground, measuring between the resistors you would measure about 5v.
When the metal is present, the sensor would cut the current flowing, and you would measure 0V between the resistors.
I’m not an electronic engineer (I’m a chemical engineer though) so this is the way i think t would work. Buttttttttttt, test it before plugin on your taz. if you feed 24V on ramboo will definitely kill it.