I'm using a 3.3v arduino pro mini to make a solar-powered "garden bot." All the bot does is use a capacitive moisture sensor (which can accept a supply voltage between 3 and 20v), and turn on a solenoid if necessary. This project uses a solar LiPo management circuit that supplies power to the arduino from either the battery (a 3.7V LiPo, that can realistically vary between 3.4V and 4.2V), or, if there is a surplus, directly from the solar panel (5-6V, depending on conditions).
One thing that's critical here is being able to put the whole thing in as deep a sleep as possible when it's not checking things. When sleeping, the whole thing eats about 300uA. The sensor, when energized, eats about 7mA. Since this is a relatively large amount, I'd like to disable the sensor when not in use.
I'm a transistor newbie, so I've been following various tutorials on this. I'm using a BJT to control supply current to the sensor, following this design:
sample transistor as switch circuit
The problem is that Rb is a function of both the base voltage and the collector voltage, and that value may fluctuate depending on power conditions. I can't use a regulated arduino rail because it would be at a max 3.3v, and by the time the transistor takes away its .7v, i'm left with less than the sensor's minimum 3.3v. Is there any way to make this work without involving some sort of step-up transformer? It's not a huge deal to do that, but ends up being more components and more power consumption when the sensor is powered.