This circuit is similar to my project, "Variable Speed Fan: Snap Circuits, Kano Computer" (control a variable speed fan with the Kano Computer), but instead of controlling a motor with the Kano Computer, I'm controlling the Snap Circuits relay (which in turn controls a motor). For some background on this circuit, see the following projects:
Initially I used pin 11 (GPIO17) on the Raspberry Pi to try to switch the relay on and off, but unfortunately all I heard was a faint clicking from the relay. Pin 11 just didn't supply enough current to switch the relay on. Pin 2 is 5V and also supplies enough current to to switch the relay on. So, I used pin 11 to switch the transistor on and Pin 2 to power the relay.
I used the Snap Circuits to header pin connector that I created to connect the circuit to pin 9 (Ground) and pin 11 (GPIO17) and made a second Snap Circuits to header pin connector (my cat got a hold of one of my Snap Circuits Jumper wires and chewed through it so I was able to put it to good use after all).
To make the wire I used a header pin jumper wire, Wire Glue, the salvaged Snap Circuits jumper wire, and shrink tubing:
And connected it to pin 2 on the Raspberry Pi
Intermittent Fan Scratch Program
The Raspberry Pi pin 9 (Ground) is connected to the NPN transistor (Q2) via the black/black jumper wire and pin 11 (GPIO17) is connected to the 1K resistor (black/red jumper wire). Pin 2 (5V) is connected to the Snap Circuits relay (S3) via the blue/red jumper wire (and the 2-snap conductors).
Where to get the Kano and Snap Circuits: