const int relayPin = 53; // Pin connected to the relay (using pin 53 for an Arduino Mega)
void setup() {
pinMode(relayPin, OUTPUT);
}
void loop() {
digitalWrite(relayPin, HIGH); // turn the relay on
delay(3000); // wait for 3 seconds
digitalWrite(relayPin, LOW); // turn the relay off
}