Isolated AC line voltage monitoring circuit - Page 1
Forum section: electronics / beginners

author: Subin
author_rank: Newbie
timestamp: December 25, 2020, 06:25:47 am
content: I found thishttps://www.edn.com/isolated-circuit-monitors-ac-line/circuit in my quest for a low cost isolated AC line voltage monitor and constructed it. On testing however, I am not getting the correct voltage as expected from the formula provided. Ve is supposed to be 48V but my calculation by rearranging the second formula to get Ve, is giving around 133V.Is the formula wrong or have I made a mistake somewhere?Additional information: I changed the values of R1 and R2 to 100k each as I found the 10k 0.5W resistors were getting quite hot and the 200k obtained should provide enough current to turn on the optocoupler. I used EL817 as I had a few and the diode is 1N4007 (instead of 1n4004). AC RMS voltage is 230V for which I got a low pulse width (Ttotal in the formula) of 0.0073s (it should be about 0.0091s if Ve is 48V). I used an STM8S microcontroller's input capture for measurement. Unfortunately I do not have a DSO to verify the pulse width. I did verify that the pulse width was changing using a variac and an old analog scope.Also are there design errors in the circuit which should be corrected?

author: bob91343
author_rank: Super Contributor
timestamp: December 25, 2020, 07:05:08 am
content: Before you trust this circuit, analyze it. The first thing bad I see is the zener diode. These have soft knees and so the voltage drop depends on the current. Lowering the current by such a big factor as you have done puts that diode even more into the curved part of its characteristic.You are running this thing at double its design voltage so you need to adjust the formula based on that. I didn't bother but you should. That's why those resistors were overheating, with more than double the voltage across each, or four times the design power.Your substitution of the diode type is of no concern.

author: ledtester
author_rank: Super Contributor
timestamp: December 25, 2020, 07:19:07 am
content: QuoteShowing your calculation would help out.What is your measured t_TOTAL? Are you using V_IN = 230?I think the formula is missing a \$\sqrt 2\$ (assuming that V_IN is a RMS voltage), so I would use:$$ V_E = V_{IN}{\sqrt 2}\cos(2\pi f t_{ON}) $$

author: Subin
author_rank: Newbie
timestamp: December 25, 2020, 08:15:48 am
content: Quote from: bob91343 on December 25, 2020, 07:05:08 amI am using a generic 47V 0.5W zener that I sourced locally, so I do not have access to a datasheet. However, after I read your reply, I looked through the datatsheet of 1n6016. I think I will replace the 200K with about 50K. That would give me a current of 5mA at 280V and 3mA at 150Vm which seems to be in between the test current and the maximum zener current. Power dissipation will be about 1.2W which I could spread across 5x10k 0.5W resistors.

author: Subin
author_rank: Newbie
timestamp: December 25, 2020, 08:26:32 am
content: Quote from: ledtester on December 25, 2020, 07:19:07 amVin= 325.22V (this is the peak of 230V RMS)f = 50HztTOTAL= 0.0073s (from Timer Capture values)Calculating Vefrom this gives 133.833 V

author: ledtester
author_rank: Super Contributor
timestamp: December 25, 2020, 09:43:25 am
content: Just some ideas:- double check your timing with a scope; you can also use a multimeter that can measure duty cycle- try different zeners, two zeners in series, try a different opto-coupler- try it with a lower V_IN (either using a variac or transformer) and lower voltage zenerA lower voltage set-up is not only safer to work with, but it's also easier to validate the V-I curve for a lower voltage zener.In principle it seems the concept should work, but as bob91343 mentioned, zeners have soft knees, so you may end up having to calibrate V_E for each device as the last sentence of the article suggests:Quote

