Sorry if the title doesn't describe much the question in here.
I have been reading about relays and I'm trying to understand how to connect a 12V power to a solenoid valve that will be activated through a relay (stay open if x happens stay close if y happens).
Above is my diagram. I'm sorry not making it pretty but I couldn't make a better image since I'm not at a desktop.
I'm not sure if this diagram is correct.
Pretty much I have a transformer converting 220V to 12V that will connect the positive side of it to pin 4 of the Relay. The negative side of it will connect to the solenoid valve. At the relay the pin 6 will connect to the Solenoid Valve. Pin 1 will connect to digital pin 1 of the Arduino. Pin 2 will connect to ground of Arduino. Is this diagram correct to use? Did I learn well how does a relay works?
PS: Transformer at the image is not the actual transformer I'm using.