Control a relay

This is a good tutorial on hooking a relay to an Arduino. I did exactly this just the other day to show someone.

(Don't tell anyone but I forgot the flyback diode with no ill effect but that's just my good fortune. You must put it in. Note that it's "backwards" in the sense that the diode cathode is on the + side of the supply)