AC voltage Measurement Problem

Status
Not open for further replies.
Don't forget the compiler used is MikroC and it identifiers aren't case sensitive
Float i is the same as Float I
Aparently intended as a concession to C beginners. CCS C is doing the same. Both have also an option to enable standard C case sensitivity. Strongly recommended in my view, for code portability and avoiding to contract bad habbits.

By the way, there are open questions left about your code and circuit, presumed you didn't yet solve the problem.
 

Another good reason for me not to use that compiler!

Regardless of it's non-compliant case sensistivity, it would be better to use the same case for each instance of the same variable so the code is compatible with other compilers and systems.

BRiaN.
 

As input is rectified AC with insufficient filtration. ADC samples are taken at different points of strong 100Hz ripple superimposed on DC. That's why reading fluctuates. If filter capacitor is enough to smooth 20 pulses, you can take still take 5 samples per second which is enough for a AC voltmeter. If you need fast sampling then detect zero crossing and take sample of peak voltage after a delay determined by the frequency.
 

"strong 100Hz ripple" ???

1uF is more than sufficient to hold the DC steady. The current through the ADC potential divider is quite small and it will also divide any ripple on the DC.

If you use a larger capacitor it will make the measurement less responsive to downward changes.

Brian.
 

Input to ADC is only 0.2V max with 2mV ripple.
Yes, that's what we can expect according to the schematic in post #7. I agree that a huge relative uncertainty won't be surprizing with this low ADC drive. But according to the code in post #1, the ADC level should be much higher, about 50 % of full range. Unfortunately the op didn't yet manage to clarify this simple point.
 


Input to ADC is only 0.2V max with 5mV ripple. Input should be near 4V for good resolution.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…