The light switch I'm using is a dimmer, so that I can test the bulbs at varying brightness.
Be careful to only use that with dimmable lamps. Most dimmers don't turn on for the full cycle, even when turned to maximum. You can get enough high frequency energy to make a bulb with an RC supply melt.
Nor will a voltage divider, for that matter. I want my galvanic isolation! I'll settle for less precision in exchange for safety.
hmmm. what about mains->divider->ADC->SPI isolator->(maybe an MCU)->DAC?
hmm, the voltage transformer thing. Unless you can afford a proper instrument measurement transformer with all the required specs. That setup would continually do my head in, in trusting what it is showing. You have to adjust for phase, and high freq artifacts that your going to get from a dimmer, i'm assuming your going to want to notice those? no?
You don't need a differential probe, you need a high voltage oscilloscope probe, they are not
that expensive, and sounds like you ought to get one at least.
First point: why would you need to adjust for phase? And where did the dimmer come in?
Second: a high voltage probe will not isolate you from the mains. A differential probe will. It's two different things. Try not to kill people, please.
drama Queen much?
dimmer, LED driver, well whatever! But note these things are NOT mains isolated. Seems to me the OP wants to muck around with these things, that's already a dangerous idea in itself.
Oh I was negligent in not mentioning requirement to use mains isolation transformer.
I still treat it as danger, and limiting me from the near infinite energy from the powerpoint [even in the mSec before the RCD trips]
Does allow me to choose the common measurement point.
Oh, further point, a differential probe of itself doesn't isolate "You" from the mains, especially if your not aware of what your doing. Yes it gives your measuring instrument a galvanic isolated differential voltage between 2 points. But if one point is mains hot side, that still is mains if you inadvertently touch it.
...
Second: a high voltage probe will not isolate you from the mains.
Nor will a voltage divider, for that matter. I want my galvanic isolation! I'll settle for less precision in exchange for safety.
...
Whats with the tone of fixation on galvanic isolation? Its not a magic protection if you have trouble focusing with a task on hand. Maybe you should drop this project altogether?
Maybe he really just wants to characterize existing products without tearing their cases apart or measuring any internals. If that is the case, then it makes a lot of sense to build a decent completely galvanic isolated "measurement box" once and then using it will be perfectly safe.
That was my thought as well.
That is indeed my plan: no exposed mains voltage once it's in an enclosure, so that I can plug in the DUT and safely characterize its power usage with my oscilloscope.
Think of it like a glorified line splitter.
So far so good, I've done initial tests with the transformers using my DMM (BM257s) and oscilloscope and a 43W incandescent bulb as a load. At this point, I've used only the DMM to test mains voltage and current directly, using the scope only for low-voltage tests.
1.
Should I calculate the voltage divider for TR1 based on Vpeak or Vrms? Comparing TR1's voltage vs. DMM's measurement of the output mains voltage, I get somewhat different ratios for Vrms and Vpeak. (My DMM measured 163.4V peak, 121.3 Vrms.)
2.
Is there any way to compensate for the phase error introduced by TR1? I'm not surprised there's some delay, but the magnitude is surprising: roughly 270µs! My scope's deskew function only lets me enter values up to 100ns. How do high-voltage differential probes keep their delay down to the ns/ps range? Or does Siglent's deskew fixture allow for higher deskew values?
/?action=dlattach;attach=1784387;image)
3. For reference, TR2
can use a tiny bit of calibration, but doesn't need it like TR1 does. Comparing its output with my DMM's inline measurement of actual current, resistor TR2 reads peak current of about 98.7% what the DMM does (and about 95.4% for RMS; R1=99.8Ω). Combining resistors to get R1=101.1Ω yields a TR2 value of 99.5% the peak value of the DMM and 96.7% RMS.
Edit: added screenshot above to illustrate skew
1. Should I calculate the voltage divider for TR1 based on Vpeak or Vrms? Comparing TR1's voltage vs. DMM's measurement of the output mains voltage, I get somewhat different ratios for Vrms and Vpeak. (My DMM measured 163.4V peak, 121.3 Vrms.)
I feel like the man with two clocks who is never sure what time it is. I now have a decade box so I can adjust the resistance of my voltage divider to try matching different values.
- If I match Vpeak measured by my scope (via 10:1 transformer) to the 160Vpeak directly measured by my DMM, the Vrms diverges between them. 114Vrms on the scope vs. 118.5Vrms on the DMM.
- If instead I match the Vrms (119V at this point), the Vpeak diverges. 166.7Vpeak on the scope vs. 160.6Vpeak on the DMM.
- If I use a power recorder to measure Vrms, it reads lower than the DMM: 118.3Vrms vs. 119Vrms. (Sadly my power recorder won’t measure crest voltage.) The power recorder is measuring at J1 and the DMM is measuring the power recorder’s output.
Why the difference in Vrms calculation between the three? The DMM is a Brymen 257S, and the power recorder is a Zhurui PR10-E.
Should I be calibrating to match Vrms or Vpeak?
You have an invasive components TR2 . TR2 is acting as a choke on the main line . Inductors Lag current. If you want accuracy you need to use Non-invasive methods. Use a current transducer to measure current not a current transformer.
You have an invasive components TR2 . TR2 is acting as a choke on the main line . Inductors Lag current. If you want accuracy you need to use Non-invasive methods. Use a current transducer to measure current not a current transformer.
It's actually a non-invasive (through-hole) current sense transformer. I based the symbol off of their drawing rather than using the IEC standard, sorry for the confusion.
I'm still puzzled by the disparity between peak voltage measurement vs. RMS calculation between the scope and the DMM especially. I imagine the DMM is likely to compute RMS more accurately than the power recorder, but I would have thought the scope would match the DMM once calibrated.
First, TR2 is not acting as a choke.
Second: @pcee, welcome to the real world.
What you're seeing is sine wave distortion of the mains voltage (it's not TR1), which you'll see in every home in the world. This of course leads to current draw distortion as well. Both of your waveforms are typical, and you'll have to live with it. It explains your rms/peak discrepancies fully(*).
The small delay through TR1 is due to winding resistance (=LR delay), a solution might be a larger transformer.
(*): due to a lot of apparatus with rectifier/capacitor power supplies still in use, as well as cheap power transformers running at saturation limit.
Both of your waveforms are typical, and you'll have to live with it. It explains your rms/peak discrepancies fully(*).
I'm not sure I follow. I'm not concerned about a divergence between
theoretical and observed Vrms for a given Vpeak -- I know mains voltage won't be a perfect sine wave. Instead, I'm puzzled by the divergence in
observed Vrms for a given Vpeak.
Specifically, given a specific Vpeak as measured by both the (calibrated) oscilloscope and the DMM (say, 160V), why would they calculate different Vrms? Do you mean that TR1 is filtering out the distortion so that the scope is measuring a different wave than the DMM?
Given the difference, should I calibrate to match Vpeak between the scope and DMM, or should I calibrate to match Vrms?
Sorry, but I'm confused now rereading this whole thing.
It's nebulous what you're measuring where and with what.
Could you post the schematic with the test points you're using, please?
Could you post the schematic with the test points you're using, please?
Sure, it has evolved slightly since the last schematic. I'm moving the dimmer switch to an outboard box so that I can run tests without any phase cuts.
MES0 is my DMM probing the actual mains output. MES1 is channel 1 of my oscilloscope.
The MES1 point should show around 14...14.5 V
RMS. I don't understand the plots from your 'scope.
Just use the DMM for the MES0 and MES1 RMS values to get the resistor ratio for the TR1 output voltage.
When that's done, show us a dual-channel plot of the TR1 (after the divider) and the TR2 outputs to evaluate the phase shift.
EDIT: and by the way, this is the internationally correct symbol for "Earth" in this context (KiCAD: "power -> Earth_Protective")
The MES1 point should show around 14...14.5 VRMS. I don't understand the plots from your 'scope.
I was originally getting 16.3Vrms, which I told the scope to scale 10X.
Just use the DMM for the MES0 and MES1 RMS values to get the resistor ratio for the TR1 output voltage.

