# Fixing noise spikes caused by AC switching

1. Jun 21, 2012

### pelesl

I have a situation where I see spikes (with ringing) on the output of DC power supplies whenever something AC powered is switched in the room. The spikes change in magnitude; they can be as bad as 3 volts peak-to-peak; I suspect they change "randomly" because they are related to when the device is switched (relative to the 60Hz cycle) but I don't want to put words in anyone's mouth. The ringing after the spike can be several cycles and seems to be on the order of 10 to 20 MHz. Currently this spike is interfering with a differential to single-ended driver I use to feed an encoder into an acquisition card on a PC, causing the card to count false pulses thus making the encoder useless. I have a 1uF metal film capacitor as a bypass capacitor on the single-ended driver chip. I don't want to go into the details here because I can reproduce the problem with a very simple test.

Power supply A is a 12VDC switching power supply with a 5VDC regulator to create a 5/12 output power supply (not my idea). This one is plugged directly into AC.

Power supply B is a linear power supply outputting 5VDC (a Power-One HN5-9/OVP-AG). This one is plugged into AC via a Lambda MAW-1205-22 EMI filter.

Both of these are properly enclosed and grounded. Power supply A has a vented box with maybe a 1/2" by 1/4" diamond mesh on one side. Power supply B is in a solid Hoffman box with no holes.

My "test" circuit is a 100 Ohm resistor connected to 5VDC (either power supply gives the same results). Looking at the voltage across the resistor on a scope, i can see the spike and ringing clearly. Adding a 0.01 uF metal film capacitor across the resistor seems to make the ringing last longer. No combination of capacitors I have (all metal film, up to 1 uF) seem to improve the situation, though I can clearly see the bypassing effect because they will really clean up the voltage from the 5VDC regulator in power supply A. I cause the spike by switching anything AC, even if it's not on the same electrical circuit. I was doing it with one of those AC-powered breadboarding kits, but I also did it with one of those under-cabinet fluorescent lights and, most importantly, a 120VAC relay which has to be switched while the encoder is monitored (thus the problem).

Having bought some Red Lion RC Snubbers (SNUB0000) along with the EMI filters, I tried connecting them across the switches in the relay in question. It's a double pole relay so I added snubbers between each common and the three of the four switching contacts that are connected to something. This made no difference on the spike in my test circuit generated by my switching the relay.

Someone suggested using zero-crossing triac switches, but clearly if every AC device causes the problem then my only choice is somehow impeding the effect from going into the DC outputs.

For some background: I have never solved a noise problem in my life. I've seen people wrap things in foil and do other such crazy things, but I've never met anyone that could explain the sources of noise and how you filter it. People seem to always wave their hands about but never have I been able to find some practical guidelines on what to try and why. Besides this one I have three other serious noise problems that I don't want to discuss yet so as to not dilute this. So, that being said,

1. Where is this noise coming from? How can it go "through" the power supplies (both switching and linear) and end up on the DC side? Does this necessarily mean it's going through the air?
2. How do I fix it?
3. Can anyone recommend a good "field" book that is not necessarily full of complex integrals but isn't just a flow chart with part numbers either?

2. Jun 21, 2012

### Staff: Mentor

Welcome to the PF.

You will get lots of good help here with this problem. It would help us if you could do two experiments and let us know the results. First, take your scope probe that you are monitoring the resistor with (probe on the top of the resistor and ground clip on the bottom), and move the probe tip to the bottom of the resistor, so that it is connected to its own ground clip. Do you still see any spikes when you do the AC switching? If so, then at least some of the spike amplitude your are seeing is coming from the electrical connection of the scope itself. If you have a battery-powered scope, that should not have this issue.

The second experiment would be to run your circuit off of a battery, to be sure that there are no other coupling mechanisms (like ground bounces, etc.). If it runs fine off of a battery voltage source, then you are assured that with enough filtering and grounding in your power supply, you can come up with a solution.

