Switch on/off 9v (or 12v?)

I have a Sparkfun 434MHz rf tx working on 5V now with an Seeedstudio board. The power/ground are connected to pin 16/17 and when I want to send anything over RF I power the module by setting pin 17 HIGH.

The rf module can be power from 5 to 12V. Higher voltage means better range (at least, that is what I have read). So, I want to power the RF module with 12V (from power adapter), but still be able to switch it on/off.

What are my options to do that. I prefer lower part count.

Thanks in advance for suggestions.

Transistor and resistor should do the job. Have the resistor go from pin17 to the base of the transistor. Feed the 12v to the collector and connect the emitter to the + of the RF module.

Your code should still work as it is.

The data sheet is not very useful; here's essentially what you need to know.

You need to know, with 12v supply voltage, what voltage on the data pin registers a high. This can be quickly found by setting up a voltage divider config, with one of the resistors being a variable resistor (either a trimpot or potentiometer).

Once you have that, report back with your findings, and we will tell you how to get that voltage.

Feed the 12v to the collector and connect the emitter to the + of the RF module.

If you do that you will not get more than 5V on the transmitter. You have an emitter follower.
You need a second transistor to pull the output from the arduino up to 12V.

Hmm, I never knew that, something I will need to look up.

Thanks for the help Mike.