A few question along my learning experience...

First and foremost, I've added a link to a link to my project at the bottom of the post...

But basically what I've created, though not the final piece, is a button that powers a 12 volt relay that opperates a nerf gun. Right now it works perfect, the button controls the relay. I've struggled with a smaller relay before. I have used a transistor this time and a diode as well.. there's a few things I'm having a hard time figuring out, one being why exactly do I need the transistor? couldnt I just do the same thing without using it? Secondly, when using the transistor this way (Having such a hard time understanding the fundamentals of transistors), I noticed that the ground for the arduino and the external power (6C batteries) needed to be common, what am I missing? why wouldn't it work the other way? lastly I saw people using the diode the way I currently have it but I would've assumed it needed to be run in line, is this right? and if so why would inline be wrong? Thanks and please don't judge my basic knowledge.

http://f.cl.ly/items/051x1b2k1p1U0B3i1B2F/photo%20(1).JPG

thegregthomp: I have used a transistor this time and a diode as well.. there's a few things I'm having a hard time figuring out, one being why exactly do I need the transistor? couldnt I just do the same thing without using it?

The Arduino is limited to 40ma current draw from the output pins (with 20ma being the recommended limit). Your relay more than likely requires more than 40ma to switch (I'd guess around 100ma) and the transistor allows you to reach those higher currents. You can find relays that need less than 40ma to switch but they are more expensive and typically allow less switched current.

For tutorial on using a transistor as a switch: http://www.kpsec.freeuk.com/trancirc.htm#switching. I guarantee you'll feel smarter if you read the whole page though.

thegregthomp: Secondly, when using the transistor this way (Having such a hard time understanding the fundamentals of transistors), I noticed that the ground for the arduino and the external power (6C batteries) needed to be common, what am I missing? why wouldn't it work the other way?

Think of the Arduino as being powered by a supply with a 5V differential and your 6 C batteries as having a 6V differential. You have to connect the grounds together so that they can agree on what zero volts is.

thegregthomp: Lastly I saw people using the diode the way I currently have it but I would've assumed it needed to be run in line, is this right? and if so why would inline be wrong? Thanks and please don't judge my basic knowledge.

When coils of wire -- like the electromagnet inside the relay -- have their current abruptly shut off they release a short high voltage spike. The diode prevents that spike from damaging the rest of your circuit by allowing it to loop back and dissipate.

http://auto.howstuffworks.com/ignition-system3.htm for an example of this type of voltage spike on a macro scale.