# Digital Voltmeter Using Arduino

20,890

36

3

Voltmeter is used to measure voltage in circuit,Analog voltmeter have 5% error, it shows the approximate value ,where the digital voltmeter gives exact value of voltage in circuit.Voltage is measured using voltage divider circuit.this voltage meter can measure both AC and DC value

### Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

## Step 1: HARDWARE:

Hardware require to measure voltage is voltage divider circuit ,divider circuit consist of resistor ,value of resistor based on the input voltage to be measured to measure 100v voltage measurement ,10k resistor in series with input voltage and 520ohms resistor on end is connected to ground and another end is connected with 10k resistor and zener diode 5.6v is connected at a node to limit voltage

VOLTAGE DIVIDER

## Step 3: Code Part

int curr_value = 0;

int acc_value = 0;

float disp_res;

float supply = 4.91;

float coeff_v100 = 1.01;

volatile unsigned long last_millis = 0;

void setup()

{

Serial.begin(9600);

}

void loop()

{

V_100();

}

void V_100()

{

Serial.print("V-meter V=<100V");

Serial.println("* Voltmeter mode - Range 0 - 100 V *");

voltage_meas();

}

void voltage_meas()

{

acc_value = 0;

for (int i=0; i <= 15; i++)

{

acc_value = acc_value + curr_value;

}

curr_value = int(acc_value/16);

disp_res = ( curr_value*supply*20)/1024*coeff_v100 ;

Serial.print(" V = ");

Serial.print(disp_res, 2);

Serial.print(" V");

Serial.print("* V = ");

Serial.print(disp_res, 2);

Serial.println(" V");

delay(250);

}

## Recommendations

81 4.4K
193 11K
32 4.3K ## 3 Discussions

Zener diode D1 will cause a non-linear reading when the voltage of the resistor divider gets closer to 5V . Diode D2 will cause a 0.6 - 0.7V volt drop, which will cause errors in the displayed voltage.

I do not use a zener diode or reverse polarity diode after the resistor divider. It will be more accurate if you use a bridge rectifier to rectify the AC, then smooth the signal with a cap. Thereafter, put in the resitor voltage divider.

Nice stuff! In the lower range, at 50V, it seems the error is larger.

Probably you'll get that one better if you use a tantalium or electrolytic capacitator and 4 diodes for rectifying. And, (don't know it really, I'm quite new at Arduino), you should also take in account the internal resistor of the input, if it is smaller than 10K or so. Since you make it parallel over the lower resitance of R2. If you keep the resistor ratio the same, but take higher resitor values (even 1MOhm for R1), the accuracy would be better at lower voltages, since the current through the resistors will be a lot smaller.

Greetings from Marc.