Squelching power line noise - Page 1
Forum section: electronics / projects

author: rea5245
author_rank: Frequent Contributor
timestamp: October 14, 2012, 06:31:10 pm
content: Hi,At my workbench, I have a fluorescent lamp. When I turn it on, my microcontroller-based project resets. The lamp and microcontroller power supply are plugged into the same power strip, and the microcontroller's power is coming from a (admittedly cheap) Mastech power supply set to 9V, then through a 7805 with the recommended capacitors on it.Looking at it with an oscilloscope, I see that when I turn on the lamp, the power supply's output oscillates at ~20MHz, with the initial dip going down to 2V.I've tried adding different combinations of small capacitors (1 nF, 10 nF), and I can change the frequency of the noise, but the amplitude seems stubborn: it's always dropping down low enough that the uC resets. I added a larger capacitor (220 uF) in hopes of maintaining a steady voltage, but that didn't help.Do I just need to keep adding capacitors to address every frequency component, or is there a better way?Thanks,Bob

author: SeanB
author_rank: Super Contributor
timestamp: October 14, 2012, 06:36:11 pm
content: Plug the lamp into an extension cord and then into another wall outlet. Grab a large ferrite core ( old deflection yokes from CRT guns are great as you can fit a lot of wire in the hole and epoxy it together afterwards) and wind as many turns of the lamp extension cord as you can on it, to make a toroidal common mode choke. This should help, if not the you need either a new PSU ( or you want to fix it anyway) or a new lamp ballast.

author: rea5245
author_rank: Frequent Contributor
timestamp: October 14, 2012, 06:51:30 pm
content: Gee, it's already a brand new PSU. Maybe it's just that it's cheap (a Mastech HY 1803DL).It sounds as if you're saying it's not important to make the uC project impervious to this sort of thing. If so, you may be right. This is the sous vide project you advised me about earlier (thank you again), so it won't normally be operating near my workbench light.This did, however, inspire me to modify the software to make it recover from failures better.- Bob

author: saturation
author_rank: Super Contributor
timestamp: October 14, 2012, 07:25:28 pm
content: I would second SeanB's suggestion. Is your PSU like this one? The one below is not well made.https://www.eevblog.com/forum/product-reviews-photos-and-discussion/mastech-hy1803dl-power-supply-fail-!!!!!/Note, the above link has trouble redirecting, you'll have to cut and paste it into your browser, the "!!" are confusing some browsers.

author: SeanB
author_rank: Super Contributor
timestamp: October 14, 2012, 08:24:29 pm
content: Making it insensitive will work for this project, but the cause is still there and needs fixing. The PSU you are using is suspect, look at this thread for info and repair tips...OK, Saturation got there first.................

author: rea5245
author_rank: Frequent Contributor
timestamp: October 14, 2012, 11:45:04 pm
content: Well, that thread about my PSU is certainly disconcerting. I opened mine up and I saw some sloppy positioning of the high wattage components. Is that so they have air circulating around them? Regardless, it doesn't give me warm fuzzy feelings.Still, I don't have the problem the other fellow complained about (at least not yet). I certainly don't claim to be an expert in analog electronics, but propagating high frequency noise from the power line to the PSU output strikes me as a design problem more than an assembly problem.I have an old HP 6205B power supply. Maybe I should try that and see if a (presumably) high quality instrument shows the same problem.

author: rea5245
author_rank: Frequent Contributor
timestamp: October 14, 2012, 11:47:40 pm
content: SeanB, the question remains: how do I make it insensitive? Just keep adding capacitors with different values?

author: SeanB
author_rank: Super Contributor
timestamp: October 15, 2012, 05:01:00 am
content: LC sections on the input lines, and a RC power filter will help. 1000uF will do as the part after the resistor.

author: AndyC_772
author_rank: Super Contributor
timestamp: October 15, 2012, 06:14:31 am
content: What's the nature of your project's construction? Is it on a PCB? Stripboard? Breadboard?If you have 20 MHz noise coming in from the power supply, you need to provide a filter which is effective at this frequency. This can be surprisingly difficult because of parasitic inductance. A 1000uF electrolytic cap won't help.How are you probing the circuit to determine that the noise is there? It would be helpful to see a photo of your project with the probe attached.It also sounds from what you say as though the problem isn't actually the continuous noise, but that the dc supply suffers a brown-out when the light switches on. If this is the case then a large electrolytic across it may help; can you trigger your scope on this to give an idea of the depth and duration?

