Introduction: Digital Voltmeter Using Arduino

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

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 2: Digital Voltmeter Output

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++)

{

curr_value = analogRead(A0);

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);

}

Comments

author
Eric+Brouwer made it!(author)2015-06-02

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.

author
marc.deloor.5 made it!(author)2015-05-28

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.

author
tomatoskins made it!(author)2015-05-27

This is great! Thanks for sharing!

About This Instructable

18,052views

37favorites

More by sathishk12:interface relay with arduinointerface lcd with arduinointerface keypad with arduino
Add instructable to: