I'm designing the front-end circuitry for an ADC. The ADC is to be used to read from sensors under two use conditions:
- An externally referenced sensor, whose signal line will either be 0-5V or bipolar (e.g. ±10V). Note that the ADC supports bipolar inputs. No additional circuitry is required to support this scenario.
- An unreferenced two-wire sensor, whose signal line will need to be pulled up to a 5V reference via a 1kOhm resistor within my front-end circuitry before interfacing with the ADC. A basic representation of this scenario is shown as follows:
simulate this circuit – Schematic created using CircuitLab
The user can install sensors of either scenario, so my front-end circuitry needs to be able to support both operating modes. My initial design was to use an MCP23017 (or another similar I/O expander) which could provide the 5V reference to the sensor signal line by setting that particular MCP23017 pin as a logic high output. Similarly, it could be set as a high impedance input to support scenario 1 (i.e. no affect on the sensor signal line). However, as the sensor signal line can be both negative and much higher voltage than the MCP23017 VDD, I don't think this method is suitable. Even if the MCP23017 pin could be set to a high impedance input, there's always the risk that the user accidentally enables the pullup reference on a particular input, damaging the MCP23017.
Could I use a similar approach, but instead use the MCP23017 pin (as an output) to turn on/off a transistor? If so, would an n-type MOSFET be the best option? What considerations need to be made to ensure the circuit is open (so far as reasonably practicable) for scenario 1 operation (i.e. no affect on externally referenced sensor signal line) and closed for scenario 2 operation (i.e. as close as possible to exactly 1kOhm series resistance to 5V reference)? Similarly, are there any other considerations from a protection perspective, allowing for bipolar inputs which are greater than 5V? I.e. the circuit should not be at risk if a -~20V signal is connected with the transistor in either the on or off state.