How to detect if a sensor is connected to a digital input

Hello wvmarle,

thanks for your suggestion. Unfortunately I am a newbie in electronics, so I do not quite understand your idea.

My sensor only has two wires - one goes to GND, the other to a digital input.

So your idea is to use a second input and to connect this input to GND via a pulldown resistor. If I understood correctly I do not have to connect the input with another element, it's just the resistor connected to GND.

For the final solution I'd like to use an ESP32 - how would I have to change the value for the resistor if I used an ESP32 with 3.3 V?

Rudi