author: Ian.M
author_rank: Super Contributor
timestamp: December 25, 2020, 10:39:03 am
content: Also, your choice of optocoupler doesn't help. The min. CTRR for aWPPC-D11064CDis 200, but the min. CTRR for a genericEL817is only 50. You are running at 18% of the original optocoupler LED If, *AND* using an optocoupler that may have four times lower CTRR! so of course its FUBARed!It *MAY* work if you increase R4 to 100K, but I would suggest leaving R4 alone and trying a PC817Doptocoupler for a min. CTRR of 300, 1.5x the original and making R1 and R2 39K to keep their dissipation near that in the original, which will halve the optocoupler LED current, hence the need for a higher CTRR optocoupler.However, with a 230VAC mains supply two resistors in series isn't reliable for a dropper unless you specify high voltage resistors, so it would be preferable to add an extra resistor to make three in series, and make them all 24K, which will give you 70% of the original design's If (compensated for by the higher CTRR), and 200mW dissipation per resistor at 230V AC.LTspice sim of the original EDN circuit attached. Comment/uncomment as indicated to change to 230V version.Uncomment various .STEPped parameter sweeps as required.Incidentally, if you have a *little* higher parts budget and another input capture capable MCU pin available, it would probably be a good idea to replace D2 with the LED of another optocoupler, duplicating the right side circuit except swap R4 and the phototransistor, to get a pulse of the same polarity, except (near) zero crossing aligned so you could directly measure the delay from the zero crossing to when the Zener threshold voltage is reached.It may also be worth adding a 2N5064 sensitive TO-92 package SCR, (or similar small package SCR) triggered by the Zener, to get a fast risetime for the zener delayed optocoupler If pulse, rather than the existing mushy turn-on.

author: bob91343
author_rank: Super Contributor
timestamp: December 25, 2020, 07:07:14 pm
content: I would add another annoying parameter, temperature. A zener diode, in particular one higher than about 5 Volts, will increase its voltage as it warms, causing a drift in your reading.This circuit is fun but it cannot qualify as a serious measuring device. Too many uncontrolled variables. There are much better ways to measure voltage.

author: Ian.M
author_rank: Super Contributor
timestamp: December 25, 2020, 07:30:34 pm
content: Yep, its a very 1970's design. Nowadays, you can get affordabe single chip isolated delta sigma ADCs and if you are willing to pay the premium, can get hybrids with built in isolated DC-DC converters to power the line side sensing circuit. Alternatively, if you are concerned about price and availability of niche parts, use just about any cheap 8 bit MCU with ADC, powered by a capacitive dropper or a 0.5W isolated DC-DC converter, compute the true RMS voltage on it and send the voltage serially once per half-cycle at a high enough baud rate that the average current for the optocoupler LED is negligible so you can use a cheap low CTRR optocoupler with plenty of drive. You can also get tricky and start each data burst with a 'Break' condition at the zero crossing so it can also be used for line frequency or phase angle control timing!

author: S. Petrukhin
author_rank: Super Contributor
timestamp: December 26, 2020, 12:42:36 am
content: It is much easier to use a current transformer, such as the ZMPT107-1

author: Subin
author_rank: Newbie
timestamp: December 27, 2020, 03:47:49 am
content: Thank you all for the suggestions, as a beginner, it really helps a lot. The circuit should be reliable and cheap in the long run as it is to be integrated into a commercial product. I think optocoupler degradation will affect the calculations eventually which will definitely cause a headache after a few years if this circuit is relying on CTR.I guess I will use a capacitive dropper and an MCU (I can get an STM8S003F3 quite cheaply) on the live side to compute the voltage. I have avoided doing that due to the risk involved in handling mains voltage. I found thishttps://www.microchip.com/forums/FindPost/841497a while back and will implement it.@Ian.MAre you the same person who posted that 5V PSU circuit?I will continue to implement the suggestions given in the previous replies as a learning experience. I am curious to see it work correctly.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: December 27, 2020, 10:36:25 am
content: Quote from: Subin on December 27, 2020, 03:47:49 amThis is a child's scheme and program, you will have to go through the growth time with him and correct his mistakes.Here is a simple high-voltage input circuit for an oscilloscope, which I am currently testing, using inexpensive current transformers.

