Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Mains setpoint monitoring basic circuit: best choice.

Status
Not open for further replies.

Akanimo

Advanced Member level 3
Joined
Aug 30, 2016
Messages
847
Helped
145
Reputation
290
Reaction score
165
Trophy points
1,323
Activity points
7,108
Hello everyone,

I need to monitor the mains with setpoint and I need an isolation too. I need a digital signal as output. When the mains is above the setpoint, I get a '1' and when below the setpoint I get a '0'. I am using opamp (with hysteresis) for the monitoring.

20190501_131610.jpg

20190501_131558.jpg

I have posted two basic circuits that I think maybe cost effective that I would like to choose from but if you have a better circuit, I'm open to your suggestion.

The circuit with a transformer is basically a switched mode converter with no feedback.

Please what do you think of the circuits I have posted? If you were to select one from the two, which would you prefer? If you have a better circuit, please suggest to me.

Thanks in anticipation.
 

Hi,

Not an expert, anyway. Wouldn't circuit 1 be more cost-effective (less parts), lower current draw and smaller PCB requirements? What about a transformer, a voltage reference and a comparator? Why an op amp rather than a comparator, any reason, it saves a voltage reference could be one?
 
Presently the OP circuit doesn't provide hysteresis (positive feedback missing). Both circuits seem to have a fixed threshold ("setpoint"). In this case, a circuit with digital isolation (e.g. opto coupler) seems preferable. It however requires an isolated Vcc supply which also acts as reference voltage. Primary supply can be derived from the rectified mains voltage.
 
Hi,

...
What about a transformer, a voltage reference and a comparator? Why an op amp rather than a comparator, any reason, it saves a voltage reference could be one?
I was thinking that a line frequency transformer would make the circuit unnecessarily bulky and so I tried to avoid it.


Presently the OP circuit doesn't provide hysteresis (positive feedback missing). Both circuits seem to have a fixed threshold ("setpoint").
...
I read the information somewhere that an Opamp with a network of two resistors as in the diagram introduces hysteresis. I have realized that I interchanged the inverting and the noninverting terminals of the opamps. That was a mistake.

I'd probably go for the circuit with the optocoupler as you two have recommended. I'd be powering the monitoring circuit with the output of the reference pin of a UCx845. I'd also be using it as the voltage reference for the comparator. The optocoupler phototransistor would be biased with the secondary side output voltage of the flyback.

I would like to improve on the circuit. Please I need your support. Thanks.
 

Things to consider:
1. the current to the opto-coupler LED needs to be limited - add a series resistor.
2. be very careful with 'ground' as the input part of the circuit is not isolated. As shown in the first schematic, you would either have a 'live' output or an exploded IC.
3. think about where the supply for the op-amp, or better still a comparator comes from and whether is is isolated.

You could make the whole input side 'live' and derive the comparator supply from the rectified AC, it would be a low cost option but you would have to add a stabilized reference voltage (a Zener diode maybe) because deriving the reference and measured voltage from the same source would not be reliable.

Brian.
 
Things to consider:
1. the current to the opto-coupler LED needs to be limited - add a series resistor.
Yes, I'll do that. I'm also thinking of connecting a capacitor across the bottom resistor of the rectified mains voltage divider to help reduce the ripple that the opamps see at the signal input.
2. be very careful with 'ground' as the input part of the circuit is not isolated. As shown in the first schematic, you would either have a 'live' output or an exploded IC.
Oh! Thanks Brian for pointing this out... The ground symbol that references the opamps powersupply on the diagram is a mistake. I sketched the circuit without the opamp power pins.
I hurriedly drew the Vcc and Gnd pins when I wanted to post the schematic.
3. think about where the supply for the op-amp, or better still a comparator comes from and whether is is isolated.
My initial plan was to power the opamp with a voltage that is output at the "Vref" pin of the power management IC that I am controlling the power supply with. It's not isolated anyways.

You could make the whole input side 'live' and derive the comparator supply from the rectified AC, it would be a low cost option but you would have to add a stabilized reference voltage (a Zener diode maybe) because deriving the reference and measured voltage from the same source would not be reliable.
The Vref pin output voltage is actually a stable 5V reference. I think that it will be adequately stable if I use a fraction of that voltage as my opamp setpoint.

How about PCB ground isolation? The ground of the flyback primary and the ground of mains monitor combined, is it a good idea?
 

Hi,

I was thinking - maybe accuracy-wise, not an alternative - about if the op amp could be replaced with a suitable voltage (series) Zener diode after the resistive divider, that way a pre-isolation side supply might be avoided and it could be used to create the digital on/off? Probably not accurate enough. Not sure if I'm asing a question or making a suggestion...

