/* Project: 12V solenoid valve control by Arduino board Function: If you want the solenoid to allow water to flow, set the pin high. If you want the water to stop flowing, set the pin low. */ int solenoidPin = 4; //solenoid attahced to Arduino digital pin 4 void setup() { pinMode(solenoidPin, OUTPUT); //Sets the solenoidPin as an output } void loop() { digitalWrite(solenoidPin, HIGH); //Switch Solenoid ON delay(1000); //Wait 1 Second digitalWrite(solenoidPin, LOW); //Switch Solenoid OFF delay(1000); //Wait 1 Second }