Assuming a sensor draw of 5mA, I presume that I could either drive the sensor power by taking a GPIO pin high, or pull down a GPIO pin to ground the sensor. Am I correct in that assumption, and if so, is there any reason one method is preferable to the other?
I see many example circuits that seem overly complicated (e.g. transistors gating power with GPIOs connected the base, etc.) and I don't understand why this extra circuitry is required if the device can source the current required.