Haven't considered in detail actual implementation of this voltage reference in your circuit, but I believe the TL431 might be used as a comparator instead of the op amp here, too, for the sake of making another suggestion just in case it's of interest.
 
TL431 (or may be LM385-Adj. for lower quiescent current), primary supply derived from rectified mains and a high transfer factor opto coupler would be also my solution. But we didn't yet hear accuracy requirements.
 
Hi,

I did a lot of mains measurement designs.

Call me pedantic, but in my eyes it makes a big difference to monitor
* mains voltage or mains current
* mains RMS voltage
* mains rectified average voltage
* mains voltage waveform
* mains frequency
* mains overtones
* or something else.
It needs to be defined.
Mains voltage may be almost pure sine, but there is no must. In reality it will be distorted, there will be noise, there will be transient spikes. Thus every method will show different result, and different threshold levels (varying with distortion)
And what additionally needs to be defined: timing behaviour and hysteresis.

The given schematics is something inbetween RMS and rectified average .... somehow undefined.
Neither the one nor the other.

Thus if you give your task to different designers, it will lead to different behaviour.

Klaus
 

I was thinking - maybe accuracy-wise, not an alternative - about if the op amp could be replaced with a suitable voltage (series) Zener diode after the resistive divider, that way a pre-isolation side supply might be avoided and it could be used to create the digital on/off? Probably not accurate enough. Not sure if I'm asing a question or making a suggestion...
This sounds like a good idea but I can really picture how to implement the idea. Please explain it in more details.

Haven't considered in detail actual implementation of this voltage reference in your circuit, but I believe the TL431 might be used as a comparator instead of the op amp here, too, for the sake of making another suggestion just in case it's of interest.

Yes, the TL431 can be used as a comparator. I am going to run a simulation, then build and test it with maybe 30Vdc from a benchtop PSU and see how it behaves. Then, hopefully, I'll upgrade it to the mains voltage. But I am just wondering whether I can achieve adequate hysteresis with it.

TL431 (or may be LM385-Adj. for lower quiescent current), primary supply derived from rectified mains and a high transfer factor opto coupler would be also my solution. But we didn't yet hear accuracy requirements.

I have looked at the LM385-Adj datasheet but it seems it cannot be used as a comparator. It would be a really nice implementation to have it do the job.

I require an accuracy of +-2%.


What is the main's voltage...
Specifications are that the mains voltage fluctuates from 190Vac to 250Vac at the target location of use. I need to select a setpoint of the mains voltage that I desire operability.

…in my eyes it makes a big difference to monitor
* mains voltage or mains current
* mains RMS voltage
* mains rectified average voltage
* mains voltage waveform
* mains frequency
* mains overtones
* or something else.
It needs to be defined.
Mains voltage may be almost pure sine, but there is no must. In reality it will be distorted, there will be noise, there will be transient spikes. Thus every method will show different result, and different threshold levels (varying with distortion)
And what additionally needs to be defined: timing behaviour and hysteresis.

The given schematics is something inbetween RMS and rectified average .... somehow undefined.
Neither the one nor the other.
...
Klaus
I am monitoring RMS voltage indirectly from the rectified mains voltage. I'd factor in diode drops and I'll provide a lot of filter capacitance to reduce ripple content to a tolerable level. Talking about noise, I have been wondering whether I should tap the rectified mains voltage for the power supply (SMPS) or I should have a separate bridge rectifier for this circuit to try and keep away from the noise within the power supply primary.

Timing behaviour? Please elaborate on what you mean.
 

Regarding Lm385 see figure 23 and 24 of the data sheet for comparator application. Same but inverted compared to TL431 which shouldn’t matter for an isolated AC application.
 

Hi,

Regarding series Zener, it may not work how I'd thought, sorry about that... Image (only to show what I meant) is from Talking Electronics, How a Diode Works. I thought it would be switch-like, I'd need to simulate one this evening to see if it actually is or not.

**broken link removed**

This short article, Shunt regulator monitors battery voltage, says: "A TL431 shunt regulator is a perfect choice for many applications. You can use it as a comparator with hysteresis by taking advantage of its inner voltage reference along with few additional components. You can use this comparator with hysteresis, like a Schmitt trigger, as a simple battery monitor (Figure 1)." As a battery monitor, it looks more parts than the op amp you have.
 

Hi,

I am monitoring RMS voltage indirectly from the rectified mains voltage.
No.
This simply is impossible.
You just monitor an undefined voltage signal and multiply it with a factor to get a value that looks like a RMS value.
But as soon as the waveform changes the factor should be adjusted - which most probably you don't do.
If you want to call it RMS you need to: square - average - squareroot.

