Go Down

### Topic: Two SSR on one pin? (Read 3647 times)previous topic - next topic

#### HansF

##### Jan 17, 2013, 10:53 pm
Hi all

I want to drive two SSR from one pin (using Timer3 library on a Mega):
Code: [Select]
Timer3.initialize(TIMER_PERIOD);                    // initialize Timer3, and set a period. 100000=100 milli second
Timer3.pwm(pin_PWM_b, 0);                           // pre-initialize the pwm_b and set for 0% duty cycle

Relay is of type Fotek SSR-40DA:http://www.fotek.com.hk/page1e.htm. Operating Voltage is specified to 3~32V DC.

Two questions:
- Trigger current is specified to 7.5mA / 12V. I will drive it directly from Arduino Mega 2560, so this equals to 31mA @ 5V?
- Driving two SSR from one pin will be 63mA @ 5V? And is not advisable?

Calculation: R = U/I = 12/*0,0075 = 1600?. I = U/R = 5/1600 = 0,003125A
Two resistors in parallel: Req=(R1*R2)/((R1+R2) = 800?. Current I = U/R = 5/800 = 0,00625A

#### majenko

#1
##### Jan 17, 2013, 10:58 pm
First comment:  Provide a link to the datasheet, not the homepage of the manufacturer.

Second comment:  If the SSR requires 12V to run it, you can't just double the current and halve the voltage and expect it to work.  You have to provide 12V whether you like it or not - you will need to treat it like a real relay and drive it with a transistor and 12V supply.

Third comment: (more a question) - What are you controlling with the SSR?

#### MAS3

#2
##### Jan 17, 2013, 11:15 pm
This is a Solid State Relay.
Not a relay with a coil.
The site shows a sketch about how this is done: it is nothing more than an LED driving a switch.
You are making calculations as if you are driving some Ohmic load, but this is not true.
The SSR requires >2.4 V.
You can limit the current to be some 15 mA per SSR, i'd be surprised if that would not be OK.
In case you already have those relays, you can simply switch them using a 5 volt source (they will not be destroyed as protection is built in), and measure the current.
I would do that myself, but i don't know whether you are able to do that.

You can also switch both SSR in series, and have them "both use the same current".
Downside of that is that 5 volt is a bit too close to the minimum of 4.8 volts required, and if either one of your relays' LED fails, the other one will also fail.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

#### DVDdoug

#3
##### Jan 17, 2013, 11:32 pm
Two solid state relays will be no problem!

Quote
- Trigger current is specified to 7.5mA / 12V. I will drive it directly from Arduino Mega 2560, so this equals to 31mA @ 5V?
How about 3.1 mA?  Your calculations are correct when expressed in Amps, but when you converted to mA, your decimal point is off...

Logically (from Ohm's Law without bothering with the calculations) lower voltage (through a pure resistor) results in lower current.   i.e.  You should expect something less than 7.5mA when you lower the voltage form 12 to 5V.

#### MAS3

#4
##### Jan 18, 2013, 12:00 amLast Edit: Jan 18, 2013, 12:03 am by MAS3 Reason: 1
Putting 2 loads in parallel, will not lower the current.
In this case the current will be doubled (because they are equal loads), resulting in 15 mA.
But i guess TS is trying to predict the current at 5 volts compared to the given current at 12 volts, and is using the formula U=I*R.
But that is not what that formula is about.
If any, given U and I, try P=U*I.
12*0.0075= 0.09 Watts.
I=P/U; 0.09/5 = 0.018 A
So 18 mA.
But still, if you are going to measure, you will find out that this is not true.
A LED needs a current, and when that is met it will light up driving the SSR.
But there is also an internal protection sketched as a resistor so all bets are off on this.
Who knows what actually is in there.
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

#### dc42

#5
##### Jan 18, 2013, 12:25 am
The SSR operates from 3 to 32V, and at 12V takes 7.5mA. The input will comprise the IR LED of an opto isolator in series with a resistor. So at 5V input, the current draw will be less than 3.1mA. Therefore, you can connect at least 10 of them to a single Arduino pin if you want.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

#### HansF

#6
##### Jan 18, 2013, 10:27 am
Hi all, and thank you!

@majenko
1comment: I tried to; searched, navigated and copied the url. But frames framed me. I think this is better:http://www.fotek-cn.com/UploadFile/2012220132017254.pdf.
2comment: Not finding the spec, of course hard to understand what I am wondering about!
3comment: Brew kettle with two heater elements. Elements are driven by separate power lines.

@MAS3 1th post
I will measure the current, with both one and two SSRs and report back.
I have tried two in series. The indicator lights look a little dim compared to my third SSR. I have the same worries as you (4.8V vs 5V).

@DVDdoug
I used to be quite good at math, your sharp eyes was a reminder to always be focused...

@MAS3 2nd post
I follow you on the effect need, and agree. I also agree on not knowing what else is in there. But it is safe to try.

@dc42
You convinced me that I will not harm the Arduino.

#### majenko

#7
##### Jan 18, 2013, 12:40 pm
Quote
3comment: Brew kettle with two heater elements. Elements are driven by separate power lines

From the snippet of code you posted it looks like you are doing something with PWM to drive the SSRs?

You do realise, don't you, that PWM cannot really be used to control an AC target?  For that you need a more sophisticated waveform chopping system that is fully synchronised with the zero crossings of the AC waveform...

#### dc42

#8
##### Jan 18, 2013, 02:22 pm

You do realise, don't you, that PWM cannot really be used to control an AC target?  For that you need a more sophisticated waveform chopping system that is fully synchronised with the zero crossings of the AC waveform...

You can use very slow PWM to control AC mains heating elements, it's called burst-fire control. The PWM frequency needs to be well below the mains frequency, e.g. 1Hz.
Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

#### HansF

#9
##### Jan 19, 2013, 12:13 am
I am not skilled in electronics/Arduino, but this works perfect:
Code: [Select]
Pin allocation on Mega, sketch and libraries for IDE version 1.x
D2      PWM SSR-a control via Timer3 and OC3B
D3      PWM SSR-b control via Timer3 and OC3C
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <buttons.h>
#include <MENWIZ.h>
#include <EEPROM.h>
#include <PID_v1.h>
#include <OneWire.h>
#include <DallasTemperature.h>
#include <TimerThree.h>
#include <SdFat.h>
const uint8_t pin_PWM_a = 2;      // Digital I/O pin number for PWM signal to SSR-a
const uint8_t pin_PWM_b = 3;      // Digital I/O pin number for PWM signal to SSR-b
#define TIMER_PERIOD 3000000      // Timer3 period. 100000=100 milli second/3000000=3s
#define PID_LIMIT 1023            // output limit for the PID, same range as timer3 pwm duty cycle
PID hltPID(&sensorValue[HLT], &hltOutput, &hltSet, PARAM_KP, PARAM_KI, PARAM_KD, DIRECT); //Specify the links and initial tuning parameters
PID boilPID(&sensorValue[BOIL_1], &boilOutput, &boilSet, PARAM_KP, PARAM_KI, PARAM_KD, DIRECT); //Specify the links and initial tuning parameters
void setup() {
hltOutput = 0;
boilOutput = 0;
hltPID.SetOutputLimits(0, PID_LIMIT);   //tell the PID to range between 0 and the full window size
hltPID.SetMode(MANUAL);                 //turn the PID off
boilPID.SetOutputLimits(0, PID_LIMIT);  //tell the PID to range between 0 and the full window size
boilPID.SetMode(MANUAL);                //turn the PID off
pinMode(pin_PWM_a, OUTPUT);                         // configure pin 2 for output:
pinMode(pin_PWM_b, OUTPUT);                         // configure pin 3 for output:
Timer3.initialize(TIMER_PERIOD);                    // initialize Timer3, and set a period. 100000=100 milli second
Timer3.pwm(pin_PWM_a, 0);                           // pre-initialise the pwm_a and set for 0% duty cycle
Timer3.pwm(pin_PWM_b, 0);                           // pre-initialise the pwm_b and set for 0% duty cycle
}

void loop() {
hltPID.Compute();
boilPID.Compute();
if (millis() - lastIntTime >= intPeriod) {          // Is it time to change the pwm duty?
Timer3.setPwmDuty(pin_PWM_a, hltOutput);          // set the pwm with the output of the pid output to control the SSR:
Timer3.setPwmDuty(pin_PWM_b, boilOutput);         // set the pwm with the output of the pid output to control the SSR:
lastIntTime = millis();
}
}

Summary answer: my slooow pwm has a periode of 3s, and is turned on in fraction of 1024 for this periode. (Tried to cut out important SSR code, and to attach .ino file)

#### HansF

#10
##### Jan 27, 2013, 10:32 pm
I measured the current today. One relay use 4,4 mA and two (in parallel) on one pin uses 8,8 mA.

Go Up