int relayPin = 2;   // Relay connected to digital pin 2

void setup() {
  pinMode(relayPin, OUTPUT);
}

void loop() {
  digitalWrite(relayPin, HIGH);  // Relay ON
  delay(2000);                   // Wait 2 seconds

  digitalWrite(relayPin, LOW);   // Relay OFF
  delay(2000);                   // Wait 2 seconds
}
