would a ground give you 0 volts too?

then the problem is when I don't supply the ground, you read it as sensor unplugged?

that is where the switch is needed to say ground or sensor?