Relay (12V) + Raspberry Pi
Using a relay is very helpful when trying to power something with a raspberry pi that requires more than 5v. To be able to do this you are going to need a raspberry pi, a relay, and an external power supply.
The first step is to connect the raspberry pi to the relay. The first step is to connect a ground pin on the raspberry pi to the GND pin on the relay. Next, connect one of the 5v pins on the raspberry pi to the VCC pin on the relay. Finally, connect any of the GPIO pins on the raspberry pi and connect it to any of the IN1 - IN4 pins on the relay depending on which relay is used. For this tutorial, the images shown are from a 4 channel relay but relays can have anywhere from 1 to 8 channels. It all depends on how many things you need to power.