author: Ian.M
author_rank: Super Contributor
timestamp: December 27, 2020, 11:18:02 am
content: Quote from: S. Petrukhin on December 26, 2020, 12:42:36 amThe ZMPT107-1 is *NOT* what most people would think of as a current transformer, although technically it is. Its description calls it a "Current-type Voltage transformer". If you grab its datasheet atLCSC's product page, you'll find its 1:1 and rated for 10mA max, and 2mA nominal into a 50R load. For a practical 220V-240V AC voltage monitoring application you'd need a dropper resistor of the order of 100K - 3x 33K in series should do nicely - giving 10uA/V, which using the datasheet fig.1 circuit can easily be scaled to any desired ADC range.Thanks for the hint - its a very nice part and a lot cheaper/simpler to implement than many of the alternatives. Do you know what its primary resistance is?

author: Subin
author_rank: Newbie
timestamp: December 27, 2020, 01:37:01 pm
content: Quote from: S. Petrukhin on December 27, 2020, 10:36:25 amActually, I was going to implement the circuit (5V PSU) shown in reply #11 (again is it the same Ian.M from this forum?) in that post.https://www.microchip.com/forums/download.axd?file=0;841497Plus a voltage divider to read the line voltage. Sorry for not specifying that earlier.I do like the ZMPT107-1, thanks for the suggestion. Might end up using it if total parts cost can be kept low enough. The isolation is definitely a bonus.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: December 27, 2020, 05:39:57 pm
content: Quote from: Ian.M on December 27, 2020, 11:18:02 amYes, this is not a classic current transformer, which from one turn makes the output current 100/5, for example. But it is actually an insulator that transmits the current of the primary circuit 1:1. It is the current and its output that cannot be left open, otherwise there will be a full input voltage.I don't know resistance, don't remember what is specified in the datasheet, but I can make a measurement tomorrow.I measured its frequency response: at a frequency of 10Hz-20kHz, the nonlinearity is a few tenths of a dB, the phase shift is less than a fraction of a minute. At a higher frequency, he starts to get mad.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: December 27, 2020, 05:48:26 pm
content: Quote from: Subin on December 27, 2020, 01:37:01 pmWhen you put the MCU on the high side with separate power supply and output isolation - this is good, and it can work successfully. But, if you need to do 3-phase measurement, you need three MCUs with three flying power supplies. In addition, updating the MCU firmware on the high side is not so easy and will also require providing isolation. And you will have to write the firmware for the MCU on the high side separately, updating it separately - this is impractical. It is better to put a hardware ADC on the high side, which does not require firmware, consumes little energy and can be powered from an isolated source built into the ADUM insulator.

author: Ian.M
author_rank: Super Contributor
timestamp: December 27, 2020, 07:32:52 pm
content: Quote from: S. Petrukhin on December 27, 2020, 05:48:26 pmThere's no need for three MCUs for three phase voltage monitoring. If there's a Neutral present you keep the MCC Vcc/2 at neutral, otherwise you can tie Vcc/2 to one of the phases, and compute the far side phase-to-phase voltage from the two measured phase voltages and the phase angle between them. It is however a different matter if you also want to do current monitoring.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: December 27, 2020, 07:44:46 pm
content: Quote from: Ian.M on December 27, 2020, 07:32:52 pmIt seems to me that such optimization will fail if the phase relative to which the measurement occurs is interrupted when neutral is not used.

author: Ian.M
author_rank: Super Contributor
timestamp: December 27, 2020, 08:12:06 pm
content: Yes. In that case it would be better to 'fake' a neutral point with a balanced three phase capacitive dropper. It wont be a true neutral as it will wander around a bit but if you capture the three phase voltages with respect to the fake neutral, there's sufficient data to compute all the phase to phase voltages and detect the loss of any single phase.

author: S. Petrukhin
author_rank: Super Contributor
timestamp: December 29, 2020, 12:52:34 pm
content: Quote from: Ian.M on December 27, 2020, 11:18:02 amPrimary: 100.9 Ohm, 6.53HSecondary: 102.5Ohm, 6.56H