AC voltage sensor using Rectifier

Thread Starter

vars90r

Joined Mar 24, 2020
29
Hello
I'm trying to implement a rectifier and AC voltage sensor. The rectifier part works just fine. I'm able to power my device without any issues.
Please look at C2 in the screenshot (Circuit schematic). This connector is connected to AC voltages. Vin is a rectifier and the DC part is to power the device.
AC-1 to AC-5 are AC voltages that are sensed at ADC-0 to ADC-4 respectively. AC-6 is the neutral line of all the AC voltages connected to the board.
When AC (1-5) are connected to AC voltage, the device works just fine. No issues at all. But when AC-1 and AC-2 are connected to 120 VaAC while AC (3,4 and 5) are not connected to anything, ADC-0 and ADC-1 read the right value but ADC (2,3 & 4) read 7.5V while they should read 0 V.

I connected all the -ve terminals of the bridge rectifiers to have a common ground but when there is no AC voltage, the respective +ve terminals of the bridge rectifiers reads 58V (+ve is floating while -ve is grounded). Is there any way to fix this? cause my ADC is reading the incorrect value of 7.5V when it should read 0 V.

Thank you
 

Attachments

DickCappels

Joined Aug 21, 2008
6,386
You need some isolation between the AC being measured and your measuring circuit. Ideas include isolation amplifier(s), transformers(s). You may want to multiplex the inputs then use one isolated channel to send the measured voltage to the measurement side.
 

ci139

Joined Jul 11, 2016
1,463
why you use basically (high power) current sensing ? heavy system noise ? power hungry sensor inputs ? other ...
 

Thread Starter

vars90r

Joined Mar 24, 2020
29
I didn't use a transformer in the sensing circuit because of its size. The board size would be as large as 6 by 9 inches just for the transformers. That's not ideal. Hence I used a transformer when I powered the device and not in the sensing circuit.

I looked up isolation amplifiers and found the following: Is this something you had in mind. I need to use 5 of these.
https://www.digikey.com/product-detail/en/texas-instruments/AMC1100DWVR/296-46067-2-ND/6571602

Does it have to be isolation opamp? Can I use a normal opamp with unity gain?
https://www.digikey.com/product-detail/en/texas-instruments/LM358P/296-1395-5-ND/277042

Any other type of isolation techniques? how about Y capacitors?

I need to monitor all the 5 AC voltages at a time. MuX is not an option. I cant switch the Selection lines of the MUX that fast.

why you use basically (high power) current sensing ? heavy system noise ? power hungry sensor inputs ? other ...
The voltage that I will be sensing will be of 120VAC. I dint chose that. It is what it is. That's why I used a 30K 2W resistor to limit the current and dissipate most of the power so that the voltage across 4.7K is between 0-30VDC for 0-250VAC.
 

ci139

