help with a relay

hy i need to use the arduino to start a relay but as i can see i cant connect a relay directly to the arduino could any of you please tell me what components i need to build it and a scheme

the relay is SRD-05VDC-SL-C

i have transistor BC548
diode 1N4004
resistor 1K omh

will i be able to use this or would i need something else?

You can use those components to control a relay.
Now you need to determine how you'll use those components to control the relay - plenty of examples out there.

ty guys you where a great help.

any chance you can tell me how should i write te code should digital pin be output or input

any chance for a sample blink code :roll_eyes:

ico170:
ty guys you where a great help.

any chance you can tell me how should i write te code should digital pin be output or input

any chance for a sample blink code :roll_eyes:

yep, the arduino IDE comes with a lot of examples :wink:

alnath:

ico170:
ty guys you where a great help.

any chance you can tell me how should i write te code should digital pin be output or input

any chance for a sample blink code :roll_eyes:

yep, the arduino IDE comes with a lot of examples :wink:

One of which is called, cunningly enough, Blink.