Oh, maybe a 3rd experiment -- use one of the small AC Mains circuit testers to verify that the AC wiring doesn't have a problem. You may have one already, or they are about $10 at the hardware store. They plug directly into the 3-prong outlet, and use lights to show if there is an issue with the wiring. 3. Jun 22, 2012 ### pelesl Thanks for the warm welcome. And thanks to smartphones.... I was able to perform the tests you suggested and capture waveforms. Some background: this is in a 700 horsepower wind tunnel at a university. This giant 3-phase motor (run off a giant VFD) was running at the time I did the tests today. Presumably all the electrical wiring was done by professionals. It's typical here to see a strip of outlets on the wall where each outlet is a different circuit (but the wires are all running inside the same "box" parallel to each other). The instrumentation wiring is questionable at times. I honestly wish I could rip all of it out and start over, but no one will pay me to do that. What I did today was again with my 100-Ohm "test circuit" of just a resistor. It's on a solderless breadboard. I used power supply A (the switching one with a 5V regulator). To give you an idea; the 5V "DC" has a ripple of 500 mV or so. This ripple goes away pretty easily with a typical bypass capacitor type of topology. I'm not using an oscilloscope probe; I'm using a BNC cable with clip leads on the end. To generate the spikes today, I switched on one of these ready-from-the-box under-cabinet fluorescent fixtures. You get a spike for each flicker of the bulb. The spikes vary from instance to instance but most are as bad as you see here. In the following tests I tried to keep the scale the same but towards the end I changed it to see just how bad it really gets. The scope channel was set to AC coupling. Time scale is always 250 ns/division; the frequency measurement is often off but you can go off the time scale. Test 1: Across the resistor. This is the test I posted about yesterday. Test 2: Probe shorted (both clips on same side of resistor). This seems to "clean up" the ringing. #### Attached Files: • ###### across resistor (Small).jpg File size: 56.3 KB Views: 1,341 • ###### probe shorted (Small).jpg File size: 54.7 KB Views: 1,345 4. Jun 22, 2012 ### pelesl Then I plugged the oscilloscope into the outlet through an adapter from which I cut the ground leg off. So the oscilloscope is no longer connected to earth ground. Test 3/4: Scope ungrounded, first across the resistor and then probe shorted. #### Attached Files: • ###### across resistor scope ungrounded (Small).jpg File size: 54.7 KB Views: 1,385 • ###### probe shorted scope ungrounded (Small).jpg File size: 50.3 KB Views: 1,354 5. Jun 22, 2012 ### pelesl Then I disconnected the resistor from the DC supply and connected it to a single D-cell battery. Test 5/6: Battery powered resistor circuit, scope ungrounded, first across resistor then probe shorted. #### Attached Files: • ###### battery powered across resistor scope ungrounded (Small).jpg File size: 49.7 KB Views: 1,359 • ###### battery powered probe shorted scope ungrounded (Small).jpg File size: 52.3 KB Views: 1,370 6. Jun 22, 2012 ### pelesl Then just to be sure the solderless breadboard wasn't the issue, I pulled the resistor off the breadboard. Still battery powered. Test 7: Battery powered resistor circuit, scope ungrounded, across the resistor, disconnected from the breadboard. #### Attached Files: • ###### battery powered across resistor scope ungrounded off breadboard (Small).jpg File size: 51.3 KB Views: 1,378 7. Jun 22, 2012 ### pelesl So from my point of view, the tests show the following: 1. The DC supply is affected by the phenomenon. There is a consistent difference between measurements across the resistor when powered by the DC supply and everything else. 2. The high frequency ringing seems to be traveling through the air since it happens with the probe shorted, with our without grounding the scope, and when the resistor is powered by a battery. Unless it could be coming in through hot or neutral and affecting the scope? I'm hesitant to say anything because I don't know what I'm talking about. 8. Jun 22, 2012 ### pelesl Test 8: ran the Oscilloscope from a UPS batter (so there was no physical connection to room wiring). Without the BNC cable attached I got nothing. With the cable attached and shorted at the clip leads I got this: #### Attached Files: • ###### probe shorted scope on UPS (Small).jpg File size: 48.7 KB Views: 1,366 9. Jul 2, 2012 ### pelesl An update: I've tried with an actual oscilloscope probe and the waveforms are a bit different but the problem is still there (not to mention I can see the effect in an encoder's output whether there are oscilloscopes involved or not). I've also tried using zeners and diodes in my resistor test circuit just to see if I could somehow alter the waveform and I can't. No one can help? 10. Jul 2, 2012 ### es1 You mention Supply A is a 12V/5V switching type power supply powered from the mains, but is this supply not isolated? Or maybe the secondary side is references to earth via a third prong (assuming you are in the US). I am having a hard time drawing what the grounding map of your setup looks like in my head. Are you sure you don't have a ground loop in your setup? Make sure to include the scope in the map. 11. Jul 2, 2012 ### pelesl If by that you mean that it has an isolation transformer between its AC input and the line, the answer is no. I tried plugging it into an isolation transformer and the problem persists. By secondary do you mean that the DC output uses earth ground as the negative, or do you mean secondary winding on a transformer? Power supply B I wired myself and I can assure you it was done properly---shielded output cables grounded at the Hoffmann box, where everything else is grounded. Its output still sees these spikes. I'll have to double-check that none of the DC outputs reference earth ground. If there are any ground loops, then they'd be in the building wiring, because I'm just plugging things into outlets. So far I can guarantee you that the scope and power supplies are on different circuits (three phases come into this room) but I still see the problem with my resistor test circuit powered by a battery (and the scope powered by a UPS battery) so at least part of it cannot be related to ground loops---right? I will double check things and get back to you. 12. Jul 2, 2012 ### Carl Pugh You are desperate, so forget the oscilloscope. Is it possible to put a low pass filter in your single ended driver? Can you set the trip point of your comparator higher? Short the input to your single ended driver. Is the problem still there? Check your grounds. Drive a ground rod in the ground and check resistance of all grounds to ground rod. Some recommendations: Put sensitive equipment in metal chassis. Keep sensitive equipment as close together as possible. Keep connecting wires as short as possible. Don't run sensitive wires close to high power wires. Use only shielded wires for sensitive signals. Keep sensitive equipment as far as possible from high power equipment. Connect all sensitive equipment to the same 115 volt outlet. Put all sensitive equipment in a metal enclosure. 13. Jul 3, 2012 ### jim hardy A RC snubber across the switch contacts didn't help ? I do note the Red Lion datasheet http://www.alliedelec.com/search/productdetail.aspx?SKU=70030263#tab=specs click on "datasheet" shows that as "alternate application", and preferred is to place it across the load. Try your snubber at the device being powered instead of at the relay. The approach there is to minimize the distance those "ringing" currents flow, effectively shortening their antenna.. i think that's why Red Lion showed that as preferred. "Grounding and shielding techniques in instrumentation" by Ralph Morrison helped me back in the 1990's. The book was considerably less expensive then. I see he has more books out now. https://www.amazon.com/Ralph-Morrison/e/B001IXN0HS/ref=ntt_dp_epwbk_0 good luck old jim 14. Jul 3, 2012 ### pelesl I think I can try this on the fluorescent light I was testing with. I'll let you know what I see. I always go to http://www.abebooks.com/ for books. If you don't care about the edition you can get it for as low as$2. I bought one for \$17 (shipping included) from London (usually arrives before books shipped within the US).

