Simple solution to drive a raspberry pi relay from the GPIO headers. Relay coils are powered from the Pi's 5v supply while the signal is handled separately using a simple common 2N2222 transistor. It is essential to have the diode across the coil of the relay to protect the circuit but most importantly to protect the pi. I have shown 2 relays in this circuit but as you can see it will be very simple to expand to multiple relays. The pi GPIO pins are represented by the io points