Re: sensor detection
If your sensor is has low output impedance, you could add a pullup resistor network to the input so that when the sensor is absent, the voltage goes to say 150 mV. Then whenever you get a reading of more that 100 mV you know the sensor is not present. You can select the resistor network so that the resistance is high enough to not significantly affect the sensor voltage when present, yet low enough that the leakage into the ADC guarantees an open circuit voltage of more that 100 mV.