P-Channel to switch sensors on and off

Trevor writes…

for my testing I am using an arduino uno, I have this p-channel mosfet ZVP2106A
I want power cut to all sensors when sleeping.
I have 2, 12 volt car batterys so 24 volts, that I want to monitor.
I have an other analog sensor 0 to 5 volts.
I have a digital temp sensor 3.3 volts.

I don’t want voltage on my Voltage divider or any other sensors when sleeping. Would an N-fet be better, any suggestions.
if I used on/off switch I can manually turn them off, but want to use the transistors to do the work.

My suggestion would be to use the P-Channel as a High-Side Swtich. Originally, I think you looked at the p-channel with only positive voltages article. Since your switched-supply voltage is higher than the IO pin, you’ll need to use a driver to make it work. There is an example circuit in the high-side vs. low-side switch article.

I would NOT recommend an N-Channel for this circuit. If you did, it gets configured as a low-side switch, which means the sensors are not seeing the actual ground. They’ll see something slightly higher than 0 volts, which may affect their readings. The P-Channel needs a little extra care but will result in better measurements.

Link to the ZVP2106A.