Code for controlling a solenoid valve

I was assuming that the code will control the time with the output from the Arduino connected to the input of a relay which will drive the solenoid. I'm assuming in this that the 5V output mightn't be high enough otherwise?