I'm trying to connect this proximity sensor GX-H8A to interface with my microcontroller STM32L4R5. I just want to make sure if my design will work and will not damage the micro.
I'm planning to connect the Brown wire to 24VDC, Blue wire to Ground, and the Black wire to the input signal on my microcontroller, and a 3.3V pull up with a 10K resistor on the Black wire as well. So when the sensor detects the object, it will get pulled to ground and the micro will receive a 0 signal.
Is this configuration and theory correct? I'm scared that somehow the 24V will got connected to the microcontroller and damage it, and I'm not sure why they connected the Output node with the 24V node in the circuit diagram.