Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Calculate RMS voltage to the input of an ADC of a microcontroller

Status
Not open for further replies.

francisco6329

New Member
Hi, I have a problem I never tried with an AC voltage to the input of an ADC. I learned more information about the sample and hold circuits, which are used to overlay (DC offset) AC waveform on a DC, and so would take the negative cycle for consideration by the ADC.

Vrms = sqrt (Sum (X2 - X) / N)

Where X is the voltage value in a given sample, and N is the number of samples.

Please know how many samples would help me perform, in that time making them, whether this is the right formula, and a possible reference circuit for a 5 V
 

Attachments

  • mesure current with CT.png
    mesure current with CT.png
    74.9 KB · Views: 373
It looks as though you are trying to measure current not voltage. Is that right?

On your circuit, you are making things a lot more difficult for yourself by having such as small resistor for R4. You are also making extra work by connecting one side to ground, rather than your reference voltage.

In the maths on the microcontroller, it is likely that there will be a non-zero ADC reading when there is no current. If we call that X0, and the reading is X1, then the rms voltage for N samples is:-

Vrms = sqrt(Sum((X1 - X0)^2) / N)

So if the zero reading is 1000 counts, and you have readings of 1001, 1002, 1003 and 999,

then the offset readings are 1, 2, 3 and -1
those squared are 1, 4, 9 and 1
the sum is 15
the average is 3.75
the RMS value is 1.93

That has to be divided by however many counts above 1000 you get for 1 V input.
 
I want to measure both current and voltage at the output end of the CT and PT, there will be an AC voltage, except that one is going to be bigger than another.

So are you saying that I increase the value of resistor R4, to further increase the voltage to sensing. But underside of connecting one side of R4 to ground, connect the reference voltage, due to saving circuitry.

modify the image to know if that's how you say
 

Attachments

  • POSIBLE.JPG
    POSIBLE.JPG
    15.9 KB · Views: 248
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top