Multiple Relays for outlet control

Hey Guys, I started a project a few years ago, but hit a stumbling block, and I'm getting around to trying to out again.

I have four of these SSR's Relay SPST-NO Sealed - 30A - COM-00101 - SparkFun Electronics

Mounted to this pcb here: Relay Control PCB - COM-09096 - SparkFun Electronics

All the associated components etc are put together and all of them work... So I'm confident in the pieces and my soldering skills.

However I've never been able to control more than one at a time. I realize it's associated to the max output voltage on my arduino, but I need a push in the right direction for making it all work.

I would like to be able to independently control four different outlets 120v, max 10a. I know they discontinued the board for isolation reasons, so
A.) am I' ok to still use these boards at those ratings, and
b.) What do you guys recommend for controlling these.

The full setup is for fermentation control for my home made brews.

Two things:

  1. The linked part is a relay, not an SSR. So, make sure you protect the controls with a diode on the coil. The kickback can reach >100volts!

  2. The coil draws 200ma continuous! The arduino is only good for about 20ma per pin! If you use some sort of driver (transistor) and a small power supply, you should be fine. However, be warned. A typical USB port can only supply ~500ma, enough to run two relays like this!

My apologies thanks for the correction, I've updated my post title to reflect the change. Relay not SSR.

And noted. There's actually a diode integrated to the boards I used. I thought that would help to handle that? See my newb showing through yet.

As for an external power supply, Thats fine I can easily use a seperate wall wart. Can you lead me in the right direction of the type of circuit I should be building?

Arduino Playground - HomePage is a good place to start. 2n2222's are cheap and tough. They can do what you need.

Awesome. Thanks for the help

Ok I've had a chance to dive into this a little more and the board I have the relay mounted to is already setup with an npn 2n3904 and diode. as well as a few resistors and an led to indicate that the relay is on and working.

For more details you can see the data sheet here: https://www.sparkfun.com/datasheets/Components/RelayBoard-Large-v12.pdf

Given this bit on info would you still plan to implement with another npn on the ground side? Or Should I bee looking for the pnp pair to run the control side on the board I have?

Thanks again for any help.

Hi, the transistor mounted on the relay board will be enough for the arduino to drive, but you will need an external power supply as mentioned to power the relay coils.
The integrated diode is enough as well.

Tom.... :slight_smile:

Thanks Tom for the verification.

Now on to the project. I've setup a bench supply to drive the 5v side of the relays, but I continue to hit the same wall I've always had before on this project. I can't get more than one relay to run at one time.

I setup a basic circuit to test if I could have two relays on at the same time, and as soon as my code hits the part where two will be on at once it fails. I'm using digital pin high to trigger the relays. Help!

Hi, post your code for us to see and a copy of your circuit.

Tom.... :slight_smile:

Sorry if this sounds dumb. But whats the best way to post my circuit?

http://forum.arduino.cc/index.php/topic,148850.0.html

use this link to see how to post circuit and code, down to about item 7...

Tom... :slight_smile:

Here's the circuit and code

int one = 6;
int two = 9;
int three = 10;
int four = 11;

// the setup routine runs once when you press reset:
void setup() {                
  // initialize the digital pin as an output.
  pinMode(one, OUTPUT);
  pinMode(two, OUTPUT);
  pinMode(three, OUTPUT);
  pinMode(four, OUTPUT);  
}

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(one, HIGH);   //This cycle works fine the relay works
  delay(1000);   
  digitalWrite(two, HIGH);   // At this point the failure occurs, when neither relay is activated
  delay(1000);             
  digitalWrite(one, LOW); 
  delay(1000);     
  digitalWrite(two, LOW);    
  delay(1000);   

  digitalWrite(three, HIGH);    delay(1000);  
  digitalWrite(three, LOW);  
  delay(1000);    

  digitalWrite(four, HIGH);  
  delay(1000);    
  digitalWrite(four, LOW); 
  delay(1000);
}

So what does it actually do, when you run that program ?

Its a test program to see if everything is working, I am a programmer by day so I'm pretty sure the code is solid. Its really the wiring/electronics I'm not so good at
It should:
Turn on the first relay < works
wait one second
turn on the second relay <Doesn't Work both relays shut off at this point
wait one second
Turn off the first relay < Its already off , but the second relay starts working here
Wait one second
Turn of the second relay < works
wait one second
Turn on the third relay < works
Wait one second
Turn off the third relay < works
wait one second
Turn on the Fourth Relay < works
wait one second
Turn off the fourth relay < works
wait one second.

I'm fairly certain I need to employ another circuit between the arduino and the relays. Please note there is already a diode and npn transistor built into the board the relay is mounted too, see the above posts for the full breakout.

Once I can get the above basics working then I'll start working on integrating the Dallas temp sensors etc. I've always struggled with getting more than one relay at a time, so I need to fix that and understand why before I can really move on to anything more complex.

Hi, measure the 5V supply that you are using to supply the relays, the voltage should stay at 5V all time. Even when the second relay fails to operate and the first one drops out. You have not said if the third and fourth relays operate with the sketch.
If it is only the fact that two relays cannot be held on together, I would say your bench supply is not providing the current required, Does it have a current limit facility and at what current level is it set.

Tom.... :slight_smile:

Thanks for the input Tom. Its a really basic bench supply I hacked together years ago from a PC power supply(400w), so I'll check and see about the voltage dropout. It seems that it should be plenty of power, but you could be right.

As for relay 3 and 4, yeah they work. Sorry I forgot to mention that little bit.

I decided for fun to just lose the relays and go back to basics with a set of LED's both to test the programing and make sure I was on the right track, and everything works as I expected. In the process of hooking everything up I realized that I'm not using the same ground to power the Arduino that is on the bench supply. I've got the arduino hooked up to a laptop to power it. I guess I kinda assumed that everything goes back to the same place anyway... but maybe thats the missing link here?

Hi, thanks for reply, yes, not joining gnds will probably be the cause.
Awaiting your results.

Tom... :slight_smile:

It really was that simple. I just need to get the common ground and then everything works. Thanks so much for your help Tom. Now on to building something really fun!