DIY Mains Voltage Differential Probe for SMPS design - Page 1
Forum section: electronics / projects

author: acedogblast
author_rank: Contributor
timestamp: July 07, 2023, 09:26:04 pm
content: Hello everyone I have been planning to start designing my own Switch Mode Power Supplies for future projects. I recently acquired a new digital oscilloscope (which I put off for far too long) and learned that using a differential probe is necessary to safely probe the primary (line voltage) side of SMPS. While there are some relativity affordable differential probes made by micsig I wanted to take any opportunity to DIY stuff myself for learning when possible and practical.I have been researching around and made my design which is heavily based of a differential probe by Bud Bennett and Paul Versteeg (https://hackaday.io/project/169390-a-10x-100mhz-differential-probe/details) with some modifications to better suit my goals.These are the specs I am targeting:Peak to peak input voltage (without clipping) 350 V or more.Common voltage isolation of 350V or more.Greater than 10 MHz Bandwidth. This should be more than enough for SMPSPowered through USB-C 5V.Safety banana connector leads for input.BNC output to scope.PCB must fit in this case off amazon (https://www.amazon.com/dp/B07W78LN1V?psc=1&ref=ppx_yo2ov_dt_b_product_details).The changes to the design by Bud and Paul to meet these goals are the following:Change the R_gain resistor to 7.84K ohms to achieve a 100X attenuation. This is done with 2 separate 3.92K in series. I can remove one of them and bridge the second to get 67X attenuation if needed.Added USB-C connector with 2 5.1K resistors to CC1 and CC2 to GND.Switch some misc parts to use what I already have.The schematic and PCB layout are attached.I have 2 questions before I send these off to the pcb house latter this weekend:1. I noticed on some attenuation design that the resistors and capacitors are "fully" interconnected between each other (like in this project:https://resources.altium.com/p/differential-oscilloscope-probe-project) where as some designs such as mine the only connected together at the beginning and end. Does this matter?2. Again this is probe is designed for the purpose of safely probing US mains (120vms 340vpp) with caution to test SMPS new and existing designs. Are the specs and design appropriate for this?Any tips and suggestions are welcome. Especially on the PCB layout. I do plan to open-source this design if it ends up working well.

author: Alti
author_rank: Frequent Contributor
timestamp: July 07, 2023, 10:34:33 pm
content: Hi. I would recommend at least to try to understand requirements of how a commercial version of such probe must be built.I do not know UL rules.NorIEC 62368-1, well first thing to note is that an equipment must have not only nominal rated voltage but also overvoltage category defined. If you take a look at your new scope, for sure you can read CAT I or CAT II label or sth like that and a user must not use it anywhere above that rating. If you want to play with mains SMPS then I guess CAT I is out of the question - diff probes are/should be CAT II or maybe even CAT III to avoid stringent CAT I requirements. Based on that - a transient voltage is calculated. A ton of rules later you can figure out what surge test this thing must survive. I won't give you data for 120V but I remember for 230V project this was like 3300Vrms test (nearly 5kVpp) just for CAT II equipment (don't quote me here). This dude from the link is designing a 1200Vrms probe by connecting 5 resistors rated 300V, well good luck with that. For capacitors - only class Y certified capacitors can bridge primary/secondary. If you want to use raw capacitors, you need to rate them adequately and perform 100% production testing and the norm defines how to do this test.Then come various PCB clearance and creepage rules (for layout), pollution degree, dielectric strength, and rules that dictate that series resistors clearance and creepage is defined with (any) one resistor shorted. Not sure about capacitors.I guess such probe requires reinforced insulation as secondary is just a dangling scope probe with zero protection against direct touch. Then, there is a leakage current limit in between primary and secondary, I think 0.5mA rms but again - do not quote me.In a nutshell.So, of course you can do as you wish but I think cutting corners must have its place and HV probe does not look like the best place for cutting corners.

author: David Hess
author_rank: Super Contributor
timestamp: July 08, 2023, 12:59:30 am
content: Quote from: acedogblast on July 07, 2023, 09:26:04 pmHaving the resistor divider fully connected with the capacitive divider makes sure that the voltages across the resistors are balanced. Otherwise unequal voltages during high slew rate events may cause a single resistor to breakdown from high voltage.QuoteThat will depend almost entirely on the high voltage divider and its construction. The capacitors and resistors need to have a voltage rating high enough to prevent breakdown under adverse conditions.The layout of the high voltage divider should be made as symmetrical as possible to equalize common mode capacitance to both sides.I would use a different kind of difference amplifier and voltage followers instead of the differential amplifier, but their circuit obviously works.

author: dobsonr741
author_rank: Frequent Contributor
timestamp: July 08, 2023, 01:31:31 am
content: Unrelated to building the diff probe, but I would recommend an isolation transformer on the bench.The rail splitter opamp might not be stable with this huge capacitive load. TLE2426 is a safer bet for precision application.There are quite a few implementation of this probe. I remember one that was unstable, and GND fill had to be removed under the opamp.

author: acedogblast
author_rank: Contributor
timestamp: July 08, 2023, 03:24:59 am
content: Found and fixed a mistake. U3 Op-amp has the wrong inputs switched. I also added the interconnects to the resistor attenuation circuit as suggested. Thanks for all of your feedback.

author: schmitt trigger
author_rank: Super Contributor
timestamp: July 08, 2023, 03:26:16 am
content: Wouldn’t it be better to power the unit from 4 center tapped AAA batteries, and that way the supply is completely floating?One less ground loop to worry about, and you don’t need the ground splitter.Just saying…. Don’t crucify me for the suggestion.

