This should help with how to wire it. Make sure to use a diode as show. Running a relay straight from your arduino is bad for it. The coil builds up high voltage spike that is put into our arduino. The sketch you need is a simple switch one.
This should help with how to wire it. Make sure to use a diode as show. Running a relay straight from your arduino is bad for it. The coil builds up high voltage spike that is put into our arduino. The sketch you need is a simple switch one.