I am trying to use and arduino uno and seeed studio relay shield to control a 12 vDC solenoid valve. It seems simple enough but I cannot find any instructions on the relay shield. I also need a simple loop code to actuate the relay.
My first attempt was as follows:
Relay shield stacked on arduino uno
DC power supply connected to positive terminal of valve
Negative terminal of valve connected to NO3 (Normally Open) on the relay shield.
COM3 on the relay shield connected to DC power supply.
The code I ran is as follows:
int ValveControl = 5; // Arduino Pin to control the valve
// the setup routine runs once when you press reset:
void setup() {
// declare pin 5 to be an output:
pinMode(ValveControl, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(ValveControl,HIGH);// NO3 and COM3 Connected;
delay(1000);
digitalWrite(ValveControl,LOW);// NO3 and COM3 Disconnected;
delay(1000);
}
