Transformer based 230V 50Hz voltage probe : need advice - Page 1
Forum section: electronics / projects

author: mushroom
author_rank: Regular Contributor
timestamp: April 06, 2015, 04:17:01 pm
content: Hello,I'm currently designing several things related to each others. I have to do some measurements over mains, but still don't have adequate equipment.-1- power meter ; the "probe" is built around a Arduino Pro Mini 328 16MHz 5V, and it is wireless ; it is connected to another receiver Arduino using a Bluetooth link (works fine)-2- isolated oscilloscope probes for mains measurements (voltage and current) ; opto isolated probes will come later. At the moment, I'm in a hurry : I use a voltage transformer and a current transformer.I tested the current transformer (a cheapo component, found on eBay). I tested it using a 150VA/15V/50Hz transformer, it is perfectly linear, and there is nearly no phase shift between input and output (appreciated with oscope, using a 15V 10A 50Hz transformer and a power rheostat...). This problem is solved.As a voltage probe, I wanted to use a tiny transformer I found on eBay : 220V/9V/55mA. Search for "AC 220V to 9V 50-60Hz 56mA 4-pin Microwave Oven Power Transformer". The output signal is horrible ! I imagine they undersized the magnetic circuit, there is saturation, hysteresis and other crap related secret phenomena !(yellow : secondary voltage)For my projects, I need a 4V peak to peak signal or so.I had an idea. The voltage transformer outputs 40V peak to peak. Rather than dividing the output, why not divide the input ? It would reduce secondary voltage, reduce primary current, and, as a result, allow it to work more linearly... As a first attempt, I connected two 1Meg resistors between mains and transformer primary winding. I got this :(yellow : secondary voltage)still horrible, but secondary voltage is within specs.Then, I added a cap (100nF, the first I found) in parallel with the primary winding. I got a far better signal. And, indeed, a phase shift between primary and secondary.(yellow : primary, blue : secondary)Then, I played with resistors and capacitor values. I found a soft point with 1M resistors and 33n capacitor. (tested using 15V 50Hz as voltage source : no floating oscope there !)With theses components, I got what I needed : a nice signal, and 3.72V peak to peak that can be processed with a 5V microcontroller ADC.I have several questions :Am I on the wright way doing this ?Why the hell do 230V mains always look like they are clipped ? I imagine it has something to do with harmonics, power transmission lines and transformers, and many other things. With the circuits I experimented, I built a low pass filter, and the "clipped look" disappeared. I assume it is neglictible for power measurements. But is it really

author: tggzzz
author_rank: Super Contributor
timestamp: April 06, 2015, 05:09:49 pm
content: Quote from: mushroom on April 06, 2015, 04:17:01 pmIIRC they put a gap in the transformer to ensure it doesn't saturate.QuoteThey look clipped now, but they didn't in the 80s. I suspect, but have not confirmed, the difference is the larger number of electronic devices with diode-RC power supplies (or equivalent thereof) that mainly recharge the capacitor at the voltage peaks.The harmonic content is a result, not a cause. Whether or not it is "negligible" will depend on thepurposesfor which you are measuring power.

author: mushroom
author_rank: Regular Contributor
timestamp: April 06, 2015, 05:45:33 pm
content: This makes sense !I do not need very accurate power measurements. 5% or even 10% accuracy are just fine ! I am more interested in observing waveforms and phase shifts with the oscope. I find it funny, particularly current drawn from switching PSU. I am also interested in phase shift between V and I : I use several VFDs from 250W to 4KW(3-phase machine tools) : personnal use (hopefuly, I pay for watts, not for voltamperes). VFDs have correction circuits, and I'd like to know how they perform and suck current : high end vs low end, low power vs high power, old vs recent. There is no critical measurements. Everything is hobby related only, and mostly useless. But accuracy is welcome, if possible with transformers.

author: JohnnyBerg
author_rank: Frequent Contributor
timestamp: April 06, 2015, 06:25:55 pm
content: If you put resistors and or capacitor over and in series with the transformer you're creating filters with fase shifts. Not exactly accurate for measurement. I suggest you test with a small load on the secundairy side. Or use LTSpice to simulate what ever you are doing.

author: Ian.M
author_rank: Super Contributor
timestamp: April 06, 2015, 06:45:50 pm
content: Anything for domestic microwave ovens is designed down to a price and is likely to have the absolute bare minimum of copper and iron inside it - only just enough to stop it saturating badly enough to burn up at ithe upper limit of its nominal input voltage. If you are working with a nominal 110-120V supply that transformer will probably be OK for voltage measurement, but if you have a 220-240V supply I doubt its got enough headroom before saturation. Try two in series (both primary and secondary sides).Also you need to load it properly. Its rated for 44mA, so lets assume the normal operating maximum is 40mA. If you draw 20mA at nominal voltage it should be about right so put a 2K2 resistor across the secondary.

