Hi Guys,
My objective is to use a relay to control a 12v Linear Actuator.
So I bought a 2 channels 12V relay and I wired up the connection as in the attached photo/diagram. To avoid any damage to the linear actuator, I connected the orange wires to the multimeter to test whether it has the expected voltage output or not (12v).
However, with the existing wire connection, I got no voltage output, the multimeter always showing 0.
Please see my code below as well
Note: I can hear the sound of "click" when the program is running which it switches one relay to another.
Can anyone advice what did I miss out?
Thanks.
Regards
Vincent
//Use constants for the relay pins in case you need to change these later
const int relay1 = 2; //Arduino pin that triggers relay #1
const int relay2 = 3; //Arduino pin that triggers relay #2
void setup() {
//Set pinMode to OUTPUT for the two relay pins
pinMode(relay1, OUTPUT);
pinMode(relay2, OUTPUT);
}
void extendActuator() {
digitalWrite(relay1, HIGH);
digitalWrite(relay2, LOW);
}
void retractActuator() {
digitalWrite(relay1, LOW);
digitalWrite(relay2, HIGH);
}
void stopActuator() {
digitalWrite(relay1, LOW);
digitalWrite(relay2, LOW);
}
void loop() {
extendActuator();
delay(1000);
stopActuator();
delay(1000);
retractActuator();
delay(1000);
stopActuator();
delay(5000);
}