Shop OBEX P1 Docs P2 Docs Learn Events
Overvoltage can cause SX to reset or go haywire? — Parallax Forums

Overvoltage can cause SX to reset or go haywire?

william chanwilliam chan Posts: 1,326
edited 2008-12-20 07:29 in General Discussion
Fellas,

1. If a SX running at 5v power supply is suddenly exposed to 10v or more for few miliseconds (due to a power surge?), will it reset or go haywire?

2. How well does a typical 78L05 regulator block incoming high voltage surges (let's say from a coil ballast of a fluorescent lamp)
from getting to the 5v supply?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.fd.com.my
www.mercedes.com.my
«1

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-11-02 04:07
    1) It could reset or "go haywire" or even be permanently damaged. It all depends on how much current is available and what power supply filtering is present. Devices like the SX are simply not designed to withstand power supply voltages beyond their Absolute Maximum Supply Voltage or any reverse supply voltage. For the SX, this Absolute Maximum Voltage is 7.0V. I/O pins can withstand higher voltages if the amount of current is limited, but this only works because the I/O pins have reverse connected diodes tied to the power supply connections on the chip that "short" the over- or under-voltage to the power supply.

    2) Pretty much any regulator can be damaged from voltages above around 36V. Read the datasheet for the regulator for the Absolute Maximum Input Voltage. Above this voltage, nothing is certain. The regulator may be destroyed and may allow the high voltage surge to destroy connected circuitry. Who knows?

    3) It looks like you need some protective circuitry including a varistor and some extra input filtering

    Post Edited (Mike Green) : 11/2/2008 4:15:15 AM GMT
  • william chanwilliam chan Posts: 1,326
    edited 2008-11-02 06:53
    3. But a typical DC 14v rated MOV will only clamp 8/20us surges at about 36v which may be too high and too sudden for the ol 78L05.....
    my.farnell.com/jsp/search/productdetail.jsp?sku=1057158


    An AC 250v rated MOV will only clamp at 650v, which seems to be of little help.
    It will only start to leak 1mA at 390v.

    my.farnell.com/jsp/search/productdetail.jsp?sku=1057192

    Sometimes we have to wonder whether these MOVs really help at all.

    My SX is placed inside a fluorescent lamp and it keeps restarting about 30% of the time when the florescent light is trying to switch on. ( It probably went haywire and got restarted by the watchdog )

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my

    Post Edited (william chan) : 11/2/2008 7:00:58 AM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-11-02 14:11
    "My SX is placed inside a fluorescent lamp..." - Although the fluorescent lamp housing will likely create a faraday cage, you probably need a second one for the SX and most of it's circuitry.

    Are you doing any pre power filtering before the regulator?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • william chanwilliam chan Posts: 1,326
    edited 2008-11-02 18:21
    Beau,

    I have included a 2 transistor (both TO-92) circuit which will clamp the voltage before the regulator to about 12v.
    Now the restart rate has been reduced to about 10%.
    I think the trick may be to optimize the value of the series resistor that supplies power to the regulator.

    I haven't tried installing the MOVs yet.

    The product can't afford another metal cage.

    What other filters do you have in mind?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my

    Post Edited (william chan) : 11/2/2008 6:30:12 PM GMT
  • Macgman2000Macgman2000 Posts: 59
    edited 2008-11-02 21:14
    Is it possible to post your schematic? I would start with chokes on VSS and VDD to the Micro. Does the ballast have it's own shielded case? It could be generating a field that is being coupled in to the I/O lines or to your micro supply. I am able to crash and restart an SX with a simple 3 phase motor, simply by bringing it within 4" of the micro on my project board. Looking at the scope I can see 12v pulses on the I/O line driving the half-H-bridges. When I move it away, it's fine.

    BTW...that was with 7805 using chokes @ about 4A motor starting current.

    Nick
  • william chanwilliam chan Posts: 1,326
    edited 2008-11-05 01:03
    How to use inductors to filter to input power before the regulator.
    Can place a 1mH inductor in series before going into the 78L05?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my
  • Macgman2000Macgman2000 Posts: 59
    edited 2008-11-06 02:33
    I usually use 22uH feeding VSS and VDD on the mcu with caps. Mainly because motor noise is pretty nasty to mcu's, lots of voltage spikes and for brushed motors lots of high speed commutation noise. Keep your leads short, shield your circuit board if you can.

    Nick
  • william chanwilliam chan Posts: 1,326
    edited 2008-11-06 04:48
    Macgman,

    How did you arrive at the value of 22uH?
    Why after the regulators?
    Did you try to test with the inductors and another test without the inductors to see the differences
    achieved by the inductors ?

    Thanks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-11-06 06:44
    william chan,

    When configured as a series LR low-pass filter, the inductor value depends on the Impedance of the inductor at a given frequency. If you are having noise issues with the fluorescent lighting, then 22uH is probably not going to do much in the way of suppressing 120Hz since it is intended for noise suppression at much higher frequencies. What I would probably do at this point would be to try and scope the power to the SX and determine what kind of noise levels are present on the power supply. Then scope each of your inputs to see if there is a problem there as well. An active Notch filter at 60 and 120 Hz on the power would probably not be a bad idea since you know they will be there.

    As far as the faraday cage, I believe that this still has merit... you don't necessarily need a separate box per say, but a metal shield that compartmentalizes the SX away from the ballast and lamp.


    Reference:
    www.cvs1.uklinux.net/cgi-bin/calculators/ind_imp.cgi

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • william chanwilliam chan Posts: 1,326
    edited 2008-11-06 07:31
    Beau,

    AC Freq here is 50Hz, lower than 120Hz.
    But I think the noise is not coming from the 50Hz power but rather from spikes created by the starter and the fluorescent tube when trying to switch on (strike) or when switching off.

    Or could it be spikes that were created when the mechanical relay switches on or off the power to the fluorescent lamp.
    Unfortunately, mechanical relay switching cannot implement zero crossing detection.

    What frequency should spikes usually be?

    Atttached is the schematic. It may look odd, but it works with the Parallax PIR sensor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my
    1045 x 715 - 22K
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-11-06 08:48
    william chan,

    "AC Freq here is 50Hz, lower than 120Hz" - right, but a typical ballast fluorescent lamp will produce a frequency that is twice the mains, so in your case 100Hz

    "What frequency should spikes usually be?" - Every frequency across the board


    I would put additional diode-capacitor filtering off of the 5V regulator with this application.... What I see is that this circuit probably doesn't supply a great deal of current, and just the relay turning on·causes a·power surge that can probably be seen on the 5V side. I would be willing to bet that you would still see these problems if the fluorescent lamp wasn't even connected and it was just the relay turning on and off. interference from the fluorescent lamp probably doesn't help much either.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-11-06 12:07
    in re. litesave.png

    Still fighting the 10K pullup on /MCLR, I see.
  • william chanwilliam chan Posts: 1,326
    edited 2008-11-06 12:59
    Beau,

    You may be surprised but this circuit is capable of supplying 80mA of current.

    I am certain switching the relay itself (without any load) does not cause any restarts because of the timing of the restarts.
    (the SX plays a unique tune on the speaker upon startup)

    The relay coil only takes 35mA when energized continuously.

    Can you give an example of the "additional diode-capacitor filtering off of the 5V regulator"?
    Thanks.


    PJ Allen,

    Sorry about the 10k resistor. I originally wanted it but the board ran out of space.... really.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-11-06 16:19
    William, while I am not clear on the reason, I remember some customers having strange issue when tying the /MCLR line high as opposed to pulling it high. There was a whole thread on this subject. I too am surprised in light of what was brough up before. And with you having strange issues...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-11-06 16:40
    william chan,
    ·
    The 9.7V zener (D1) in your circuit is causing Q3 and Q5 to stay "on", defeating the purpose of the snubber circuit.· This circuit is designed to turn "on" in the event of an inrush positive voltage spike.· A reverse biased diode across the C-E junction of Q3 is all that is necessary to snub an inrush negative voltage spike.
    ·
    For diode capacitor filtering around the regulator, take a look at this link...
    ·
    http://forums.parallax.com/attachment.php?attachmentid=39280
    ·
    ...Description of diode-capacitor filter:
    Going from left to right, the first diode and capacitor combination off of the INPUT terminal to the regulator form a first stage "diode/capacitor filter". The second diode connected to the regulators GND terminal shifts the Ground reference by 1 diode (.6V) in preparation for the third diode. The third diode connected to the regulators OUTPUT forms a second stage "diode/capacitor filter". Since the third diode creates a diode voltage drop of .6V it is necessary to compensate that with the use of the second diode to shift the voltage up by .6V so that the net output remains at 5V.
    ·
    ·
    As far as using a pull-up resistor on the /MCLR, Chris is right.· The pull-up provides a slight amount of delay necessary for proper power up of the Chip.· This phenomenon is not isolated to the SX, many other processors with a comparable /MCLR pin will show similar behavior.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • william chanwilliam chan Posts: 1,326
    edited 2008-11-06 20:32
    Beau,

    The snubber circuit of Q3 and Q5 does not stay "on" because the 12v line is actually only 10v due to use of the 10v zener. ( eagle don't have a 10v power symbol ).

    I want to ask your opinion about the suggested "reverse biased diode across the C-E junction".
    Wouldn't negative spikes likely be eaten up by C5 470uf even without such a diode?
    Is it possible for a spike to be much faster than the response of the capacitor? ( i doubt it )
    If a spike is so powerful that it could reverse the charge of C5, a reverse biased diode would also be unable to prevent a restart due to brown-out right?

    Chris,

    I am not having "strange issues", meaning these problems are expected at design stage, that's why I added the snubber circuit.
    Any micro placed next to a flourescent lamp will always experience "strange issues" in that sense.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my

    Post Edited (william chan) : 11/7/2008 7:14:02 AM GMT
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2008-11-06 20:43
    I think you missed the point Chris was trying to make. You have left off the pull-up resistor on the /MCLR line and it has been stated by several people that this may not be a good idea and may cause the chip to misbehave. I would try adding that just to see if it helps clear up the issue. You are in your prototyping stage, correct? If you add that and it gets better then try to find a way to add that part. Using a surface mount resistor 0603 barely takes up any space on the PCB and there has to be a way to squeeze one on there. I've hand soldered them (it is a bit tricky) to a board where someone wouldn't expect to be able to fit more parts on. It sounds like you're adding a lot of other items that may or may not be needed and may be missing a potential problem with your board.

    Robert
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-11-06 20:54
    william chan,

    "Wouldn't negative spikes like be eaten up by C5 470uf? Is it possible for a spike to be much faster than the response of the capacitor? ( i doubt it )"
    This design was derived from an ESD protection device common in IC's where the capacitor is usually·small.· Your same analogy with reference to C5 can also be applied to a positive pulse, but in either case what if the capacitor is discharged?
    ·
    "The snubber circuit of Q3 and Q5 does not stay "on" because the 12v line is actually only 10v due to use of the 10v zener." --- The D1 zener isn't necessary.
    ·
    ·





    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • william chanwilliam chan Posts: 1,326
    edited 2008-11-06 21:14
    The D1 zener is required because in an event D2 fails, the snubber (with D1) would take over D2's job of preventing all the 16v capacitors from exploding.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my
  • Macgman2000Macgman2000 Posts: 59
    edited 2008-11-07 02:50
    Hello William,

    Have you tried any of the suggestions offered above? What were the results? Can you move the board out of the light fixture? Did that solve the problem?

    I am asking a bunch of questions because at some point you need to pick a direction to try and go through the growing pains of eliminating one possibility after another.

    Nick
  • william chanwilliam chan Posts: 1,326
    edited 2008-11-07 03:18
    Nick,

    I am placing the board outside but beside the lamp now, but the problem persists.
    Today I am going to add a AC 250v MOV at the incoming power inputs and test for a few days.

    Beau,

    "what if the capacitor is discharged?"
    If the capacitor can be fully discharged by the spike, that may mean we need to block the spike earlier before it gets to the capacitor right? That's why I am trying the MOV now.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-11-07 05:50
    william chan,
    ·
    "If the capacitor can be fully discharged by the spike, that may mean we need to block the spike earlier before it gets to the capacitor right? That's why I am trying the MOV now." -- Not by a spike, remember I said that this circuit is designed for ESD events.. if the unit is "off" but still plugged in to the mains, the capacitor could be in a discharged state.· In this situation the circuit would attempt to quench an incoming voltage spike.
    ·
    William, clearly there is a noise problem with your circuit design, and·it should be diagnosed·with a systematic approach.· Each sub-circuit should be looked at section by section to determine where the failure is or where it may be vulnerable.
    ·
    We are here to help, but we also need to know what avenues you have tried so far and what the result was.
    ·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • william chanwilliam chan Posts: 1,326
    edited 2008-11-07 08:58
    Here's some pictures of the prototype.
    The product is supposed to switch on the lamp when humans are nearby (detected by the PIR sensor)
    and switch off after 5 mins if nobody is nearby.

    It seems to be more stable now, but still too early to tell. ( needs at least 5 days testing )

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my
    896 x 572 - 38K
    915 x 568 - 40K
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-11-07 15:16
    william chan,

    Cool idea!

    I know for aesthetic reasons you probably don't want to use a metal box, but if you line the inside walls of the box with 2 inch wide Aluminum tape (found in most hardware stores in the air-conditioning duct section) and allow the VSS connection to make contact with it you'll most likely see a noticeable improvement.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-11-07 16:23
    william chan said...(trimmed)
    Chris,
    I am not having "strange issues", meaning these problems are expected at design stage, that's why I added the snubber circuit.
    Any micro placed next to a flourescent lamp will always experience "strange issues" in that sense.
    William, I'm sorry I thought you were having issues and looking for help.· The point at which I have to decide what more I can offer is when I offer important advice that is dismissed as not relevant.· Regardless of whether or not tying /MCLR high is the cause of your problems, it is a potential problem in and of itself.· The fact is you aren't sure if it is a problem since you have not eliminated it as such.· I hope you get your problem solved but I am the type of individual who eliminates the obvious issues first and then stops to see what might still remain.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Engineering
  • william chanwilliam chan Posts: 1,326
    edited 2008-11-07 22:33
    Chris,

    Previously I had a discussion thread on this topic (10k resistor on /MCLR) with PJ Allen, Guenther and others and nobody mentioned any potential start-up problems.
    Additionally, I had designed many SX projects without the 10k resistor and did not notice any startup problems.
    Could it be because the SX28 already has a built-in 28ms startup delay circuit?

    But that does not mean that I take your caution lightly.
    Like you said, the problems need to be eliminated one by one, I just happen to add suggestions one by one instead removing them one by one.

    Each precaution may take about 5 days of testing, because if the re-start rate is now 5%, it would take 20 switch-ons of the lamp to notice one re-start.

    Also please note that the processor is currently not having start-up problems, it is having re-start and haywire problems when the lamp is switched by the relay.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my

    Post Edited (william chan) : 11/7/2008 10:58:35 PM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-11-07 23:45
    william chan,

    I wonder if it's the PIR sensor itself in combination with the fluorescent light... just for kicks try it with a regular incandescent lamp and see if you are still having problems.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • william chanwilliam chan Posts: 1,326
    edited 2008-11-08 01:00
    Good idea Beau,

    I'll make a few more prototype units to test this out.
    I am currently suspecting that the culprit spikes come from the 4 wires going into the lamp housing.
    If it is, maybe the aluminum shield would not help much.

    You want one? It will be faster if more people test it out.
    The speaker will give warning sounds before switching off the lamp.
    I wonder if it will work at 110v 60Hz.
    The supply current might be reduced to about 70mA, but should still be sufficient.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my

    Post Edited (william chan) : 11/8/2008 1:20:57 AM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-11-08 01:18
    william chan,

    "You want one? I wonder if it will work at 110v 60Hz." - I'll test it at 110v 60Hz if you like... PM me.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • william chanwilliam chan Posts: 1,326
    edited 2008-11-08 01:24
    Ok, PM me your address and I'll send you one by DHL next week.

    But you supply your own Parallax PIR sensor. smile.gif
    ( just plug in to the header sockets, no need to solder. )

    I forgot to tell you that you can also use a TV remote to manually switch on and off the light from far.
    I'll send the remote controller as well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.fd.com.my
    www.mercedes.com.my
Sign In or Register to comment.