Shop OBEX P1 Docs P2 Docs Learn Events
Propeller resetting when actuating relay — Parallax Forums

Propeller resetting when actuating relay

I have found discussions of similar problems but the solutions don't completely fix it in my case.

I'm using the propeller to actuate a relay that switches a 120VAC fan. My schematic:

20151018_201156-2.JPG

Currently, when the relay is switched, about 20% of the time the propeller resets. Before I added D1, D3 and additional capacitors to all my power circuitry (including the 14V, 9V, 5V and 3.3V which is not pictured) it reset ~90% of the time. Of all those changes adding D1 made the largest difference. The 100 Ohm resistor was selected because it was the largest resistance with which the relay would always trigger. My BOEn is grounded. My relay is glued face down and so I cannot provide a part number but I know it is rated to switch 120VAC.

I believe the issue is when the 120VAC is switched there's often enough emf produced and picked up by the relay coil to send a pulse into my power circuitry that triggers a reset of the propeller chip. I believe this because if I unplug the 120VAC triggering the relay never causes a reset. Interestingly however I cannot find/see a significant power deviation with my oscilloscope. There are very small fluctuations though, up to 100mV. Providing oscilloscope images would be impractical.

So my question is how should I further isolate the relay from my power circuitry so that the propeller never resets? Or otherwise fix the issue if someone sees/thinks of something I'm not thinking of.

Thanks so much in advanced. I love electronics and have been messing with parallax micro-controllers and therefore lurking on these forums for a while but this is the first time I've ever needed to ask a question. This problem is unusually frustrating for me as I've never been stumped by something that seems so simple.

