You could do it many ways but the easiest I think is like I've done it (if the sensor does not need a lot of power). In my mailbox version of this I powered the sensor from a Moteino pin [digitalWrite(pin, HIGH) then read the sensor, then digitalWrite(pin, LOW)].