Andres, A half wave rectifier will drop .7 volts. A full wave bridge will drop 1.4 volts. I recommend that you rectify the voltage *before* reducing it with a resistor divider circuit. That way you will lose .7v out of 120 volts instead of .7 volts out of 5 volts! As to filtering using a capacitor, that is useful *if* you can tolerate a response time of a fraction of a second or so. (You would *not* want to alter the response time in any way if you are specifically looking for voltage droputs, line glitches, etc.) I take it you just want to monitor the line voltage and give a readout that tells the approximate RMS voltage. As long as the waveform is a sine wave, you can actually monitor the PEAK DC and convert this directly (via your look-up table) to the corresponding RMS value. 120 VAC >---------->|-*----| (Hot) | | | R2 150K + | | 25K pot 1 ufd === POT------> 250 vdc | | | R1 5.00K | | 120 VAC >-------------*----*------> Let's assume you want to be able to read voltages from 0 to 127.5 volts AC RMS. (255/2=127.5) 127.5*1.4142135=180.3122213 PEAK Subtract one diode drop to get the actual peak output 180.3122213-.7=179.6122213 or 179.61 is accurate enough. If we want the max output to the PIC A/D input to be 5.00 volts when there is 179.61 peak dc volts, then we need two resistors that have the ratio (179.61-5.00):5.00 Since it is difficult to get resistors having the ratio 172.61:5.00 it makes sense to form the R2 resistance from TWO resistors, one of which is variable. I would use a 150K resistor in series with a 25K multi-turn potentiometer for R2, and a 5.00K resistor for R1. I would take the output from the wiper of the pot. [When calibrating the unit later, apply a known AC RMS value and adjust the pot for the closest displayed value. Note that in this case the increments are in .5 volt steps, so don't expect greater than +/- .5 volt accuracy!] Scaling is very straight-forward: 127.5 V AC RMS in will yield a count of 255 from the A/D converter. This corresponds to .5 volts per count. In this case a lookup table can be dispensed with, since you can arrive at the correct value by shifting the count to the right, and masking the MSB. This will divide the value by two. (If the original LSB is a "1", then the decimal point value is ".5" otherwise it is ".0") [If you decide to use a lookup table, you can then correct for the .7 volt diode drop within the table. In this case I would recommend coding the decimal point portion in the MSB immediately. That will save you the shift operation later.] The algorithm for the RMS input value corrected for .7 volt diode drop is: InputRMS=(MeasuredPeak+.7)/1.4142135 Again, you can code the portion after the decimal point into the MSB or LSB as desired. ************** There is another kind of meter that is also quite useful, and that is the expanded range meter. Let's say you are really interested in the range from 100 to 125.5 That is a VARIATION of 25.5 volts and we can use 255 counts to represent 25.5 with an accuracy of .1 volts. This type of expanded range meter requires that you have some method of "removing" the initial 100 volts. There are a number of ways this can be done using op amps and "scaled down" voltages so that the output will go from 0 to 5.00 volts for an input change from 100 to 125.5 volts. (by the way, I choose voltages that scale well to the value 255 on purpose, so that we can get a scaling factor that maps well to the inherent 0-255 count of the 8 bit A/D. Other scale factors can be chosen, but they are not as clean and simple) There is also a simple method using a Zener diode, but it is limited to the accuracy of the Zener, and it has a certain amount of sloppiness in the output depending on the sharpness of the Zener at the chosen current level. Regardless of which method is used to remove the 100 volts, the hardware/software simply adds it back in by displaying a leading "1" in the hundreds position. This digit can be blinked when there is an under or over voltage condition. I have to get something to eat, so I will terminate this post now, but if there is interest in the expanded range method, I could write some more about that later. Of course, if there is no interest, then I will just save myself the trouble and do something else with my time. Fr. Tom McGahee