Oh and when I say I added more capacitors I mean it. I've got 1000uF caps everywhere now haha. Also, I have a capacitor literally right on top/across of the propeller.
1518 x 1141 - 671K
«1

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2015-10-19 00:50
    Put a 1000 uF cap where the anodes of D1-D3 meet. This is assuming that your 14VDC supply ultimately gets regulated down to 3.3V for the Prop. Also, add a 2.2K pull-up to the Prop's /RST.

    -Phil
  • Thanks!

    Doing that definitely improved things but it still occasionally resets....

    And yes I do have 3.3V regulator (LM2937-3.3) for the Propeller... just checked it's output (for the first time in a week or 2) and it's outputting 3.73V now :/

    So maybe that's part of the problem and obviously I need a new 3.3V source before continuing...
  • jmgjmg Posts: 15,173
    amg018 wrote: »
    I believe the issue is when the 120VAC is switched there's often enough emf produced and picked up by the relay coil to send a pulse into my power circuitry that triggers a reset of the propeller chip. I believe this because if I unplug the 120VAC triggering the relay never causes a reset. Interestingly however I cannot find/see a significant power deviation with my oscilloscope.

    You would need a very good oscilloscope to catch this.
    The problem is relay closure/open and bounce can occur at any part of the mains cycle and that can generate >> 100V with a rise time under 1ns.
    With typical PCB track inductances, it needs very little capacitance (fractions of 1pF) to couple enough of that energy into more sensitive electronics.
    Using a Solid state relay is best, but failing that increase the distances where you can - think of the mains-side as aggressive RF, and ferrite beads may help.
  • Yea I thought of the random aspect to where in the AC cycle the relay turns on.

    I guess solid state relays don't switch as discretely?

    Can you reword what you mean by "but failing that increase the distances where you can"?
  • This is a common problem with A/C loads and I see we have great responses from some top guys But I'd like to add my 2 cents. I use a snubbing capacitor across the A/C coil of the relay I use 1-3 mfd 300-600 volt capacitor. The cap mfd varies with the size of the relay coil. Some snubbers use a cap and resistor in series . Just look up relay and contractor snubbers . I myself use the small d/c relay out of the prop to switch a higher load ac relay and use the snubber on the coil of the ac relay. Works every time without glitches.
  • jmgjmg Posts: 15,173
    amg018 wrote: »
    Can you reword what you mean by "but failing that increase the distances where you can"?
    You want to lower the stray capacitance - so route mains cables as far away as possible,

    eg the post quoted below suggests 'chaining relays', which gains separation distance and places two small capacitances in series :
    DigitalBob wrote: »
    I myself use the small d/c relay out of the prop to switch a higher load ac relay and use the snubber on the coil of the ac relay. Works every time without glitches.



  • I had never heard of snubbers but the theory absolutely makes sense and I've kind of used them before in other applications, just didn't know what they were called.

    Haha yea I just realized I have some wires for a temperature sensor (different sub-circuit) lying right beside the mains cable :| I wasn't even thinking about cable proximity being an issue. I've had issues on other projects due to wire/cable proximity but that was always with hf signals. Wasn't thinking about it but abruptly switching large voltages does make hf.

    Thanks for all the input! I definitely have some stuff to try I didn't before. I don't want to try anything else until I get a new 3.3 Volt regulator (don't think it's safe to run Prop off 3.7V, is it?). Just ordered them. I also ordered some solid state relays. I'll comment what happens/what I figure out when I get that stuff. Though I'll probably go solid state I do want to be able to do this right with coil relays; just on principal. Being able to switch 120VAC with a micro-controller controlled relay is absolutely something I should be able to do. Electronics always surprises me how complex things that seem simple can be.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2015-10-19 03:13
    Oops, nevermind... (Why the h3!! can't we just delete comments?)
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2015-10-19 03:30
    Your 3.73V will not be the fault of the regulator, they can only source current but if you have 5V or higher inputs into the Prop, even with resistors, this can bump up the supply voltage which is what you are seeing. Quick fix is to add a load resistor or even just a simple resistor + LED across the 3.3V supply as this is at least useful.

    Snubbers go across contacts, not coils (maybe he meant contacts). The coils have clamp diodes and D1 (and the other diodes) can be a fast diode like a Schottky as normal diodes will not react fast enough to spikes. 1,000uF electros are very poor spike suppressors, bigger is not better, just use little 0.1uF ceramics etc in the right places as these have very low inductance and impedance at high frequencies (spikes).

    Yes, that coupling from the mains is always a thing to watch out for.
  • There's definitely something wrong with my regulator. I have 5V going into it and regardless of its load it's a steady 3.73V. I already have a resistor + LED on it. It used to be 3.3V last time I checked.

    I do have some ceramics placed around. I'll have to acquire some Schottky diodes.
  • Put your meter on AC then and test the regulator. If you get a few hundred millivolts then ripple/stability is the problem. You may be using the wrong caps on the regulator, they need good ceramics or tants, not electros. I'm sure the reg itself is fine otherwise but a photo will help nail it.
  • What kind and value of caps do you have on the output of your LM2937-3.3? This regulator is particularly fussy about the ESR values of its filter caps. (See the datasheet.)

    -Phil
  • I've used that parallax opto isolated 8 channel relay board to drive A/C solenoids. Nothing but spikes and problems. I used cap. Snubbers across the solenoid coils problem solved. The diode isn't going to work across the ac coil. Great for the dc coils keep the correct polarity.
  • jmgjmg Posts: 15,173
    amg018 wrote: »
    I had never heard of snubbers but the theory absolutely makes sense and I've kind of used them before in other applications, just didn't know what they were called.

    Contact snubbers should be R-C in series, as C alone is a little brutal on the contacts.
    They need a little care as they represent a relay-off current path, and the R needs to be surge rated ( power resistor ) & the C mains rated with lightning spike margins.

  • DigitalBob wrote: »
    I've used that parallax opto isolated 8 channel relay board to drive A/C solenoids. Nothing but spikes and problems. I used cap. Snubbers across the solenoid coils problem solved. The diode isn't going to work across the ac coil. Great for the dc coils keep the correct polarity.

    You are talking about "snubbers" on A/C solenoids and the OP is talking about a relay driving a fan. It's ok to mention but it can also be confusing to the OP. We are talking about snubbers across the relay contacts where it will normally arc.
  • I think a solid state relay (SSR) as jmg suggested with a zero crossing switching circuit is a viable solution.
    I use snubbers at work all the time across coils and contacts. Here's one I've used with success. Of course you could make your own.......see data sheet for values.
  • Not all in the same place but I have 1000uF Electrolytic, .1uF Ceramic and .01uF Tantalum capacitors on the 3.3V circuit. There is no ripple (well, < 1mV) on the steadily 3.73V output.
    You are talking about "snubbers" on A/C solenoids and the OP is talking about a relay driving a fan. It's ok to mention but it can also be confusing to the OP. We are talking about snubbers across the relay contacts where it will normally arc.

    I understand the distinction; on some inductive AC loads you need a snubber in parallel with the AC device but here we are talking about a snubber across the switch itself. Correct?

    Will it kill my prop to use it with 3.7V?
  • jmgjmg Posts: 15,173
    amg018 wrote: »
    Will it kill my prop to use it with 3.7V?
    Not immediately ;)
    If it used to be 3.3V then something is awry. If it is oscillating, that means higher peaks.
    Meter Vcc with a fast, small signal diode and check it is < 3.7v.

    What happens to Vcc if you add a (say) 50mA load ?

  • jmg wrote: »
    amg018 wrote: »
    Will it kill my prop to use it with 3.7V?
    If it used to be 3.3V then something is awry. If it is oscillating, that means higher peaks.

    What happens to Vcc if you add a (say) 50mA load ?

    It's not oscillating.

    Nothing. It is quite steadily 3.7V no matter the load.

  • jmg wrote: »
    amg018 wrote: »

    Meter Vcc with a fast, small signal diode and check it is < 3.7v.

    What do you mean?
  • Like measure the voltage with a diode in series with the meter? yea then it's like 3.4V
  • This is probably way out in left field...but was your regulator working ok before you attached the AC wiring? And is the 3.73V with or without AC attached to the relay? If it doesn't matter then try removing the two wires going to the AC mains......I'm thinking that somehow AC is getting coupled into your power supply or common.
  • This is probably way out in left field...but was your regulator working ok before you attached the AC wiring? And is the 3.73V with or without AC attached to the relay? If it doesn't matter then try removing the two wires going to the AC mains......I'm thinking that somehow AC is getting coupled into your power supply or common.

    Unplugging the AC fan circuit dropped my ~3.7V about 4mV.
  • And either way I don't measure a ripple.
  • jmgjmg Posts: 15,173
    amg018 wrote: »
    Nothing. It is quite steadily 3.7V no matter the load.

    Curious... a strange failure mode.
    Are you using the same meter that gave 3.3V before ?

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2015-10-19 06:02
    Solder a 47uF tantalum right at the output of the 3.3V regulator, and see if that helps. I not convinced that your problem does not derive from the filter caps you've chosen or their placement.

    -Phil
  • jmg wrote: »
    amg018 wrote: »
    Nothing. It is quite steadily 3.7V no matter the load.

    Curious... a strange failure mode.
    Are you using the same meter that gave 3.3V before ?

    Yes. It's an RSR MS8217. I have changed the batteries though? I measure 3.6V with my oscilloscope.
  • Probably not significant then. Still looking for the regulator problem....... I just had a wild hair....
  • I just tried another meter (RS232C) and got 3.3V... haha so maybe my RSR MS8217 and oscilloscope are similarly miscalibrated? I want to believe the 3.3V....
  • Solder a 47uF tantalum right at the output of the 3.3V regulator, and see if that helps. I not convinced that your problem does not derive from the filter caps you've chosen or their placement.

    -Phil

    The largest tantalum I have is .47uF....

    Why doesn't parallax make this recommendation in their literature I wonder?

    Maybe my 2nd meter is right though. It says 3.3V almost exactly and I have changed the batteries on my 1st meter since the last time I checked with it... Still though I'd find it odd my scope and 1st meter give similar readings
Sign In or Register to comment.