Comparing apples to apples would have been smart. I think I was concerned that the voltage variation over time would be a problem so I wanted to measure both simultaneously. But of course measuring with the SAME device is going to be way more reliable than with two different ones.
When that's done, show us a dual-channel plot of the TR1 (after the divider) and the TR2 outputs to evaluate the phase shift.
Here's a zoom-in showing the delay of 158.5µs:
/?action=dlattach;attach=1805771;image)
I did try adding a (2.07µF) capacitor in parallel with R1, which sometimes got the skew down to ~400ns on a sine wave, but of course that created a LPF that totally mangled the phase cuts of dimmer switches:
/?action=dlattach;attach=1805777;image)
Is there any other straightforward way to compensate for the LR delay?
Overall, with the voltage divider and tweaked resistance for R1 (104Ω to match my DMM's current reading), I get pretty good graphs and numbers even with the minor skew:
/?action=dlattach;attach=1805783;image)
/?action=dlattach;attach=1805789;image)
p.s. That earth symbol is part of the P1 and J1 symbols. I've been wanting to get rid of it there, so thank you for pointing me to the correct replacement.
Please add some explanation to your plots. I can guess that yellow is the the voltage and pink is the current, but I'm not certain.
Also, you seem to be scaling/converting the plot units. Please don't do that, just show the raw voltages at TP1 (I expect your divider is now correct) and TP2. Don't try to be fancy, it causes confusion.
Yes, C1 (yellow) is voltage. C2 (pink) is current. F1 (orange) is calculated V*I.
The only scaling I'm doing is the 10X to take the readings from their actual TP1/TP2 measurement to the calibrated output values at J1, e.g. 12.0477Vrms at TP1 -> 120.477Vrms at J1 and 38.4487 mVrms at TP2 -> 384.487 mArms at J1.
Not trying to be fancy, just doing less math in my head.
Not trying to be fancy, just doing less math in my head.
That's fine when working on it, but complicates things when doing circuit analysis.
Fair enough. I'm not at the scope now, so it'll take me a little while to regenerate plots with bare voltage.
In the mean time, aside from my attempt at delaying the current measurements with an RC circuit, is there any other straightforward way to compensate for the LR delay that wouldn't mess with phase-cut waveforms?
To be honest, it's hard to judge phase skew on a couple of (fuzzy) sine-waves.
On the other hand, the vertical phase cut line in the fourth picture looks excellent to me. Both your transformers are behaving really well.
The plot also has a couple of artefacts that tell me you may need to trim your 'scope probes.
Err, a HV probe, properly used, damn well better isolate you from something as low as mains Voltage. After all, they are designed for thousands, even tens of thousands of Volts. If it doesn't, smash it to pieces (so no one else uses it) and toss it in the trash.
And such insulation need not be expensive. Just thick enough and properly designed.
BUT most ordinary scope and meter probes are good up to at least 500 or 600 Volts. The only danger is if you touch the exposed conductor.
hmm, the voltage transformer thing. Unless you can afford a proper instrument measurement transformer with all the required specs. That setup would continually do my head in, in trusting what it is showing. You have to adjust for phase, and high freq artifacts that your going to get from a dimmer, i'm assuming your going to want to notice those? no?
You don't need a differential probe, you need a high voltage oscilloscope probe, they are not
that expensive, and sounds like you ought to get one at least.
First point: why would you need to adjust for phase? And where did the dimmer come in?
Second: a high voltage probe will not isolate you from the mains. A differential probe will. It's two different things. Try not to kill people, please.
The plot also has a couple of artefacts that tell me you may need to trim your 'scope probes.
What artifacts are you seeing? I just double-checked with a 1kHz square wave and the probes seem well trimmed.
Per your request, here are plots without any channel scaling, just the actual voltages read by the probes with my 43W incandescent bulb:
/?action=dlattach;attach=1807303;image)
Here's the measured skew:
/?action=dlattach;attach=1807309;image)
...which I can correct with a capacitor:
/?action=dlattach;attach=1807315;image)
...but then look what it does to my phase cut current measurements!
/?action=dlattach;attach=1807321;image)
Here's what it looks like without the capacitor, much better:
/?action=dlattach;attach=1807327;image)
It occurred to me that if I really cared about this 160µs skew, I could probably use a second VPL24-210 (like TR1) between R1 and TP2 to produce identical delay in the measured signal, couldn't I? Though to match the number of windings, would I need to use it in the same 10:1 configuration (shrinking small voltages still further), or would it produce the same delay if I used it backwards (1:10 providing amplification)?
Now that I've got the design worked out, I'm working on the PCB layout. Since this design originated from my lack of experience with mains voltage, I unsurprisingly have a few questions about the PCB itself.
The dashed lines on the silkscreen mark out roughly where the mains wires will pass ~1/2" above the PCB.
1. Does the PCB need any protection from current induced by the nearby mains voltage? For example, should the traces be on the bottom of the PCB with some sort of filled copper regions on the top to shield them? (I know you don't want to run low and mains voltage in the same conduit due to induced current, but maybe that's only significant over long distances...)
2. Does it make sense to have a ground plane instead of ground traces in this design? Since TP1 and TP2 will go to an oscilloscope that has a shared ground, the two test points will have a common ground (along with the TR1 header).
The PCB layout and corresponding schematic are attached.
Thanks to
coppice's warning about dimmer switches, I've moved the dimmer switch out of the probe into its own breakout box. That way I can plug mains into the probe to get a full AC sine wave, and then plug in the dimmer breakout box to test dimming.