yeah thanx..
but however, i need to calculate the ac power, not dc.. is there anything i cn do with the rectified signal so that i cn obtain the actual ac power??
i mean if i get a value from 0-5volts from the adc, then, it is a discrete dc value rite??
sorry coz im a little bit confused when it comes to ac power
If its a 'good' sinewave then the RMS value after precision rectification will be 0.707 of the peak value of the rectified and smoothed signal.
You will see in the 'prec rect' circuit that the peak value is reduced to half , ie 50%.
Say you amplified this rectified/smoothed signal to bring it back to 100% this when multiplied by 0.707 would give the RMS value.
Example: say the sensor gave 2Volts peak to peak 'ac' signal
after the prec rect the signal would be 0.5V from 0V to its peak value, assume that we amplify this signal by 2, so it becomes 1V, from 0V to its peak.
Its now the same amplitude as the original, but full wave rectified.
Lets now assume that we smooth the signal so that a capacitor charges to the peak voltage of 1V.
The adc will read this as 1V, the program could multiply this value by 0.707 which would give the original RMS value, the value you need to calculate the power.
So you can see that by rectifying the signal, smoothing it its possible to adjust the amplification to give the RMS or peak value of the sinewave input to the PIC's adc.
Do you follow that OK.?