15. Jul 3, 2012

### pelesl

Here are some more tests that I did last week.

First, I compared an oscilloscope probe to the BNC cable I had. The probe certainly sees a very different thing---primarily, much lower voltage spikes. Here are the traces with the probes shorted. The TEK probe is on channel 2.

#### Attached Files:

File size:
55.5 KB
Views:
1,317
• ###### tek probe (Small).jpg
File size:
47.3 KB
Views:
1,286
16. Jul 3, 2012

### pelesl

Here are the traces with the probe and cable connected across a resistor (both channels on the same resistor at the same time), the resistor unpowered.

#### Attached Files:

File size:
54 KB
Views:
1,296
• ###### resistor on linear supply (Small).jpg
File size:
53.9 KB
Views:
1,292
17. Jul 3, 2012

### pelesl

Then I put a diode in front of the resistor, so current could only flow into it, but not "back into the supply". I would have expected to see an asymmetrically clipped ringing, but I don't:

So I think everything points to this problem being transmitted by air and not by the supply:

1. With the BNC shorted to itself, and the probe shorted to itself, there's a clear difference in the frequency of the waveform (the frequency on the shorted probe is much higher).
2. Once I start testing with the resistor, I'm now connecting the BNC cable to the oscilloscope probe, so the waveforms become the same, except for the decreased magnitude in the probe. The probe is 10X and even if I forgot to set the scope, the difference is not a factor of 10X so the change in magnitude is real.
3. If this ringing was coming in through the power supply wires, the diode should have clipped it, and it doesn't. So it must be coming in via the BNC cable. This also goes along with the fact that I could see it even when the resistor was powered by a battery and the oscilloscope was on a UPS battery (unplugged from the wall).

