I'm pretty new to EE and I'm trying to use a sensor and saving battery as much as possible. I've already looked into similar topics (like this), but they are not satisfying me.
So, I want to power up sensor from time to time and get its output. Its regular capacitive soil moisture sensor, that's output voltage is dependent from moisture. The whole circuit is running on 3.3V. I was using n-MOSFET to power it like in the following schema:
Problem is that this sensor does not require to be connected to the ground to work and consume energy (checked on few of them, all operated the same way), so I cannot power-up and power-down it with MOSFET. I was thinking that connecting it to source instead of drain, but I do not want to do it as it is n-MOSFET. Theoretically, p-MOSFET would solve my problem, but it will require to set controller GPIO on almost all of the time, which is what I want to avoid.
Another way would be to power up sensor directly from GPIO (sensor consumes around 5mA, while port can supply around 12), but GPIO voltage under load drops under 3V, which causes sensor output unpredictable.
So, question, do you know the way to achieve it? I was thinking about using a relay, but relays are usually much bigger than transistors.