Shop OBEX P1 Docs P2 Docs Learn Events
Driving SSR ("hockey-puck") directly with Prop I/O — Parallax Forums

Driving SSR ("hockey-puck") directly with Prop I/O

agsags Posts: 386
edited 2013-10-29 13:09 in Propeller 1
I would like to control 120vAC devices with a design that already is using a Propeller. I will use a SSR to do this (datasheet here: http://www.mouser.com/ds/2/418/NG_DS_1308242_SSR_1105-115996.pdf)

The SSR specs are minimum on control voltage 3v and maximum control current 15mA. The Propeller specs are minimum Voh=2.85v @ Ioh=10mA.

From the specs, this does not seem to be a robust design, instead suggesting an intermediate driver providing a 5v control (I have 3.3v and 5v available).

However, I have prototyped and found the Propeller does control this SSR without a buffer. Does anyone have any field experience with a similar situation that validates the reliability of this if I were to not use a 5v buffer (is the Propeller Voh(min) grossly understated/convervative?)

Thanks.
«1

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-10-09 09:52
    SSRs are opto-isolated, which means you're driving an LED that has a known forward voltage drop. If you drive it in current-sinking mode, you can probably get by with powering the anode from a voltage higher than 3.3V but less than 3.3V + Vfwd, Just make sure that any leakage current through the Prop's protection diodes when the port pin is tristated during reset does not exceed 500 uA.

    -Phil
  • agsags Posts: 386
    edited 2013-10-09 10:04
    Thanks Phil. I may be misunderstanding your reply, or I may not have been clear in my question. The SSR specs have a minimum "on" control voltage of 3v, but an acceptable range of 3-32VDC (input current max=15mA). My concern is that if the Propeller output can sag to 2.85v, that may not be enough to turn the SSR on. Based on that I'm considering an HCT driver to take the 3.3v (nominal) output from the Propeller and in turn drive the SSR with 5v driver output, which would be within spec.

    I am not following the statements about leakage current through tristated pins during reset. I presumed the SSR would not drive the control input to any level.

    Edit: Good grief, I've gotten quite lazy. It just occurred to me that I may have been confused and confusing because what I had planned just makes no sense. I was going to use a 74HCT34 (hex non-inverter) for the 3.3v->5v translation. That just doesn't make sense. I can use a single xtor and resistor to accomplish this. (although I don't have a clue which xtor to use - other than RF or power stuff I can't recall when I saw a discrete device). Does this now make more sense?
  • localrogerlocalroger Posts: 3,451
    edited 2013-10-09 10:57
    I've had this problem with OPTO-22 modules which don't quite turn completely on with 3v3. I have had good success though wiring the + input to 5V and the - to the Prop pin, using OUT=0 to turn the modules on. I have hundreds of them scattered across a couple of dozen field installations working that way, some of them 24/7 for more than three years now.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-10-09 10:58
    Here's what I was suggesting:

    attachment.php?attachmentid=104338&d=1381341607

    Let's say the LED has a Vfwd of 1.9V at operating current. Because of this, the Prop will not see more than 5V - 1.9V = 3.1V in operation. But the SSR will see a full 5V across its inputs when the Prop pin is pulled low.

    But there are caveats. With the Prop pin driven high, the SSR will still see 1.7V across its inputs. You will have to determine if that is low enough to keep the SSR turned off. Also, when the Prop pin is tristated (e.g. during reset) there is a leakage path into the pin and through the upper protection diode to +3.3V. If the LED leaks more than 500 uA when driven by 5V - 3.3V - 0.6V = 1.1V, it will exceed the Prop's Abs Max rating for the pin.

    -Phil
    347 x 300 - 3K
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-10-09 11:05
    You can always use a small MOSFET or BJT to drive the SSR in current-sinking mode.

    -Phil
  • agsags Posts: 386
    edited 2013-10-09 11:50
    @PhiPi now I see what you meant (also seems to be how localroger dealt with a similar challenge). This does get back to the theme of my original question - based on published specifications. The Prop only guarantees Voh of 2.85v. The SSR is guaranteed on at 3.0v and off at 1.0v. So, as you Phil points out, 5.0-3.3=1.7v exceeds the guaranteed off control voltage. I thought perhaps I could use prop pin=0 for on, and tristate for off, but then I run into the problem Phil also pointed out regarding leakage current during tristate. I don't know what the current draw for the SSR would be with Vin=1.1 v (other than it would be less than the maximum 15mA, which is obviously too much). I could measure units I have, but then I'm back to using empirical measurements not design specifications.

    @tonyp12 that seems like it would work. $0.08 in quantities of one... I suppose I can afford that (but too bad any additional part is needed).

    @PhiPi when you mention a single BJT/MOSFET, do you mean applying +5v to the SSR and then biasing the BJT for a path to ground? I don't even know where to start searching for a a single device any more.

    Thanks for all the good feedback.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-10-09 13:02
    ags wrote:
    @PhiPi when you mention a single BJT/MOSFET, do you mean applying +5v to the SSR and then biasing the BJT for a path to ground?
    Yes.
    I don't even know where to start searching for a a single device any more.
    RadioShack carries transistors. Any general-purpose NPN would do the job.

    BTW, I missed the 1.0V for guaranteed "off." That could indeed present a problem.

    -Phil
  • jmgjmg Posts: 15,173
    edited 2013-10-09 13:34
    ags wrote: »
    From the specs, this does not seem to be a robust design, instead suggesting an intermediate driver providing a 5v control (I have 3.3v and 5v available).

    Measure it.- measure the Vi and Drive I, and also lower the voltage to see how much margin you actually have.

    SSR's usually use an infrared diode (just over 1V Vf), and they have a series Rs
    It if specs 15mA MAX, that is at 32V so indicates a Rs of close to 2k.

    Down at 3V drive with a 1V LED, that is going to now be close to 1mA of Drive, so the Prop will drop less.

    What would make me nervous, is the higher voltage part specs 4V as a MIN.
  • agsags Posts: 386
    edited 2013-10-09 13:52
    This is a lot of discussion and thought about something that I had trivialized to "just connect a Propeller I/O pin to the SSR control pin". But I am glad for the robust treatment.

    I like the simplicity of localroger's approach - but that would be out of spec for my SSR. Perhaps the OPTO-22 specs differ from my SSR. Or perhaps I could get away with it.

    It occurs to me that tonyp12's suggestion (74HCT1G126) is basically a one-transistor approach. I actually like the idea of not having the Propeller directly driving (or sinking) the SSR control line. All other signals that go off-board in my design are through some kind of a driver. The drivers are socketed, so if something bad (aka stupid) happens, it is just a quick replacement (the Propeller is not socketed). Unfortunately the NXP part tonyp12 suggests is not available in a DIP, but it would be sacrificial nonetheless. I like the active driver over the open-drain solution (both isolate the Propeller from damage) because it also protects my onboard voltage regulator by not having +5v directly supplied. In the case of the control line being shorted to ground, the open-drain method would result in a direct short of the regulator. The '126 method would protect the regulator at the expense of the $0.38 driver.

    Does this sound reasonable? I should try not to make a career of this one connection...
  • jmgjmg Posts: 15,173
    edited 2013-10-09 14:00
    If you are worried about protection, then use an opto-Coupler.
    That gives full isolation, and you can use any voltage within the SSR range.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-10-09 14:03
    Two things:

    1. A "direct short of the regulator" would only occur if you used a really big transistor. A puny 2N3904 will fail before it shorts the regulator.

    2. Most regulators are protected against shorts by virtue of built-in thermal limiters.

    -Phil
  • agsags Posts: 386
    edited 2013-10-09 14:03
    jmg wrote: »
    ...What would make me nervous, is the higher voltage part specs 4V as a MIN.

    I'm not following: which higher voltage part?

    Your calculations make sense, and a diagram of the SSR does indicate a IR LED and Rs. Reverse engineering, that does mean 2k, and 1mA current if driven to 3.3v. While not a big safety margin, that would work. That would have the Propeller directly driving the control line with 3.3v.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-10-09 14:05
    Yes, but according to localroger's experience with Opto22 relays, it may not turn on all the way.

    -Phil
  • agsags Posts: 386
    edited 2013-10-09 14:10
    Two things:

    1. A "direct short of the regulator" would only occur if you used a really big transistor. A puny 2N3904 will fail before it shorts the regulator.
    I meant a short of the +5v supply (directly from the regulator on my board) and ground somewhere else in the enclosure. Perhaps it's not likely. But it is made moot by your next statement:
    2. Most regulators are protected against shorts by virtue of built-in thermal limiters.
    -Phil

    So I guess I can use a BJT, which requires a series resistor between Prop pin and base, or I can use a MOSFET and avoid the resistor (but would the Vih/Vil be correct?) or the 74HCT1G126 tonyp12 suggests (which has correct Vih/Vil per spec). I think.
  • jmgjmg Posts: 15,173
    edited 2013-10-09 14:15
    ags wrote: »
    I'm not following: which higher voltage part?

    Your link data sheet says this
    480VAC Rated Models
    Those have 4V min specs.
    ags wrote: »
    Your calculations make sense, and a diagram of the SSR does indicate a IR LED and Rs. Reverse engineering, that does mean 2k, and 1mA current if driven to 3.3v. While not a big safety margin, that would work. That would have the Propeller directly driving the control line with 3.3v.

    I would still measure it, & check margin, those guys working at 230V/480V, do not know what a decimal point is ;)

    Optocouplers : I see a LTV-826 comes in DIP8, for 2 channels and is a moderate price.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-10-09 14:23
    ags wrote:
    or I can use a MOSFET and avoid the resistor ...
    Yes, but you will need a resistor to ground to prevent the MOSFET from turning on during reset before the pin is set as an output. And a small resistor in series with the gate is not a bad idea either.

    -Phil
  • agsags Posts: 386
    edited 2013-10-09 16:25
    @jmg I checked the spec sheet for the Opto22. They use 1k Rs, so the prop Ioh would be 2mA, instead of the 1mA if the reverse engineering for the SSR I have is correct (2k Rs). That may be enough, or not. I will measure and see what I come up with. Ugh, I just remembered that my variable bench supply... "is no longer with me" - don't ask.

    I'm not ever going to use the higher-voltage 480VAC SSRs. (until the board is done, at which time I will identify a reason that I must support 480VAC...)

    I think the $0.38 part tonyp12 suggested will be the plan if I cannot drive the control line directly from the Prop (which would have the associated risk of damage to the Prop).

    @PhiPi so you're saying the MOSFET would conduct with a floating gate - or just a best practice (for robustness)?
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2013-10-09 17:39
    Like This:
    Prop2SSR.png


    Duane J
    456 x 777 - 13K
  • kwinnkwinn Posts: 8,697
    edited 2013-10-09 18:07
    LED drive circuits.jpg


    Ags, you're over analyzing this. For driving any optoisolated device I use a 2n3904 in one of the posted circuits. In your case circuit 1 would be the best choice with R1 ~ 1K and R2 ~ 150 ohms. You could even leave out R2. A mosfet would also work as Phil suggested.
    1024 x 252 - 27K
  • agsags Posts: 386
    edited 2013-10-09 18:19
    Is R2 in circuit 1 necessary if the SSR already has a resistor (expected to be ~2k) in series with the IR LED? Otherwise, it results in the applied control voltage of about 3.4v, which is close to the minimum of 3v and not much more than the Propeller provides itself.
  • jmgjmg Posts: 15,173
    edited 2013-10-09 18:34
    Like This:
    Attachment not found.

    Duane J

    The NPN needs a resistor in series with the base, else the Prop pulldown is clamped hard at 3v3-Vbe
  • CircuitsoftCircuitsoft Posts: 1,166
    edited 2013-10-09 18:42
    If you want super easy, you something like an MUN2211 which is a pre-biased BJT. It has two resistors inside the package, so you can connect the base directly to the prop pin, emitter directly to ground, and collector directly to the negative input pin on the SSR.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-10-09 19:04
    Like This:
    Click image for larger version Name: Prop2SSR.png Views: 9 Size: 12.6 KB ID: 104341
    You also left out the pull-down on the MOSFET gate.

    ags,

    Yes, the MOSFET could conduct if the gate is left floating, e.g. during a reset.
  • dMajodMajo Posts: 855
    edited 2013-10-10 06:04
    Here's what I was suggesting:

    attachment.php?attachmentid=104338&d=1381341607

    Let's say the LED has a Vfwd of 1.9V at operating current. Because of this, the Prop will not see more than 5V - 1.9V = 3.1V in operation. But the SSR will see a full 5V across its inputs when the Prop pin is pulled low.

    But there are caveats. With the Prop pin driven high, the SSR will still see 1.7V across its inputs. You will have to determine if that is low enough to keep the SSR turned off. Also, when the Prop pin is tristated (e.g. during reset) there is a leakage path into the pin and through the upper protection diode to +3.3V. If the LED leaks more than 500 uA when driven by 5V - 3.3V - 0.6V = 1.1V, it will exceed the Prop's Abs Max rating for the pin.

    -Phil

    To avoid the damage of the internal diode simply add an external diode from the pin to vcc(+3.3). I have already used one diode from pin to vcc, one from pin to gnd and two resistors in series (just for insurance) from pin to live 240VAC as a zero crossing detector.
  • photomankcphotomankc Posts: 943
    edited 2013-10-10 07:26
    ags wrote: »
    @PhiPi now I see what you meant (also seems to be how localroger dealt with a similar challenge). This does get back to the theme of my original question - based on published specifications. The Prop only guarantees Voh of 2.85v. The SSR is guaranteed on at 3.0v and off at 1.0v. So, as you Phil points out, 5.0-3.3=1.7v exceeds the guaranteed off control voltage. I thought perhaps I could use prop pin=0 for on, and tristate for off, but then I run into the problem Phil also pointed out regarding leakage current during tristate. I don't know what the current draw for the SSR would be with Vin=1.1 v (other than it would be less than the maximum 15mA, which is obviously too much). I could measure units I have, but then I'm back to using empirical measurements not design specifications.

    ...


    Thanks for all the good feedback.


    All that is why I tend to just go with a transistor switch. Isolates the prop from all the higher voltages without relying on the protection diodes and trying to stay in the margins. Like Phil says, you can still get simple NPN BJT's at Radio Shack for this application.
  • photomankcphotomankc Posts: 943
    edited 2013-10-10 07:34
    If you want super easy, you something like an MUN2211 which is a pre-biased BJT. It has two resistors inside the package, so you can connect the base directly to the prop pin, emitter directly to ground, and collector directly to the negative input pin on the SSR.


    I knew not that such a thing existed. I must have them!
  • agsags Posts: 386
    edited 2013-10-10 10:05
    Yes, but you will need a resistor to ground to prevent the MOSFET from turning on during reset before the pin is set as an output. And a small resistor in series with the gate is not a bad idea either.

    -Phil

    I understand that if the MOSFET gate was high then the Prop was reset, the SSR would not be turned off during reset (but it would be turned off immediately upon coming out of reset (if the Prop pin is set OUT and =0). If the power to the Prop was removed, that would also remove the +5v to the SSR, so that's also OK, But it is good practice, I admit, to prevent the gate from floating.

    I'm totally puzzled as to why one would add a resistor in series with the MOSFET gate. The capacitance is far less than many other connections that Prop sees, so I suspect the purpose isn't to limit transient/switching current. Why do you suggest this?

    Thanks.

    Edit: BTW, I did verify that the regulator I use (LM317 series) does have thermal and current protection. All this time I thought it was significant point of failure if the board was improperly connected. Thanks for pointing that out. It never occurred to me that a regulator could survive a direct short across output/ground.
  • agsags Posts: 386
    edited 2013-10-10 10:09
    If you want super easy, you something like an MUN2211 which is a pre-biased BJT. It has two resistors inside the package, so you can connect the base directly to the prop pin, emitter directly to ground, and collector directly to the negative input pin on the SSR.

    This is brilliant. Thanks. (what is the application in which the resistor between base and emitter is useful?)
  • Duane C. JohnsonDuane C. Johnson Posts: 955
    edited 2013-10-10 10:31
    ags wrote: »
    This is brilliant. Thanks. (what is the application in which the resistor between base and emitter is useful?)
    2 reasons:
    1. The Base Emitter resistor consumes any leakage current from the Collector to Base. C to B leakage can be multiplied by the gain of the transistor resulting in some heating.
    2. Faster switching times.

    Zetex has quite a few variations. NPN, PNP, and many resister combinations.

    Duane J
Sign In or Register to comment.