author: jonpaul
author_rank: Super Contributor
timestamp: July 08, 2023, 06:28:42 am
content: Bonjour just saw this now....Been a power electronic EE since 50 yrs, this problem is easy to solve and the diff probe proposed is complex and prone to failure.1/ Depending on your location, the mains will have a 120/240V nominal RMS and max perhaps 10..15% higher. Commpnly mains transients can be 1.5...15 kV for some uS due to lightning, inductive transients, etc.Thus professional mains rated probes have IEC 610004 level 2..3 ratings.Your design will not survive such HV transients.2/ Very dangerous to connect such a diff probe to any computer or USB power, the CM noise of HV transients can damage the PC/MAC/USB power. Use batteries or a UL/CE rated mains suppluy (wall tranformer)3/ In decades of research, design and debugging of SMPS, EBU, HV up to 75 kV and 12 kW we never needed a maisn rated diff probe.Just a few tips from a very old retired EEBon Chance,Jon

author: moffy
author_rank: Super Contributor
timestamp: July 08, 2023, 06:54:04 am
content: Quote from: jonpaul on July 08, 2023, 06:28:42 amI must agree with Jonpaul, in the late 80's purchased a BWD881 with four mains rated differential inputs to work on some 250kW supplies I was designing, never used the differential inputs once in anger. Seems such a shame but never needed it.

author: Alti
author_rank: Frequent Contributor
timestamp: July 08, 2023, 10:21:50 am
content: Quote from: jonpaul on July 08, 2023, 06:28:42 amThen how did you verify the switching parameters comply with requirements? Or was it a design only based on simulation and "worked" so testing was not necessary? Due to small inductances used, SMPS driving signals require tens of kHz range signals and MHz bandwidths. Of course one can circumvent whole HV diff problem, supply that through isolation transformer and earth DUT at certain point during tests but that is quite limiting with more complex converters. More like a hack.

author: acedogblast
author_rank: Contributor
timestamp: July 08, 2023, 02:55:58 pm
content: Hello jonpaul I appreciate your feedback but I am not sure how this design can be damaging to any USB power supply. High voltage transients should be taken care of though the 1.5 mm spark gaps which sends them to earth ground through the scope's BNC connections. This should be fine since such transients occur in very short duration. A quick google search tells me around 50 microseconds.I also do not see how using USB power from any 5V source could be damaging to the power source. The USB connector does not connect to any data pins only the power related pins so any IC's shouldn't be damaged.I am also unsure of how one would be able to examine the switching of the mosfets on SMPS and their reactance/effect on the mains voltage input without damaging their scope? A differential probe would have to be necessary for this no? If not what are HV differential probes are used for then?

author: dobsonr741
author_rank: Frequent Contributor
timestamp: July 08, 2023, 08:51:58 pm
content: If you have an isolation transformer you can use the common on the primary side as ground for the scope. I would ground the common first, then connect the scope, making sure….IMO the diff probe is solving the concern of the primary common not the same as neutral and can not be connected to the scope’s GND.The diff probe might have a hard time with the huge common mode load, including the deteriorating CMRR at higher frequencies, unless it’s an expensive commercial probe with guaranteed specs. The DIY probe would not automatically meet that.

author: David Hess
author_rank: Super Contributor
timestamp: July 09, 2023, 12:40:51 am
content: Quote from: dobsonr741 on July 08, 2023, 08:51:58 pmI think people underestimate how difficult the common mode rejection problem is for a high voltage differential probe. Luckily it is easy to test by connecting both inputs together at the high voltage source and observing what is displayed. Calibration however can be difficult and this probe design has only a very minimum of adjustment for this.

author: alm
author_rank: Super Contributor
timestamp: July 09, 2023, 07:41:26 am
content: Quote from: dobsonr741 on July 08, 2023, 08:51:58 pmI wouldn't connect something that is at the level as the neutral to the scope's ground either. Best case it might trip a GFI, or it might lead to large currents flowing through the ground lead, or in some AC power systems there might not even be a neutral and what you think is neutral is live and half the mains voltage.

author: acedogblast
author_rank: Contributor
timestamp: July 15, 2023, 05:32:07 pm
content: I received the PCBs and have assembled a prototype. After testing and some changed parts the end result is that it works... partially.First problem was that the output has an oscillating noise when nothing is connected to the probe. This is caused by U1 in an unstable gain (See first screenshot). The LTC6269-10 documentation said that the op amp is stable at gains >= 10. So I had to change the gain resistors to two 416 ohm resistors in series to set the gain at 10.5. This of course will set the clipping limit of the probes input well below the target goal of 350Vpp but will significantly reduce the oscillation noise.One thing I was not sure of was the resistor in series with the output of the probe. From what I understood it is best to match the input impedance of by scope which was 1 Megaohm instead of the original design to set the output impedance to 50 ohm. I designed the pcb to be able to test both setups. With the 1 Megaohm resistor the waveform with the scope does look like it is over compensated (see second screenshot). Adjusting the pots and variable resistors does not seem to change the waveform. Switching to the 50 ohm resistor the waveform looks under compensated (see third screenshot). Adding 4 0.1 uF ceramic capacitors does help better match the waveform to the reference square wave of the scope's calibration port.Aside from these issues the probe does work and I can measure the mains live voltage with clipping. See screenshot 4.I have learned quite a bit from this project even if I did not meet the design goals. I think if I where to redo this project (which I might) I should try to use some integrated instrumentation op amps like an INA849 which can have a higher clipping limit but at the cost of a lower bandwith which is still enough for smps.I would like to hear your suggestions on this probe if the compensation can be improved to get a sharper edge responce.