Joined Jul 11, 2016
1,463
i have difficulty making the difference in between what you had (describe in the #1) and what you are planning to have (in #4)

? do you need to read the rectified (lossy) AC that is RC summed (delayed , averaged) or need the real time ±AC voltages

( your schematic in #1 conflicts with the ±250mV input range of your intended AMC1100 setup )
 

Thread Starter

vars90r

Joined Mar 24, 2020
29
#1 is the current I implemented. But DickCappels suggested the use of isolated amplifiers. Hence confirming if that is something that I had in mind.

I want to sense the AC voltage (real-time) in lines AC 1-5. Vin is used to supply power to my device. AC-6 is the common neutral line. ADC won't read constant AC voltage, hence I'm rectifying the input AC, then read it via ADC. All the voltages are referenced to the -ve of the bridge rectifiers.
 

DickCappels

Joined Aug 21, 2008
6,386
Last edited:

Reloadron

Joined Jan 15, 2015
5,454
For the curious at heart this previous thread somewhat explains the objective. This may help with any suggestions. As to the symptoms you may want to place pull downs on your ADC inputs and see if that helps. A floating ADC can read all sorts of stray numbers and most are run through a MUX and allow an input cap to charge.

Ron
 

Thread Starter

vars90r

Joined Mar 24, 2020
29
Hello all,

I just got another idea. How about I do half-wave rectification using just a diode?
There are no power requirements. I just need voltage-dependent AC voltage. I'll use a voltage divider to bring the voltage between 0-30V for 0-250 VAC so that ADC is not damaged.

I have attached a test circuit to this thread. Please let me know.

Thank you
 

Attachments

DickCappels

Joined Aug 21, 2008
6,386
That could tell you the peak of the AC voltage. Is that what you want to know?

You probably want to add a way for your circuit to cope with a large over-voltage (25% to 50% for industrial environments).

It would be best to look at the +end of the capacitor referenced to Neutral. I think you mentioned a differential amplifier -this where you would use it. The input resistors should be a high enough value that you can't be hurt by touching the lower voltage end of the resistors, the voltage ratings of the resistors should give you a large margin about the peak line voltage, and you should observe conservative creepage and clearances and lay out the circuit so the dangerous parts are in a distinctly different part of the circuit board from the low voltage circuits.

You can read about creepage and clearance at this link:
https://resources.altium.com/p/high-voltage-pcb-design-creepage-and-clearance-distance

You can look up creepage and and clearances for various applications in the tables on this page:
https://electronics.stackexchange.com/questions/22796/creepage-distance-for-pcbs-handling-line-voltage-ac

When in doubt, use the more conservative spacing for each particular voltage.
 

Thread Starter

vars90r

Joined Mar 24, 2020
29
Hello Cappels,

Thank you so much for your input. I used a 2W 30K resistor to drop most of the input voltage. The max power dissipated at this resistor is 400mW but I'll still go with 2W for safety. The opamp will be powered by the transformer so 15-18V. I'm aware that the opamp saturates when the output of the opamp gets to 13V. So I'II increase the 30K so that the 4.7K will have a max drop of 12V for 120 VAC. Hence no saturation, I will be able to sense the right voltage.

Since the frequency post rectification stayed the same 60Hz, I have to double the capacitance to avoid ripples. So increased it to 220uF.

I have attached the circuit and simulation results. Please let me know if you have any more concerns. I'll make sure the traces have a considerable gap between them. I plan on using the following Opamp:

https://www.digikey.com/product-detail/en/texas-instruments/TL074BCDR/296-14999-1-ND/562659

Planning on using

Thank you

Varun R
 

Attachments

DickCappels

Joined Aug 21, 2008
6,386
Your circuit:
1589853535856.png

I like the idea of dropping the high voltage right away, before much circuitry is attached. I also like the use of the 2W resistor -more than enough margin for a 117 VAC system. Doing the rectification at a low voltage is also a nice touch.

A couple of thoughts occurred while looking at your schematic.

Since you only have a single power supply the circuit will not perform well when the output is close to ground.

The 1N1183 is not the optimum choice. I hope you just used this because it was in your SPICE library. It is a very nice rectifier but its 35 amp average forward current specification and a lack of a leakage current specification (Vishay datasheet) suggests that it might give you problems. A 1N914, 1N916, or 1N4148 which cost pennies would be a much better choice.

Since you will be rectifying a low frequency signal, closing the loop around the diode's forward drop would be a simple thing to do. At higher frequencies the amplifier's slew rate would be a consideration.

1589855336266.png
The resistor in series with the feedback is to compensate for temperature dependent input bias current drift that would cause an offset at the input, and you probably won't need it.

Peak voltage on the line can be about 170 volts which means there will be 5.7 ma RMS through the resistor. I'm kind of a crybaby when I get shocked so I would go for a much higher resistance between the line and the rest of the circuit. It would be something like the highest resistance that can be used without the resistance itself causing a problem, such as creating too large of an offset voltage because of the input bias current.

While on the subject, keep your creepage distance to more than 2 mm for 120 VAC.

I am not sure what is ground and what is neutral in this circuit. In case you are thinking of connecting your circuit ground to Neutral: don't do it. Sometimes Line and Neutral are swapped, and in the case of a short to ground somewhere in the AC electrical system a large voltage spike can be generated on Neutral. That could be bad for any connected equipment.

I would probably be best if earth ground were used with your circuit and your peak detector connect across Line and Neutral with a differential amplifier, which is not only safer for equipment and personnel, but it also avoids errors because of voltage on the Neutral conductor, which you will probably find varies over time.
1589856171192.png

In a simulation is doesn't matter but in real life it is a good idea to include a bypass capacitor across the opamp's power supply pins.

It looks like you have made great strides with your design.
 

Attachments

Thread Starter

vars90r

Joined Mar 24, 2020
29
Hello

I'm actually using IN4004-T. It has a reverse breakdown voltage of 400V. I plan on buying IN4005 for the actual board (600V reserve breakdown voltage), just to be safe. The diodes you mentioned have a breakdown voltage of 100V only. I'm connecting it to 120VAC. We are hitting 20 over breakdown voltage here. It might not be a good choice.

Considering the peak voltage, I've decided to up the resistance(680K and 150K). For 120VAC, I should get an 11.3V drop. If the AC voltages increase for some reason, the opamp saturates at 15V keeping the ADC safe. This will cause the max current through the resistor to drop to 0.26mA and power of 44mW (Large resistor).

I will make sure there is a distance of 2mm for traces that carry 120VAC.

In this scenario, the neutral and line won't get mixed up. I'm not connecting to the mains plug directly. I'm connecting to a heater module which has a designated neutral. Also using a diode with 600V breakdown voltage. If that happens, the diode just blocks the current. Let me know if you still think I should use a differential amplifier?

I'll use a bypass capacitor. It will alter the voltage being sensed but I'm looking for average value, so it ruins the accuracy.

Thank you all for your help. I really appreciate it.

Varun R
 

DickCappels

Joined Aug 21, 2008
6,386
I'm actually using IN4004-T. It has a reverse breakdown voltage of 400V. I plan on buying IN4005 for the actual board (600V reserve breakdown voltage), just to be safe. The diodes you mentioned have a breakdown voltage of 100V only. I'm connecting it to 120VAC. We are hitting 20 over breakdown voltage here. It might not be a good choice.
I was referring to the diode on the output of the opamp, where the voltage should not exceed 32 volts from the power supply. If you rectifier/filter circuit gives you problems, consider whether a lower current diode can solve the problem. What I am thinking about is the reverse leakage through the diode but considering the frequency and that you are charging a 220 uf capacitor I am probably being over-cautious. A 1N400X is certainly a more appropriate diode than the 35 amp rectifier on the schematic.

In this scenario, the neutral and line won't get mixed up. I'm not connecting to the mains plug directly. I'm connecting to a heater module which has a designated neutral. Also using a diode with 600V breakdown voltage. If that happens, the diode just blocks the current. Let me know if you still think I should use a differential amplifier?
This is based on the assumption that the circuit is referenced to earth ground, not floating on Neutral because if there is a load properly connected between Line and Neutral there will be a voltage from Neutral to Earth. A differential amplifier can remove the offset that exists in the Line voltage measurement. The amount of offset is a function of the wiring and type of load.

I'll use a bypass capacitor. It will alter the voltage being sensed but I'm looking for average value, so it ruins the accuracy.
The bypass capacitors to which I was referring are the power supply bypass capacitors which would go from the power supply pin and ground. That should not affect the measurement other than to prevent problems unless there is something unusual about the grounding.

1589959828874.png

If you only have a single power supply, you only need one of these.

Just above you said "but I'm looking for average value". The average of what? The diode-capacitor arrangement shown in various places in this thread are all peak detectors. Just want to make sure you get what you need.

I think you're just about there. As we used to say around the lab, "Keep one hand in your back pocket".
 

Thread Starter

vars90r

Joined Mar 24, 2020
29
Hello

I tried to implement the circuit on a breadboard with a 24V dc input to see if the circuit would give me a 2 V output. I did run into an issue. I don't have any DC voltage here. The challenge is to power the opamp. I didn't think this would be a problem because, in my first schematic that I shared here, I have a rectifier that is working great. I thought I could power the opamp from this rectifier.


However, there is a grounding issue(Please look at the schematic on the first message on this thread). The opamp power supply is to the ground of the bridge rectifier which is isolated from the AC mains by a step-down transformer. When I implemented the circuit using 24V DC, the opamp is not giving the voltage sensed by the voltage on its + pin.

In order for this circuit to work in the real world, I should get rid of the opamp. Or find a different way to isolate the circuit. I have attached the full simulation schematic to this message.
 

Attachments

DickCappels

Joined Aug 21, 2008
6,386
I don't have any DC voltage here. The challenge is to power the opamp. I didn't think this would be a problem because, in my first schematic that I shared here, I have a rectifier that is working great. I thought I could power the opamp from this rectifier.
You should be able to use batteries for short duration testing. A setup like that in your first schematic should work provided the ripple is not enough to damage the opamp or cause the circuit to go open loop.

However, there is a grounding issue(Please look at the schematic on the first message on this thread). The opamp power supply is to the ground of the bridge rectifier which is isolated from the AC mains by a step-down transformer. When I implemented the circuit using 24V DC, the opamp is not giving the voltage sensed by the voltage on its + pin.
Something is not connected according to the schematic (likely) or maybe your opamp failed in a strange mode (unlikely).

In order for this circuit to work in the real world, I should get rid of the opamp. Or find a different way to isolate the circuit. I have attached the full simulation schematic to this message.
That is why I advanced the idea of using a differential amplifier to sense the voltage between Line and Neutral and reference it to Earth ground.
 

ci139

Joined Jul 11, 2016
1,463
if your frequency is fixed you can relay your step downs conversion ratio - but such would require blocking the bridge temporarily and detecting TF ~AC at that time
or
if the phase is not important you can have differential isolated input , maybe as http://tinyurl.com/y8mjdwmc . . . seems i passed a tiny bug in the Falstad . . . and the v. is slow reacting :: LTspice correction + opto-coupler alternate ( there might be dedicated chips doing the job better and being more compact ... )'
~AC--AC - Vm-2.png ~AC--AC - Vm.png
 
Last edited:

Thread Starter

vars90r

Joined Mar 24, 2020
29
I can't use deferential amplifiers because when one of the AC input floats (No voltage), the opamp will still show a voltage difference between neutral and floating AC input. The design should actually read 0 in this scenario.

Alright. After a lot of reading and cursing I finally came to this conclusion. My problems are as follows:

I need common ground and I don't have earth.
My opamp's differential inputs and power supply should have the same ground.
And I need to cut off neutral when AC is floating.


I have attached a circuit which I think will solve all the problems. The following explains the role of each component.

Bridge rectifier MDB6S from on semi. -ve of this rectifier will be the reference ground isolated by the transformer. All the -ve terminal of the bridge rectifiers will be connected together as one reference potential.

Diode D IN4007 to prevent any voltage from the neutral line. When AC line floats, we won't read any voltage from the neutral line. I have to do this because there is a common neutral.

Unity gain Opamp: to provide isolation for the sensing circuit.

IMG_20200525_163350.jpg
 

ci139

Joined Jul 11, 2016
1,463
(( i must re-read the entire thread when i wake up a bit more ))
? in which environment this project will be situated ... ? living space , green house , production floor , .... such would hint more about the options avail.
?? what is your AC input parameters ... fixed frequency , sine , square wave , (basically) a random "noise" , ....
??? what are the expected realistic time delays for the system to react to the input-AC change-event
 

Thread Starter

vars90r

Joined Mar 24, 2020
29
(( i must re-read the entire thread when i wake up a bit more ))
? in which environment this project will be situated ... ? living space , green house , production floor , .... such would hint more about the options avail.
Production floor I guess. There is only one power supply. That's 120 VAC 60 HZ. This powers a heater module. These AC voltages are from different places inside the heater module. Hence they all have common neutral. This module has relays. If a certain AC input is at 120, I know the relay turned ON. Else its OFF. That's the purpose of this project and I need the analog AC voltage. Not just ON or OFF. Else I would have used an optocoupler.

?? what is your AC input parameters ... fixed frequency , sine , square wave , (basically) a random "noise" , ....

Typical household power supply. 120 VAC, 60Hz. Sine wave

??? what are the expected realistic time delays for the system to react to the input-AC change-event

Lower the better. If a relay turns ON, I want to know right way so that I know the module is working fine.
 
Last edited by a moderator:
Top