Electronic – Measure AC Sine Wave amplitude with ADC

acadcanalogsinewave

I have created an AC sine way using a wien-bridge network.

I would like to measure the peak to peak voltage of this wave using my microcontrollers ADC.

I cannot just use this wave as an input to my Analog Input pin, as of course the electrical specification specifies no negative voltages, and I would only get a snapshot of the wave, and would have to take many measurements and take the max one.

I am looking for some discrete components I can pass this wave through to get a simple DC voltage representing the Peak to Peak (or just the positive) voltage of this wave.

Best Answer

One way is to use a peak detector, but this has a diode voltage drop, which gives an error in the result.

You don't say anything about frequency, but I'll assume it is much lower than the ADC's sampling frequency.

I would use a resistive voltage adder to bring the full signal within the ADC's range. The resistive adder has the advantage over the capacitively coupled adder that you don't have to take frequency-dependent attenuation from the capacitor into account.

enter image description here

Suppose the ADC has a 0 V to 5 V range, and your signal is maximum 10 V peak-to-peak. Then you want Vout to be 0 V for -5 V input, and as close to +5 V as possible for +5 V input. The latter means that R1||R2 should be much smaller than R3. The former means that R1 should be equal to R2: if the input is zero then there's no current through R3, and R1 and R2 form a resistor divider between -5 V and +5 V. So if we choose R1 = R2 = 1 kΩ and R3 = 47 kΩ then the output signal will swing between 0 V and 4.95 V.

Now take enough samples to find the minimum and maximum values, and multiply the difference by 10 V/ 4.95 V, that will give you the peak-to-peak value.