author: mushroom
author_rank: Regular Contributor
timestamp: April 06, 2015, 10:41:11 pm
content: Be indulgent, I rediscover electronics : I stopped playing in the mid 80', when I went to programming, and restarted a couple of years ago ! I think some of the problems are solved after some thinking.@JohnnyBerg : I put the capacitor there for phase compensation, and it gives the transfer you can see on my first post : picture #4 : input and output voltages are nearly in phase (barely visible, a few degrees). Further compensation is done at software level *for power measurements*. Just have to calibrate with a 100% resistive load, with the voltage and current probes connected, and the software. At this point, the voltage probe does not shift more than the current transformer (it also introduces a few degrees). Power meter is simply calibrated on a resistive load for 100% power factor, a true RMS voltmeter, a true RMS ammeter, and that's it !For testing, and determination of C1, I used a 150VA/15V transformer as isolated source (safety first). I don't know if 230V in lieu of the low voltage test source will modify this result. Could phase response depend on voltage ? More voltage, and magnetic circuit working in a different range ? I have no variac, and I am limited to 15V or 230V : I have a 2nd identical 15V/150VA transformer and will give a try with the two 150VA transformer connected as a "poor man's isolation transformer" (230->15->15->230).LTSpice can't help : the transformer magnetic characteristics are unkown, and even if it was, or if I could measure, I am not able (by far !) to create a Spice model for a real life transformer ! I learned electromagnetics 40 years ago, and forgot almost everything !@Ian.M : the transformer is rated 220V, and where I live, it is 230V, not 110V. I could'nt find smaller where I usualy buy components.Yes, there is no current or nearly no current drawn from the transformer : neither with the oscope (x10 probe), neither with DAC input. Everything is high impedance only. I already tried to load the transformer's output, with 10K, 230V and 15V input (primary), it made absolutely no difference in phase shift and waveform on the oscope. I just tried with 1K for 15V primary: still the same (graphic) phase shift. I will have a try with more milliamps later, as you suggested...For now, the only difference with loaded output is indeed lower output voltage, so I'd have to find R1 R2 C1 again... Time consuming...Two transformers in series : why not ? But not these cheap ones with their crappy output. My goal is to use as small components as possible *for the powermeter*. I have a second identical small transformer I ordered as backup in case I could'nt power the Arduino with a transformerless supply (resistor+zener+cap) ; I still have to measure the current drawn by the Arduino Pro Mini + HC-05 bluetooth adapter (Bluetooth association draw more current than normal coupled operation).I have two other small molded transformers, from a known brand, and they give a clean sine on the secondary windings. But they are too big.As is, with 15V input, output voltage comes 400µs after primary voltage : 2*pi*(0.4ms/20ms) = 7° ; in terms of power factor, it gives cos(7°)=0.992 : 1% error ; easily corrected by software : DAC readings (V and I) are buffered, and for RMS power calculations it is just a matter of index shift in the arrays, (sampling is a time interrupt routine). And even without correction, accuracy is probably better than what I plan : 8-bit value for 0-2550W. Why 8-bit and fixed point value ? Because power value can be sent as a single byte, avoiding a complicated escaped protocol or ASCII transmission (MCU cycles hog) ; I do not need a great accuracy, and minimum power to be displayed won't be less than 200W !The schematics for the power meter (voltage input) :R1 R2 C1 : voltage reduction and first phase compensation (2nd = software)R3 R4 C2 : voltage shift in order to get 0 +5Vpp insteed of -2.5Vp +2.5Vp (needed for DAC), as I don't want to use op amps (active rectifier, active virtual ground)Later this week, I will do some more testing with the "poor man isolation transformer", in order to see phase shifts with the oscope, and real life power measurements with the propes connected to the Arduino. The second part of the project (phase correct oscope V and I probes) will be explored later.(thank you for reading, it is a huuuuuge post)

author: mushroom
author_rank: Regular Contributor
timestamp: April 08, 2015, 11:53:28 pm
content: Problem solved. FFT shows distorsion : a large amount of odd harmonics ; no even ones, easier to filter, 150Hz being the first frequency to be attenuated. A simple RLC filter (L = transformer) on the output cleans the signal. Here is the result using E12 resistors, after some experimentation with adjustables. It will be optimized using E24. Phase shift is not a problem : software compensation.Another possible solution : digital filtering. But I dont know if the Atmega 328 @16MHz has the muscle to do calculations with a 2.5KHz or so sample rate.I found on the web that the distorsion is the result of small gauge windings (high resistance), and miniature magnetic circuit. This little thing can be used as a cheap isolated voltage sensor.