+ Post New Thread
Results 1 to 14 of 14
  1. #1
    Newbie level 4
    Points: 142, Level: 1

    Join Date
    Apr 2019
    Posts
    6
    Helped
    0 / 0
    Points
    142
    Level
    1

    In accuracy in AC Voltage measurement

    I want to measure the AC voltage through controller (ESP32). So, I have designed a schematic which is attached. As per as my calculation, for 230VAC voltage. the voltage after the divider should be 2.76V. But, practically I am getting 1.9V. Similarly, with 110VAC I am getting 1.2V in practical.

    Why I am getting such inaccurate voltage after the divider?

    •   AltAdvertisement

        
       

  2. #2
    Super Moderator
    Points: 263,357, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    46,008
    Helped
    13993 / 13993
    Points
    263,357
    Level
    100

    Re: In accuracy in AC Voltage measurement

    Main problem is Z-diode leakage current. Diode characteristic isn't that steep as you apparently expect. Additionally may be ESP32 input current.



  3. #3
    Newbie level 4
    Points: 142, Level: 1

    Join Date
    Apr 2019
    Posts
    6
    Helped
    0 / 0
    Points
    142
    Level
    1

    Re: In accuracy in AC Voltage measurement

    Thanks for the suggestion. I have measured the voltage after removing the Z-diode. Now, I am getting the accurate voltage after the divider.

    Actually, I have used the zener diode to avoid any over voltage to the Controller. So, as the leakage current of the Z-diode is creating problem, so what can I use instead of Zener for over voltage protection in this case?



  4. #4
    Super Moderator
    Points: 263,357, Level: 100
    Awards:
    1st Helpful Member

    Join Date
    Jan 2008
    Location
    Bochum, Germany
    Posts
    46,008
    Helped
    13993 / 13993
    Points
    263,357
    Level
    100

    Re: In accuracy in AC Voltage measurement

    ESP32 maximum ratings suggests that IO pins have clamping diodes, but there's no current rating. For additional safety, you may place external clamping diodes (low leakage schottky or general purpose silicon diodes) and a series resistor (e.g. 1k) between clamped voltage and analog input. Or use an external buffer.

    As a side remark, your measurement circuit can only work if either the AC voltage is isolated against circuit ground (transformer) or the circuit ground is floating.



  5. #5
    Newbie level 4
    Points: 142, Level: 1

    Join Date
    Apr 2019
    Posts
    6
    Helped
    0 / 0
    Points
    142
    Level
    1

    Re: In accuracy in AC Voltage measurement

    Thanks for the reply. But what I need is over voltage protection. As you suggested, How a schottky diode and a resistor in series between clamp voltage and analog voltage without using the zener diode? I am not able to understand the schematic what you suggested.



  6. #6
    Super Moderator
    Points: 80,212, Level: 69
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    16,271
    Helped
    3691 / 3691
    Points
    80,212
    Level
    69

    Re: In accuracy in AC Voltage measurement

    Hi,

    there are many discussions, documents and even videos about overvoltage protection with clamping diodes. I assume millions.
    Just do a search.
    Even here in the forum are many threads.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



    •   AltAdvertisement

        
       

  7. #7
    Advanced Member level 5
    Points: 15,212, Level: 29
    schmitt trigger's Avatar
    Join Date
    Apr 2013
    Posts
    2,529
    Helped
    813 / 813
    Points
    15,212
    Level
    29

    Re: In accuracy in AC Voltage measurement

    The semiconductor companies sell double diodes which are specifically designed to protect microcontroller inputs from an overdrive.
    These have low leakage and low Vf.

    Having said that, if your application is going to be used mostly at room temperature, even a low cost dual schottky like the BAT54S can be employed.
    My batteries are recharged by "Helpful Post" ratings.
    If you feel that I've helped you, please indicate it as a Helpful Post



  8. #8
    Super Moderator
    Points: 80,212, Level: 69
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    16,271
    Helped
    3691 / 3691
    Points
    80,212
    Level
    69

    Re: In accuracy in AC Voltage measurement

    Hi,

    even a low cost dual schottky like the BAT54S can be employed
    ST BAT54S datasheet says:
    * typ: 0.05uA @ 5V and 25°C.
    * typ: 0.45uA @ 5V and 50°C.

    I assume this error may be a factor of 1000 better than a 5.1V zener diode (in breakdown direction).

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  9. #9
    Newbie level 4
    Points: 142, Level: 1

    Join Date
    Apr 2019
    Posts
    6
    Helped
    0 / 0
    Points
    142
    Level
    1

    Re: In accuracy in AC Voltage measurement

    I have design my circuit with Diode clamp. I have used BAT54S to clamp the voltage at 3.6V. But, the main concern is that we are not going to use the circuit in room temperature. So, is there any possibility of leakage current in the new circuit ? Also, I have used 1K resistor as shown in figure. Is it OK? Please advice.

    Click image for larger version. 