The waveform changes... although in our region we have a very stable and clean mains supply, the sine is distorted. It's not easy to recognize this just by looking at the scope. Here the sine has a flatened top, caused by the rectifiers. And it's enough to make it impossible to get an +/-2% accurate RMS value with a non RMS measurement method.

Some values (I know it's not compareable with mains sine).
Take a square wave with variable duty cycle:
At 0% both RMS and average shows the same: 0%
At 100% both RMS and average show the same: 100%
But with 50%: the RMS value shows 70.7% while the average method shows 50%.
And both values are correct!

Klaus
 

Hi,


No.
This simply is impossible.
You just monitor an undefined voltage signal and multiply it with a factor to get a value that looks like a RMS value.
But as soon as the waveform changes the factor should be adjusted - which most probably you don't do.
If you want to call it RMS you need to: square - average - squareroot.

The waveform changes... although in our region we have a very stable and clean mains supply, the sine is distorted. It's not easy to recognize this just by looking at the scope. Here the sine has a flatened top, caused by the rectifiers. And it's enough to make it impossible to get an +/-2% accurate RMS value with a non RMS measurement method.

Some values (I know it's not compareable with mains sine).
Take a square wave with variable duty cycle:
At 0% both RMS and average shows the same: 0%
At 100% both RMS and average show the same: 100%
But with 50%: the RMS value shows 70.7% while the average method shows 50%.
And both values are correct!

Klaus
How about this approximation ad regards bridge rectification where the rectified output is about the same value as the peak:
Vdc=1.414*(Vac - 2*Vd) approx.?

Where Vd is a rectifier diodes drop.

The accuracy here is +-2% of the setpoint voltage and not for the entire continuum of instantaneous values.

- - - Updated - - -

Regarding Lm385 see figure 23 and 24 of the data sheet for comparator application. Same but inverted compared to TL431 which shouldn’t matter for an isolated AC application.

Unfortunately for me, I'm not going to be feeding it with an isolated AC. I don't think it's going to be of much use as a comparator in this case.
 
Last edited:

I'm guessing the AC frequency and waveform purity are not particularly important in this application. I think the way I would do it is to use a capacitive dropper AC supply to power a low power comparator driving an opto-coupler for output isolation. The reference input can come from a Zener diode and measured input divided from the supply rail. It would make a low component count and fairly accurate monitor.

Brian.
 

Hi,
...
This short article, Shunt regulator monitors battery voltage, says: "A TL431 shunt regulator is a perfect choice for many applications. You can use it as a comparator with hysteresis by taking advantage of its inner voltage reference along with few additional components. You can use this comparator with hysteresis, like a Schmitt trigger, as a simple battery monitor (Figure 1)." As a battery monitor, it looks more parts than the op amp you have.

I've run a simulation and I could achieve some hysteresis. I'll still do a board test for certainty.
 
  • Like
Reactions: d123

    d123

    Points: 2
    Helpful Answer Positive Rating
Hi,

I've run a simulation and I could achieve some hysteresis.

You say "some"... Must ask: Is wide-ranging hysteresis (between VthL and VthH) possible with the part or does it seem to have a somewhat limited/restrictive range?
 

Hi,

How about this approximation ad regards bridge rectification where the rectified output is about the same value as the peak:
Vdc=1.414*(Vac - 2*Vd) approx.?
This means peak value measurement.
It is even less precise than your previous method, because it takes only a very short time of the fullwave into account. All the rest of the time the signal is ignored.

The accuracy here is +-2% of the setpoint voltage and not for the entire continuum of instantaneous values.
It seems you mix accuracy and precision.
If you don't need accuracy but precision to be within +/-2% for a small area around the setpoint...then this eases design.
Depending on waveform distortion you may have a good chance that your first solution may work.

Rectified average, RMS, peak....
You may calculate one value from the other when you know the waveform.
Without waveform information it simply is impossible to calculate one from the other.

Use excel to do a simple simulation:
Let's use a sine with 10% third overtone.
V(t)= sin(t) + 0.1 × sin(3 × t + phi)
Phi is phase shift.
RMS calculation gives a constant value independent of phi.
Every other method will vary the output value depending on phi...even if the amplitude of both sine is constant.


You are free to use to choose your own solution, I just want you to warn that your solution may not be that accurate as you expect.

Klaus
 
Here's the LTspice simulation of a basic circuit using a TL431 reverence as a switch to generate an output from an opto isolator.
R_Hyst gives a hysteresis of about 2Vac for the value shown.
Pot U3 adjusts the trip point.
For the setting shown, the output is high for 220Vac and low for 210Vac.

Note that this circuit detects the peak AC voltage.
To detect the true RMS would require the addition of a true RMS conversion IC.

Capture.PNG
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top