Best option for measuring AC voltage using uC

Discussion in 'General Electronics Chat' started by bbkv_tom, Nov 10, 2009.

  1. bbkv_tom

    Thread Starter New Member

    Jul 20, 2009
    4
    0
    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.
     
  2. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,790
    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.
     
  3. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
  4. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,790
    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.
     
  5. Duane P Wetick

    Active Member

    Apr 23, 2009
    408
    19
    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
     
  6. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    From the 1st line of our OP's 1st post:
    It looks to me like they are already contemplating isolation, besides - 24vac would be the secondary side of a current transformer.
     
  7. bbkv_tom

    Thread Starter New Member

    Jul 20, 2009
    4
    0
    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..
     
  8. bbkv_tom

    Thread Starter New Member

    Jul 20, 2009
    4
    0
    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..
     
  9. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,790
    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.
     
  10. bbkv_tom

    Thread Starter New Member

    Jul 20, 2009
    4
    0
    Thanks bravo
     
  11. pilko

    Active Member

    Dec 8, 2008
    213
    20
    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.
     
  12. Papabravo

    Expert

    Feb 24, 2006
    10,140
    1,790
    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.
     
  13. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    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.
     
Loading...