Arduino Pro Mini with AA batteries

Again - sorry for the confusion - there is one transistor and a DS18B20 sensor.
And the other transistor (2N3904), I am using it as switch. Should it still have a resistor? I'm not a pro in electronics, so that part might be really clunky. Would there be a better solution to control/switch the power supply to the connected sensor?