Best option for measuring AC voltage using uC

Thread Starter

bbkv_tom

Joined Jul 20, 2009
4
i need to measure an AC line of 24VAC(18-30VAC can swing) using differential op-amp or Optocoupler which shall be connected to ADC input of a uC..Which one is the best option if you consider Noise performance(board shall be very close to a 230V contactor), cost and isolation.
 

Papabravo

Joined Feb 24, 2006
21,157
If the power for the device is coming from the same AC line then you can measure the DC output from the bridge rectifier and capacitor. If not the my recommendation would be a transformer followed by a bridge rectifier, a capacitor and a peak detector.

From this peak, DC voltage you can infer the AC voltage. I don't have a clue about why you think an optoisolator or a differential amplifier might be useful in this application. Maybe you can explain what you had in mind.
 

Papabravo

Joined Feb 24, 2006
21,157
Perhaps our OP is thinking about a precision rectifier, something like this:
http://www.discovercircuits.com/DJ-Circuits/fullrect3.htm

Here's a precision rectifier that does not use diodes: http://www.edn.com/ednmag/archives/1995/033095/07di6.htm

I wonder if they want to measure the peak or the mean voltage?
Good point. Assuming the 18-30VAC is coming out of a transformer connected to the mains, it should be possible to measure whichever one is easier and infer the other. In my estimation, without sampling the entire waveform, it should be easier to measure the peak. Certainly there is more than one way to skin a cat.
 
You should consider some type of isolation before putting AC into your micro-controller; maybe the ADC input has isolation? There are isolation amplifiers made for this type of work, however they are expensive. A CT (current transformer) might work in this instance. Hope this helps.

Cheers, DPW
 

SgtWookie

Joined Jul 17, 2007
22,230
You should consider some type of isolation before putting AC into your micro-controller... <snip>
From the 1st line of our OP's 1st post:
... measure an AC line of 24VAC(18-30VAC can swing) using differential op-amp or Optocoupler...
It looks to me like they are already contemplating isolation, besides - 24vac would be the secondary side of a current transformer.
 

Thread Starter

bbkv_tom

Joined Jul 20, 2009
4
Hi All,
Thanks for the response..
This 24VAC is actually driving a contactor coil through a relay which is kept close to the board..i need to log in the memory the status of this 24VAC..so the circuit is provided before the relay to monitor it continously(either ON or OFF or between 0-24VAC)..If i use a diff amp or Opto i can precisely measure it..there is no space for providing a stepdown/isolation transformer on the board to provide the required isolation of 1.5kV. If i use a bridge rectifier, in case of fail short it would be safety critical.i need to consider the fail condition also. ie the circuit connected has to be safe in case of fail short or open..ie why i considered opto and diff amp..opto if fail short i will not get pulsating waveform at output and for diff amp i can provide protective impedance using resistors that will always fail open..but i want to know which is good in noisy environment and techniques for working good in noisy environment..
 

Thread Starter

bbkv_tom

Joined Jul 20, 2009
4
Since the 24VAC line is going to a contactor though a relay whenever the relay opens and closes the line..there will be huge voltage spikes..how can i reduce the effect of that when i'm using opto or diff amp circuits..
 

Papabravo

Joined Feb 24, 2006
21,157
Oh, I thought you were interested in the actual voltage of the waveform. If you just want a digital output for ON/OFF then look at the AC Input modules for Opto-22 or WRC. IIRC they use a bridge rectifier to convert the AC to DC. I'm not sure there is another way, but if you find one more power to you.
 

pilko

Joined Dec 8, 2008
213
Use voltage devider and diode to reduce voltage to 5V peak positive pulse. Put this signal into uC. Mesure pulses per second, and then >X = high; <X = low.
 

Papabravo

Joined Feb 24, 2006
21,157
Use voltage devider and diode to reduce voltage to 5V peak positive pulse. Put this signal into uC. Mesure pulses per second, and then >X = high; <X = low.
The diode can be part of an opto isolator, and you don't really need the divider, just a series resistor. The diode needs to be able to withstand the reverse bias but this is not generally a problem.
 

THE_RB

Joined Feb 11, 2008
5,438
I've got some AC optocouplers here. The LED side is actually 2 LEDs reversed, so the LED operates off AC. You would only need a resistor to connect it to your 24v AC supply.

These type of optocoupler are commonly available.
 
Top