Hi - I'm testing a few circuits to get them working before moving on to a project, and I'd like some assistance with a two channel SSR relay as pictured. The SSR component are Weiba input 5V and output (load) 5-40VDC/5A. I've seen other posts saying SSRs shouldn't be used to switch DC but clearly this is intended to. The problem is that each circuit works OK in isolation but as soon as I hook up both, one seems to want to 'latch' and even though the on-board LED is off, the relay is 'energised' when it shouldn't be. And when running a sketch sometimes the 2nd relay works, sometimes not. Yet when hooking it up in isolation it works fine (my first thought was it was faulty). Anyone got any positive suggestions please? The circuit is two off plain LED circuits running from a breadboard using 12V to power the LEDs, Arduino powered via USB and connected to the SSR via pins 2, 3 and 5V and GND.
int ch1Pin = 2;// define pin 2 for chan 1 of SSR FAN
int ch2Pin = 3;// define pin 3 for chan 2 of SSR LED
int triggerType = LOW;// type LOW if low trigger and HIGH if high trigger SSR. SIMON LOW level trigger means zero volts activates relay NOTE ITS WRITTEN ON THE RELAY
int ssrON, ssrOFF;// used for two different SSR trigger type. Do not change
void setup() {
pinMode(ch1Pin, OUTPUT);//define ch1Pin as output
pinMode(ch2Pin, OUTPUT);//define ch2Pin as output
if(triggerType == HIGH)
{
ssrON = HIGH;
ssrOFF = LOW;
}else{
ssrON = LOW;
ssrOFF = HIGH;
}
digitalWrite(ch1Pin,ssrOFF);// set initial state of SSR 1: OFF
digitalWrite(ch2Pin,ssrOFF);// set initial state of SSR 2: OFF
}
void loop() {
digitalWrite(ch2Pin,ssrON);// turn relay SSR1 ON
delay(1000);// waite for 3 seconds
digitalWrite(ch2Pin,ssrOFF);// turn relay SSR2 OFF
delay(1000);// waite for 3 seconds
digitalWrite(ch1Pin,ssrON);// turn relay SSR1 ON
delay(1000);// waite for 3 seconds
digitalWrite(ch1Pin,ssrOFF);// turn relay SSR2 OFF
delay(1000);// waite for 3 seconds
} // close void loop
I am becoming increasingly bored at having to say this, but please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'
Use code tags (the </> icon above the compose window) to make it easier to read and copy for examination
Thank you! Have posted the code. Yes - the problem seems intermittent either one or the other works. I've played with the code, deleting all reference to one complete channel and yet the problem remains. It's almost like it refuses to work in conjunction with the other
What would show that? I don't follow what you're saying. The +ve and -ve are connected to the Ardunio 5v and GND correctly, I don't believe the high voltage switching side has any polarity and can be used to switch the 'live' or 'ground' side of any circuit?
Using an Arduino Uno.
Simulator code? Not sure what you mean - this is the code uploaded to the Arduino.
I can't find a data sheet for the exact SSR - here is the ebay link to it. it's a DC-DC 5V / 5-40VDC SSSR 2 channel stating it's made for Arduino
It is a low level trigger written on it if that's any help
MIght there be a better SSR that I should use instead? Open to suggestions/guidance
Doesn't matter if you believe it or not. DC ALWAYS has polarity. A SSR for DC always is polarity sensitive, since the output is a MOSFET, not a mechanical relay!
First problem with a lot of this stuff is no actual data sheet. Looking at what you have, by name, I can't find anything. A good quality SSR will have a data sheet spelling out things like Output Voltage Max and Output Current Min.
Something you can try is placing a 10K resistor to ground on the + control inputs. Also less a minimum current specification I have no idea what you actually have. In this case a picture is not worth a thousand words but a true accurate data sheet would be. Again, try a few 10K resistors to ground on the + control voltage pins. Finally as mentioned Load Polarity certainly does figure into things. I suggest you look at data sheets from reputable DC SSR manufactures like Crydom or similar.
int ch1Pin = 2;// define pin 2 for chan 1 of SSR FAN
int ch2Pin = 3;// define pin 3 for chan 2 of SSR LED
int triggerType = LOW;// type LOW if low trigger and HIGH if high trigger SSR. SIMON LOW level trigger means zero volts activates relay NOTE ITS WRITTEN ON THE RELAY
int ssrON, ssrOFF;// used for two different SSR trigger type. Do not change
const unsigned long OneK = 1000;
unsigned long pastTickCOunt = millis();
int state = 0;
void setup() {
pinMode(ch1Pin, OUTPUT);//define ch1Pin as output
pinMode(ch2Pin, OUTPUT);//define ch2Pin as output
if (triggerType == HIGH)
{
ssrON = HIGH;
ssrOFF = LOW;
} else {
ssrON = LOW;
ssrOFF = HIGH;
}
digitalWrite(ch1Pin, ssrOFF); // set initial state of SSR 1: OFF
digitalWrite(ch2Pin, ssrOFF); // set initial state of SSR 2: OFF
}
void loop()
{
switch ( state )
{
case 0:
digitalWrite(ch2Pin, ssrON); // turn relay SSR1 ON
pastTickCount = millis();
state = 1;
break;
case 1:
if ( (millis() - pastTickCount) >= OneK )
{
digitalWrite(ch2Pin, ssrOFF); // turn relay SSR2 OFF
pastTickCount = millis();
state = 2;
}
break;
case 2:
if ( (millis() - pastTickCount) >= OneK )
{
digitalWrite(ch1Pin, ssrON); // turn relay SSR1 ON
pastTickCount = millis();
state = 3;
}
break;
case 3:
if ( (millis() - pastTickCount) >= OneK )
{
digitalWrite(ch1Pin, ssrOFF); // turn relay SSR2 OFF
pastTickCount = millis();
state = 4;
}
break;
case 4:
if ( (millis() - pastTickCount) >= OneK )
{
pastTickCount = millis();
state = 0;
}
default:
state = 0;
}
} // close loop()
The picture of the dual SSR that you posted shows on the screen printing on the case of the actual SSR that the two output pine have a + sign on one and a - sign on the other. Trace those to the green connector and those are the + and - connections for your external circuit.
Thank you for your assistance. This is what is posted on the ebay site for the SSE
Working Voltage: 5V/12V / 24V
Channel:1 / 2 / 4 / 6 / 8
Weight:13g/21.5g/40g/53g/70g
Control Method: DC - DC
Load voltage:5-40VDC
Load current:5A
Voltage version Quiescent current Working current
1-CH 5/12/24V 0mA 12.5mA
2-CH 5/12/24V 0mA 20.5mA
4-CH 5/12/24V 0mA 38mA
6-CH 5/12/24V 0mA 70mA
8-CH 5/12/24V 0mA 128V
Trigger Signal Source: Low level trigger
Where would the 10k resistors go - between the CH1 and GND and the CH2 and GND pins that control the SSR? Does that ensure they're pulled to zero V with no signal?