Thanks for your email! Glad to see you building something with EAGLE. A few comments though let me stress that this is not meant as detailed design advice. I have to disclaim my response because I have no idea what you're building or what the load conditions look like, etc. nor your familiarity with electronics or the risks of building something using relays, which tend to switch high power devices. Point being: this is not a set of instructions I'm offering but rather, a few pointers and some info to get started solving your problem yourself! ...please be careful and don't attempt anything unless you feel 100% confident you know what it'll do! You can seriously injure yourself!
Ok...that said...
For starters, checkout the tutorial on instructables about driving a 12V relay with an Arduino here. It's a nice intro to the concepts however there are hundreds more of these.
Next up, join the Hackaday.io site and engage with the folks in the Hacker Chat IRC channel there. Myself and a number of other folks (all engineers) spend our days whiling away with that chat client running in the background, discussing how to solve electronics problems and random things in the world of building stuff! 🙂
Ok, now some commentary:
When driving the relay, you'll need far more current than an Arduino pin can supply. eg If you look at the datasheet for an ATMEGA328P (the chip in the Uno) you'll see that each IO pin is capable of about 20mA. That's not enough to trigger your relay most likely. Instead, you need a transistor because with a small base current on the transistor, you can switch a much larger current 'on' & 'off' (ie the current necessary to switch your relay!) across the other two leads.
More directly: as the value of the transistor's base increases, so does the flow of current, proportionate to this change until you reach saturation (totally open, not able to pass more current thru the device). So the base, in general, receives a small IO-level signal like you would have with the arduino and you can use this to "switch" a much higher current effectively allowing you to translate a smaller value to a larger one.
(The air-quotes around 'off' and 'on' are just in there because too often a transistor is considered a binary device & it's worth knowing that at one stage, they were referred to as a transforming resistor, before they took on the name transistor. Reason being? The current flowing from emitter to collector or drain to source depends on the gate value and will actually ramp up and down with changes at the gate. This is one means by which we can amplify an analog signal which varies across the complete range from 0 to whatever your peak voltage is.)
All that said, the transistor in this case will reflect the output of the Arduino pin (a binary '1' or '0' at 5V, 20mA) but this can be used to pass a much larger value current across the device.
The Instructable I referenced describes this in enough detail to hopefully get you started but only you can know how it'll perform in the circuit you design. The chat channel on hackaday is a nice place to riff with many of us who, like me, build stuff when we're not working on EAGLE. 🙂
Best regards,
Matt Berggren
Director - Autodesk
EAGLE, Tinkercad, other stuff.