author: jahonen
author_rank: Super Contributor
timestamp: October 15, 2012, 10:24:30 am
content: Is MCU reset pin connection robust enough against external noise? Try putting a robust pull-up and capacitor there and see if the problem goes away.I'm almost sure that the noise you are seeing is directly coupled on the scope, and thus it is not physically realistic. Also, the frequency you are seeing supports this. You can verify this by connecting scope probe tip and ground into same wire (thus shorted but connected to either wire). If you still see a spike, it is a measurement artifact and not real.Regards,Janne

author: rea5245
author_rank: Frequent Contributor
timestamp: October 15, 2012, 11:42:56 pm
content: AndyC: The project is on a solderless breadboard. I probe the pins on the 7805: either the Vin or the Vout to see the effects on the two levels.Jahonen: connecting the scope's tip and ground to the same wire did indeed show a similar oscillation, though with a lower amplitude. But if the oscillation is not "realistic", why did it change when I added capacitors? This is definitely venturing beyond my areas of knowledge (which are mostly limited to "ideal" behavior of digital electronics).And I would suspect that my reset pin isnot"robust".I appreciate the advice and comments you have all offered, but at this point I'm inclined to drop it. The software recovers gracefully from a reset, and my kitchen is probably a less hostile environment than my workbench, so I'm hoping I'll be OK.Thank you.

author: David_AVD
author_rank: Super Contributor
timestamp: October 16, 2012, 12:15:09 am
content: Is the micro a PIC ? If so, do you have a pull-up resistor on the MCLR line? What value?

author: rea5245
author_rank: Frequent Contributor
timestamp: October 16, 2012, 12:23:40 am
content: It's an ARM from ST Micro. The -RESET pin has an internal pull-up on it, so I don't have anything connected to it.- Bob

author: jahonen
author_rank: Super Contributor
timestamp: October 16, 2012, 06:34:31 am
content: Welcome to the world of real-world with various EMC issuesBreadboard is probably the biggest reason why you have problems. I also suspect that you have the MCU on a breakout board, making things worse for noise immunity since signal loop area respect to reference (ground) increases and this makes the system considerably more sensitive to noise compared to the situation where the MCU would be located directly above contiguous ground plane.Internal pullup on the reset pin is not probably robust enough, try putting an external pull-up resistor there (try something between 1-10k), along with a capacitor (something like 1-100n) to the ground. Of course if the reset line is used by the debugger etc. then you might have to adjust the values, but those should work if there is nothing else there.Regards,Janne

author: AndyC_772
author_rank: Super Contributor
timestamp: October 16, 2012, 06:41:35 am
content: If your project is built on a breadboard, then I'm afraid you really don't have a hope of controlling oscillations as fast as 20 MHz. It's just not a construction technique that makes it possible; achieving effective filtering at that frequency requires short traces, a solid ground plane and proper placement of decoupling and filtering capacitors - and that means fabricating a PCB.However, from your description of the problem, I really don't think this noise is your problem at all. If it was, your microcontroller would be continuously resetting all the time the noise is there, and it wouldn't ever have time to recover. From what you say, it resets when the light is switched on and then starts working again, and that means the problem must be a 'one off' event caused when the light switches on.Try this: remove the ground lead from your scope probe, and instead, wrap a piece of tinned copper wire around the body of the probe so it makes contact with the grounded ring near the probe tip. Trim it so you have about 1cm or so of wire sticking out beyond the point where it makes contact with the probe. (Alternatively, your probe may have come with a short spring or ground spike for this purpose, in which case use that instead; the idea is to get rid of the long ground lead and instead pick up a ground connection right next to the probe tip).Now probe the power and ground pins of your microcontroller directly, so the ground spike touches the chip's GND pin (solder it in place if necessary) and the probe tip touches the supply pin. With the light on, you should see the 20 MHz noise dramatically reduced compared to anything you've seen while using the ground lead. Now you also have a chance of putting the scope in single shot mode and capturing the dropout in supply voltage when the light is switched on.You can use the same technique to probe the reset pin (it'll just do what the power pin does, virtually guaranteed), or any other CPU pin of interest. The important thing is to keep the ground wire absolutely as short as it can possibly be.If the problem does turn out to be a dropout in the voltage from your bench supply, a large capacitor across the output won't necessarily help if the bench supply actively sinks current during the dropout. Have you tried putting a diode in series with the bench supply's output to make sure current can only flow one way? A series diode plus a nice, big capacitor might be the fix you need.