RMS to ADC - measure ac voltage using Arduino.

Discussion in 'Embedded Systems and Microcontrollers' started by Randa Mohamed, Nov 22, 2015.

  1. Randa Mohamed

    Thread Starter New Member

    Jun 19, 2015
    25
    0
    Hello everyone

    I'm trying to measure ac voltage using Arduino, I'm using a step down transformer (12Vrms output) as a voltage sensor, i'm having trouble in conditioning this signal to the ADC pin. Please give me your suggestions.

    Thanks
     
  2. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,526
    2,369
    Wind on a 5 or 6 turn secondary on the Tfmr and use a bridge an a small cap to monitor/measure the AC peak.
    Max.
     
  3. Randa Mohamed

    Thread Starter New Member

    Jun 19, 2015
    25
    0
    @MaxHeadRoom so you mean i need to step 12Vrms to 5Vrms using voltage divider then rectify and add a small cap ?? I have another question, how about using opamp ??
     
  4. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,526
    2,369
    No voltage divider, you may get away with just 4 turns.
    I would try that method before adding opamps etc.
    Max.
     
  5. Randa Mohamed

    Thread Starter New Member

    Jun 19, 2015
    25
    0
  6. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    What aspect of the AC voltage are you trying to measure? Vpp, Vrms, Vave???

    @MaxHeadRoom 's method is rife with errors. If you step down the voltage, the forward drops of the rectifiers will make the voltage at the ADC input very non-linear with respect to the actual amplitude of the AC waveform. You would actually be much better starting out with hundred volt AC signal, full-wave rectifying it, filtering it, and then using a voltage divider to adapt it to the allowable range for the ADC. This method makes the forward drops of the rectifier an insignificant fraction of the total voltage...

    The alternative is to start with a small AC voltage, and then use an opamp precision rectifier circuit that does not suffer from the rectifier forward voltage drops.
     
    Last edited: Nov 22, 2015
    Randa Mohamed likes this.
  7. Randa Mohamed

    Thread Starter New Member

    Jun 19, 2015
    25
    0
    @MikeML
    I'm trying to measure Vrms only, I just don't get how would the ADC measure the voltage if i rectify it and smooth it using the capacitor. It looks more like im building a DC source just without the voltage regulator IC.

    I'm actually trying to measure mains voltage and i need isolation that's why im using a transformer.

    I will research about precision opamps, thanks a lot
     
  8. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    It is quite difficult to measure true RMS. If the waveform is sinosoidal with not much harmonic distortion, it is much easier to use an opamp precision rectifier followed by a filter to get the average value, and then just multiply by the appropriate scaling factor and call it good...

    In that case, use your existing transformer, followed by a resistive voltage divider to reduce the amplitude of the signal. Use modern rail-to-rail opamps, and you can likely power them from your Arduino 5V...
     
    Randa Mohamed likes this.
  9. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Here is a conceptual model of what you need to do...

    146.gif
     
    Randa Mohamed likes this.
  10. Randa Mohamed

    Thread Starter New Member

    Jun 19, 2015
    25
    0
    @MikeML

    Which software did you use here ?

    From the picture you posted, i should do the following:

    Transformer(12V) to Voltage Divider(5V) to Precision Rectifier then to Low Pass Filter to spans matching circuit to ADC
     
  11. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    Note transformer output is really +-1.414*12
    How long can you wait for the filter to settle?

    LTSpice.
     
  12. Randa Mohamed

    Thread Starter New Member

    Jun 19, 2015
    25
    0
    Yes transformer output is peak-to-peak

    For the settling time im not sure but 4RC is good enough
     
  13. Randa Mohamed

    Thread Starter New Member

    Jun 19, 2015
    25
    0
    One more question, does this method work if i use a current transformer with a burden resistor ?

    Thanks
     
Loading...