I'm using a MCU ADC, PIC18F26K22, to sample and calculate a RMS value of a sine wave that is rectified by the full precision rectifying circuit in the schematic below. This ADC has 10 bits and I'm sampling at 50 kHz. The signal is 2 kHz and at the ADC input has 700mVp. This voltage was measured with a digital oscilloscope.

I already did the compensation for Gain and Offset errors, using DC voltages and a very good quality multi-meter, but when I'm sampling this sine wave I'm having a very poor accuracy in the results, for instance, in 700mVp Sin Wave the ADC is sampling peak values of ~620mV. I'm using the internal voltage reference of 2.048V, which guarantees a low error.

So, I'm really clueless about what could be done to solve this, I already increased the acquisition time, with the cost of reducing the sampling frequency, but still the voltage peak values do not change.

What is the cause of the incorrect peak voltage? How can I fix this problem?

Full Wave Rectifier

  • \$\begingroup\$ Is there a reason you're trying to do the RMS-DC in the digital domain? \$\endgroup\$ – ThreePhaseEel Sep 7 '16 at 22:23
  • 2
    \$\begingroup\$ Regarding the ADC performance: A poor circuit layout, improper routing/separation of analog/digital MCCU/ADC powering, bad grounding, presence of switching loads and regulators can be raise the noise level, thus reducing the ENOB (Effective Number of Bits) of ADC. For example, a 12 bit ADC can, really works as 8 bit. Also, there is also difference between accuracy and precision. \$\endgroup\$ – Dirceu Rodrigues Jr Sep 7 '16 at 23:04
  • 3
    \$\begingroup\$ Check the silly stuff first: (1) IC3-A has to swing negative as it's in inverting mode. What's the chip's negative supply rail? (2) Can you measure the negative DC voltage after the upper diode? \$\endgroup\$ – Transistor Sep 7 '16 at 23:08
  • 1
    \$\begingroup\$ Start with the obvious. The ADC says you're only giving it 620 mV. Is this true? That is, what does the ADC input look like on a scope? \$\endgroup\$ – WhatRoughBeast Sep 8 '16 at 0:12
  • 2
    \$\begingroup\$ R13 should go to the SINEWAVE input, not pin 4 of IC3-A. \$\endgroup\$ – Bruce Abbott Sep 8 '16 at 0:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.