givinig 5v power for controlling Relays

Hello i have an Arduino Leonardo and i want to connect 2 Relays on it.
I want to ask if it better to connect 5v in 5V and GND pins or it is better to connect 5V power supply in power socket next to on LED and after to connect Relay's VCC to 5V pin.......

Basically i don't know if my second option is correct....cause is my first time using Arduino

Check data sheet of relay your using.
Depend on coil voltage give supply.
controll voltage will be 5V . digital IOS you can give if you using transistor based or optocoupled circuits

I am sending you the data sheet of the Relay i am using.

"digital IOS you can give if you using transistor based or opto coupled circuits "

i will use this layout so my Base will be on a digital I/O pin.....if i understand what you mean... :confused:

15ZFHA00212-1eng.pdf (72.2 KB)

My question is how you energizing relay. with opto couple based circuit or transistor based circuit
optocoupled based

relay based

for coil voltage you need to refer model you have ordered. On relay top mentioned coil voltage and contact volatage. As per data sheet relay module avilable in 5v/12v/24v

it is a 5V Relay.

And i will use a transistor based circuit

iF IT 5V RELAY. JUST GIVE 5V AND CHECK IT OUT. iT SHOULD WORK

if you a buying a packaged relay from e-bay, then all you need is to feed it a signal. it has an opto.

if you are using a bare-bones relay, feed it with 5v to the coil. from the other side of the coil to a transistor, then the transistor to ground.

if you use a transistor, remember to use a current limiting resistor between the pin and the base.
if you use a FET, you do not need the resistor.

you may want to use a weak pull-down on the base to make sure it turns off.

Typical Relay Driver