Hi All,
most has been already said, but a few points to the remarks of other posters, thanks by the way.
One safety point to start: by any sort of voltage (current) measurement please be sure that the complete supply to the PIC etc. is either floating or that grounds of both circuits (Voltmeter and Circuit to be tested) are connected to the same level.
To measure low AC voltages (< ca. 10V) accurately by rectification it is necessary to use ideal diodes. Normal diodes will have a forward drop voltage of ca. 0.6V (silicon) or ca. 0.3V (germanium). Best here is to use two OPs with diodes in the feedback, trimmed to 0V. For those who wish, I will be happy to supply circuits etc.
OP use has the additional advantage of common mode rejection and quasi-floating inputs. It also allows good frequency compensation and, of course, fine adjustment.
To avoid such circuitry it can (with a bit of fiddling) be done by setting the PIC power supply ground to have an offset to the half of the AC peak to be measured. Set a resistor divider chain so as to arrange for an AC signal of not more than +/2.5V at an ADC input.
Read this input as fast as possible at a consistant frequency. While the e.g. PIC16F877 has a 10 bit ADC, you will have an accuracy of not more than 9 bit, so if you measure 300 V you will have a maximal possible accuracy of ca. 0.6V.
With a 4 meg oscillator and a sample time from say 50 uS you could have a theorectical sample rate of 20 K/S, at 50 Hz a read of 400 per cycle. By adding all values from lowest to highest each cycle, a value can be calculated that will represent the AC voltage.
By measuring how many reads are possible in the one sweep, a rudimentery frequency value can be detected. By adding new volt and frequency values to the old and dividing by two, each value is averaged and will become more accurate with time. This accuracy will be maintained up to Nyquist, which put very simply says that if you can't have more than one sample per half-wave, you can't measure it. (Not completely right, I know, but good enough for now.)
If any are interested, let me know with details of max. V, max. F and accuracy and I will be happy to help.
Greetings,
Rob
Bookmarks