Name:	SCH_New.jpg 
Views:	2 
Size:	37.7 KB 
ID:	156762



  10. #10
    Super Moderator
    Points: 80,212, Level: 69
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    16,271
    Helped
    3691 / 3691
    Points
    80,212
    Level
    69

    Re: In accuracy in AC Voltage measurement

    Hi,

    * I gave the leakage current at 50°C
    * You worry that you use it not only at room temperature. This is somehow useless information.
    What temperature else? -50°C? +100°C? +300°C?
    * ESP32 analog input refers to GND, but your circuit does not show GND
    * I recommend to use a noise filtering capacitor

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  11. #11
    Newbie level 4
    Points: 142, Level: 1

    Join Date
    Apr 2019
    Posts
    6
    Helped
    0 / 0
    Points
    142
    Level
    1

    Re: In accuracy in AC Voltage measurement

    Thanks.
    - We are going to use it from +40°C to +70°C. According to this conditions, Is my circuit will able to measure the AC voltage accurately (1-2%).
    -Check the ground (GND). I have connected the capacitor (0.22uF). I think, it is OK?
    - Is 1K resistor in series with the Ferrite bead (270K) is fine as shown in figure?

    Click image for larger version. 

Name:	SCH_2.png 
Views:	3 
Size:	308.4 KB 
ID:	156763



    •   AltAdvertisement

        
       

  12. #12
    Super Moderator
    Points: 80,212, Level: 69
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    16,271
    Helped
    3691 / 3691
    Points
    80,212
    Level
    69

    Re: In accuracy in AC Voltage measurement

    Hi,

    Is my circuit will able to measure the AC voltage accurately (1-2%).
    I assume what you want to ask about is precision, not accuracy.

    My answer is: No.
    Not because the ferrite bead, the 1k, or the BAT54. No, mainly because of the measurement method.

    AC measurement, different techniques and their precision problems have been discussed here in the forum many times.
    Just do a forum search.

    Your analog circuit is close to the "rectified average" method. The expected ripple is less than 1LSB (but it's measurement response time is very slow). I assume you want to show the result as "RMS" value. But you may use "rectified average method" only when you have known and stable waveform. As soon as there is some distortion/modification on the waveform you will see a difference (error) between your value and true RMS value.
    For variable waveform: no other measurement method can replace true RMS method.

    Diode error:
    Your source impedance is mainly determined by the 10k resistor...with the 1k in series it makes about 11k.

    You don't tell about ADC input range, thus I just take 3.3V as example.
    2% of 3.3V is 66mV allowed error. (Percent calculation)
    66mV at 11k means 6uA. (Ohm's law)
    Thus your allowed diode leakage current error is 6uA. (Both dides in combination, where one diode compensates a part of the other diode current. Worst case points are at GND and VCC)

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



  13. #13
    Newbie level 4
    Points: 142, Level: 1

    Join Date
    Apr 2019
    Posts
    6
    Helped
    0 / 0
    Points
    142
    Level
    1

    Re: In accuracy in AC Voltage measurement

    Thanks for the valuable suggestions.

    What I exactly want know how accurately I can measure the AC voltage with the new Schematic (Clamp Diode method)? Because, previously for 230VAC, instead of 2.76V I was getting 1.9V at the ADC pin.

    I will definitely search the different methods of AC voltage measurement.



  14. #14
    Super Moderator
    Points: 80,212, Level: 69
    Achievements:
    7 years registered
    Awards:
    Most Frequent Poster 3rd Helpful Member

    Join Date
    Apr 2014
    Posts
    16,271
    Helped
    3691 / 3691
    Points
    80,212
    Level
    69

    Re: In accuracy in AC Voltage measurement

    Hi,

    Again: Precision or accuracy?

    Again: there is no general answer, because we donīt know your exact waveform, whether there is (variable) distortion, noise and so on...additinally again: we donīt know your ADC input range.

    ****
    What you say "AC voltage" .. I assume you mean "AC RMS voltage". If so, then the best way is to measure/calculate RMS voltage. Everything else means you accept errors.

    Klaus
    Please donīt contact me via PM, because there is no time to respond to them. No friend requests. Thank you.



--[[ ]]--