Go Down

Topic: Multiple Relays for outlet control (Read 5098 times) previous topic - next topic

skitzo2000

Nov 01, 2013, 04:42 pm Last Edit: Nov 01, 2013, 04:57 pm by skitzo2000 Reason: 1
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 https://www.sparkfun.com/products/retired/101

Mounted to this pcb here: https://www.sparkfun.com/products/retired/9096

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.

trum4n

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!
Try and fail or try and succeed. They are equal.

skitzo2000

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?

trum4n

http://www.arduino.cc/playground/uploads/Learning/relays.pdf is a good place to start. 2n2222's are cheap and tough. They can do what you need.
Try and fail or try and succeed. They are equal.

skitzo2000


skitzo2000

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.

TomGeorge

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.... :)
Everything runs on smoke, let the smoke out, it stops running....

skitzo2000

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!

TomGeorge

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

Tom.... :)
Everything runs on smoke, let the smoke out, it stops running....

skitzo2000

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

TomGeorge

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... :)
Everything runs on smoke, let the smoke out, it stops running....

skitzo2000

#11
Nov 03, 2013, 11:23 pm Last Edit: Nov 03, 2013, 11:44 pm by skitzo2000 Reason: 1
Here's the circuit and code

Code: [Select]
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);
}

michinyon

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

skitzo2000

#13
Nov 04, 2013, 12:54 am Last Edit: Nov 04, 2013, 12:57 am by skitzo2000 Reason: 1
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.

TomGeorge

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.... :)
Everything runs on smoke, let the smoke out, it stops running....

Go Up