You're all close, but not quite on the mark. Putting the diode in will rectify the noise, and all you will be measuring is peak noise.
PIC_USER was close, but if you removed D1, C2, R3 and R4 then you will be creating a potential divider with a low pass filter, and be measuring the average voltage. I would however add a zener diode where R3 is to prevent any overvoltage problems, say a 5v6.
Values of R1 / R2 would depend on how high you wish to make the impedance, but to get a decent RC timeconstant I would be looking around 68k for the top and 5k6 for the bottom, works out as around 3.8volts into the A2D pin from 50v.
This would filter off most of the noise above 15hz with a 1uF capacitor.
Other option is to A2D the full bandwidth and do some averaging in software and calculate the RMS value. But thats not easy and is heavy on register resources.
Hope this helps.
Timmers.
Bookmarks