Problem powering 24V solenoid valve with arduino

Hi! I am trying to create a pneumatic system using a solenoid valve I purchased from Parker. It is the Parker-Hannifin 3-way solenoid valve part #009-0269-900. This is the data sheet if interested:

http://www.parker.com/Literature/Literature%20Files/Precision%20Fluidics%20Division/UpdatedFiles/Series%209%20Data%20Sheet.pdf

It takes 24V to switch the valve to the normally closed side. I am trying to program it using an Arduino Uno to switch back and forth every 5 seconds. I am very new to all of this so I don't know how much of it works. I found a website, BC Robotics, that was very helpful, and I set it up that way, but it still doesn't work. I am using a 24V power supply. This is the website where I found it from:

I have attached pictures of the setup of the breadboard, and the setup of the arduino (almost exactly the same as BC Robotics, except it's 24V). Any help will be greatly appreciated as I am in a time crunch and cannot for the life of me figure out what is wrong with my setup.

Here is my code:

int solenoidPin = 4;  //This is the output valve on the Arduino

void setup() {
  // put your setup code here, to run once:
  pinMode(solenoidPin, OUTPUT);  //Sets the valve as an output
}

void loop() {
  // put your main code here, to run repeatedly:
  digitalWrite(solenoidPin, HIGH);  //Switch Solenoid ON
  delay(5000);                       //Wait 5 sec
  digitalWrite(solenoidPin, LOW);   //Switch Solenoid OFF
  delay(5000);                       //Wait 5 sec
}

Thanks so much!!

Here are the photos I tried to attach above. Thanks!

IMG_5868 (1).JPG

IMG_5869 (1).JPG

IMG_5871 (1).JPG

IMG_5872 (1).JPG

Are you using the exact same parts as the tutorial? Are you sure everything is wired up the correct way? (such as that flyback diode being 'backwards'? How are you powering the Arduino? Are you putting 24V into it? Are you using a separate power supply (and if so this is probably where your problem is if you didn't go wrong anywhere else)?

Wow, thank you so much. The diode was in the wrong way, I never even noticed that there was a direction to that. Works perfectly now! Thanks again for the help!

Glad its working, I'm still curious how you're using a 24V supply to power the Arduino.

The diode was in the wrong way, I never even noticed that there was a direction to that.

I know I really should not make fun of you, but that is soooo deliciously ironic! (The single most important thing to know about a diode is that it has a direction to it, that's its raison d'etre). Thanks for the chuckle.