I've done my best to search both the forum and the web for answers to my questions, but haven't found any. Apologies for any repetition.
I've been following the diagram: http://www.arduino.cc/playground/uploads/Learning/relays.pdf and have tried as many possible combinations of transistors/resistors I can manage to try and get the circuit to work with both a 5vdc coil relay and a 12vdc coil relay, and I can't get either to work.
Here's my circuit, following, as best I can, the playground diagram: http://www.flickr.com/photos/80458750@N00/819738972 In the picture, the green wire is the Arduino pin 13 -> 2.2k resistor -> 2N2222 transistor. The diode is a IN4001. The relay has a 12vdc coil. The black wire is the 12vdc ground, the red wire is the 12vdc power. I have limited experience with electronics. Here is what I know: it is not a problem with either the power supply, relay, diode, arduino or arduino program. A LED lights up when connected to pin 13 running the same program. The relay switches when connected directly to the power supply without either the resistor or transistor.
I'm assuming that I'm making a glaringly obvious mistake. I have tried replacing the transistor, resistor and diode thinking that one of the might be faultly. I've also tried a 1k resistor, and a IN4004 diode. I've also tried exchanging the connections to the 12vdc relay coil. No success.
Any ideas? Any help would be much appreciated. Thanks