Of course if this is an EMI/RFI thing that can be fixed by proper shielding, then why is this room so bad? If this were happening all over the building it would be a well known problem because no one shield anything properly here. Is it possible that the amount of rebar in the wall, for example, can affect this?

The only AC switching that doesn't cause this are things like HP benchtop multimeters. Everything else does. So did I just get lucky that there's something in the electrical wiring of the room that's resonating? If so, it must be in the ground or neutral because every circuit behaves the same.

I will start by making sure the single ended driver of the encoder is properly shielded. I haven't tried an RC filter on the output and I cannot change the "trigger voltage" of the counter; the only thing I have an option of doing with the hardware (National Instruments acquisition card) is to apply a debouncing filter, but only at the highest setting (longest minimum pulse width) does it filter out the problem and at that point we can go below this minimum width during operation of the encoder (the encoder turns fast enough that the debounce ignores real pulses) so it's not a solution.

#### Attached Files:

• ###### diode on resistor (Small).jpg
File size:
53.8 KB
Views:
1,796
18. Jul 3, 2012

### es1

Can you draw a circuit of your test setup that includes grounds in the wall?

If I understand your posts correctly the scope shots are a differential voltage across a 100 ohm resistor. To get 0.4Vpp on the resistor over the air something has to be injecting 4mA into your circuit. I find this extremely unlikely.

I think it is much more likely a reference is moving somewhere due to a ground loop. But if the scope shots are differential then there would have to be some kind of non-zero common mode gain to see those shots which is also kind of odd but possible at a couple of MHz.

In short. I am pretty confused, as I suspect others are, and I think a high level schematic of the test setup would go a long way toward clarifying things.

19. Jul 3, 2012

### es1

This could also be a probing error.

For example, see figure 1-9, figure 6-5, and figure 6-10 in the publication below. These are various ways the probe ground can pick up noise in circuit. As the probe is AC coupled in the shots its hard to know which is applicable. Also notice in figure 6-10, the noise is transmitted over the air into the loop which includes the ground probe.

http://www.cbtricks.com/miscellaneous/tech_publications/scope/abcs_of_probes.pdf

20. Jul 3, 2012

### jim hardy

that fig 6.5 is worth a thousand words.

I have been searching for words to express this thought -

Electricians sometimes get creative when wiring a room. If the line and neutral to an outlet get run physically apart from one another, that creates a loop. So long as they're run together in the same "romex" or same conduit the area of the loop is quite small, but if they're separated they make a loop antenna that 'broadcasts' in accordance with whatever current is running around it. At 60 hz not much energy goes into the air, but a small antenna works better at higher frequencies.

I don't know quite how to check for this without getting inside the walls...
but here's some thouhts -

a lamp dimmer is quite a noisy thing, electrically. A plain incandescent lamp from thrift store, powered through a lamp dimmer, will generate electrical noise. A cheap transistor radio set to AM band in between stations will give you an idea how much of that noise makes it into the air.

I'd try that lamp dimmer-radio test at several outlets around the troublesome room and again in one of the well behaved rooms.
If a striking difference jumps out at you, maybe that's a thought path to look into. If not you will have wasted an hour or two.

I used to wander around the power plant looking for fields with a loop , ten turns on 1/10 square meter area (14 inch diameter), connected to a battery powered scope. If your dimmer/radio finds something worth pursuing, that simple experiment would let you put a number on it.

you have my sympathy on this one, bro !