Arduino Opta 12 VDC Output

I'm trying to use the Arduino Opta Lite to engage and disengage pneumatic cylinders by energizing a solenoid valve with a 12 V coil. From my understanding, when the relay output is opened on the Opta it will have the same rating of the supplied voltage (which I have it powered by a 12 VDC power supply). When I run the program the relays open as they should, but they do not output any voltage. They do however have continuity between the contacts. Not sure if I'm missing something painfully simple or not.... here is the code:

int buttonState = 0; //sets button position to off by default
int counter = 0; //sets counter position to 0 by default

void setup() { //sets desired inputs and outputs
  pinMode(BTN_USER, INPUT); //sets USER button as input
  pinMode(D0, OUTPUT); //sets relay 1 as output
  pinMode(LED_D0, OUTPUT); //sets STATUS LED 1 as output
  pinMode(LED_D3, OUTPUT); //sets STATUS LED 4 as output 
}

void loop() { //runs until counter = 100
  buttonState = digitalRead(BTN_USER); //renames button status (on or off)
  if (buttonState == LOW) { //if button is pressed
    cycle();
  } 
}      
    
void cycle() {
  for (int counter = 0; counter < 5; counter++) { //defines loop to continue for 100 reps
    digitalWrite(LED_D3, LOW);
    digitalWrite(D0, HIGH); //turn on output relay 1
    digitalWrite(LED_D0, HIGH); //turn on STATUS LED 1
    delay(3000); //leaves LED and relay on for 3 seconds
    digitalWrite(D0, LOW); //turn off output relay 1
    digitalWrite(LED_D0, LOW); //turn off STATUS LED 1
    delay(3000); //leaves LED and relay off for 3 seconds
    if (counter == 4) {
      digitalWrite(D0, LOW);
      digitalWrite(LED_D0, LOW);
      digitalWrite(LED_D3, HIGH);
    } 
  }
}

I'm not sure I understand your problem correctly. The relay connects or disconnects one terminal to the other. You're responsible to have your 12V on one terminal if you want to have such a switched signal on the other.

Please post a schematic, without one we don't know how you have it wired making it difficult to help.

Hand drawn and photographed is fine.

Thank you.

It's not very pretty but that's about all it needs to do.

The relay (01) is like a switch, so the two pins are either connected or open. In your wiring you seem to think that it has either a dipol output or nothing, so that you can directly connect a consumer. That's not the case. For your consumer you have to connect the minus of the 12V (commonly called ground, GND) directly to your solenoid and connect the plus of the 12V to one pin of the 01 relay and connect the other pin to the plus entry of the solenoid.

You are misunderstanding.

The relays are able to switch up to 250V AC, so there can't be a direct connection between the 12V power supply and the relay contacts.

However you can make a connection yourself, as pylon has described above.

I understand, thank you. It's up and running now.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.