I'm modding a PCB that has a CO2 sensor on it, powered by a battery (via a linear reg that also supplies the micro). The sensor is turned on and off to preserve battery power and the micro goes to sleep. I was surprised to see that the sensor has a permanent supply to it and ground is switched by the micro with an N-type MOSFET, rather than using a P-type MOSFET to switch its Vsupply on and off.
The C02 sensor is then connected to the one of the micro's UART's Rx and Tx pins. I would have thought that the problem with this is that the micro could then provide a path to ground and be leaching current away as there is always power on the sensor's supply pin.
Am I unduly worrying about this?
Or, I'm not unduly worrying about this...if the pins were set as outputs and set high before sending it to sleep would that be the best way to minimise power consumption with the current set-up?
I would have had it high sided switching and set the Rx and Tx pins as GPIO pins configured as outputs with the pins being set low just before going to sleep. Is that a better way of doing it or am I overthinking this? (Or indeed just plain wrong?)