accurate digital AC voltmeter

I have made Ac voltmeter for range 170-250V ,but it is not accurate as i need ,it has problem that lower the voltages greater will be the error... this is the code given below: int grid=12; int m; int n; void setup() {

pinMode(A0,INPUT); Serial.begin(9600);

} void loop() {

volt(); disp();

} void volt(void) { m=analogRead(A0); n=(m*.2490039840637); //conversion } void disp(void) { Serial.print(n); Serial.println("volts "); }

I only can see code for a primitive DC voltmeter, neither AC nor accurate.

is it possible to make 99.9% accuracy with arduino?


But you should understand AC first, before you try to measure it.

i have already understand it,but it shows 227V instead of 220V,,huge error..made circuit using stepdown T/F ,voltage divider and diode and capacitor. at 250V limit i have 4.90V DC at analog pin of arduino

227V instead of 220V,,huge error..

That's not a "huge" error... What's your reference voltage, and is it stable?

Subtract-out* the diode drop (about 0.7V) and simply adjust your "conversion formula" to calibrate-out the error.

If you don't have it already, put a resistor across the capacitor to keep the analog input from floating-up.

  • Actually, add 0.7V before calculating your new calibration factor because the real voltage is 0.7V higher than the reading.