DIY VOLTMETER USING ARDUINO ADC

This post helps to DIY yourself a high precision multimeter using Arduino. The UNO already comes with an excellent 10-bit ADC which is enough, but I recommend using an external ADC of 16-bit if you want to take it to serious measurement.
But you don’t want you use it as replacement for a multimeter, buy a good multimeter instead of it. This Arduino based one is helpful for projects and static voltages that doesn’t change over the time. 
We can create a voltage divider hence We can measure voltage drop between the divider and hence multiply with resistance to get the VIN. Here I’m using a 1Kohm and 2.2KOHM resistance to measure max voltage of 5V. If want to measure the higher voltage use the following formula to adjust the resistors.

 Vout = VIN * (R1R2/R1+R2)

[NOTE:  This voltage “VOUT” should not have to be more than 5v, I recommend VOUT<less than 5V is safe to use].

Sounds easy because it is, but V_IN cannot be measure hence we need ADC to do trick, the 10-bit adc can measure any voltage between 0.5v – 5v , hence according to the voltage we’ll get somewhere between 0 to 1023 (2^10 =1024),

If we use 16-bit we have more resolution hence can even measure precise and fine according to “NYQUIST_SAMPLERATE”, the UNO board have ADC reference pin we can use it also to increase precision rate and decrease the error rate. The ordinary 6000 count multimeter are good one can measure voltage with +-0.1 error, the Arduino multimeter can also have -+0.1 precision.

Here the ADC voltage can be calculated by the is formula:

ADC voltage= (ref_Volt * adc_value) / 1024.0;

By default the Arduino have reference voltage as 5V but it is not exactly precise hence to increase the precision use external voltage reference voltage.

[NOTE: this reference external voltage should not have to be more than 5v, I recommend <less than 5V that’s safe use a good multimeter like fluke to supply 3 decimal precise voltage for reference to get high precision.]

Connect the voltage divider output to ADC pin A0 and connect Arduino to serial monitor.




HERE i'm using coin cell as 3.3v AREF could anything between 1.2v to 5V  you can even use arduino 3.3V output also but remember to enter correct value in for atleast 3 decimals. 

Here is the code:

1.     int adc_pin = A0;

2.     float adc_In = 0.0;

3.     float In_Volt = 0.0;

4.     float ref_Volt  = 3.321;

5.     int adc_value = 0;

6.     float R1 = 1000.0;

7.     float R2 = 2200.0;

8.     void setup()

 	{

9.     Serial.begin(9600);

10.    pinMode(adc_pin, INPUT);

11.        }

12.    float Measure()

13.  {

14.    adc_value = analogRead(adc_pin);

15.    adc_In = (ref_Volt * adc_value) / 1024.0;

16.    In_Volt = adc_In / (R2 / (R1 + R2));

17.    delay(1000);

18.    Serial.print("measured voltage is:");

19.    Serial.println(In_Volt, 5);

20.    //Serial.println(analog_Volt,5);

21     // Serial.println(analog_In);

22.    }

23.     void loop()

24.   {

25.     float Measure();

26.     }

Comments

Post a Comment

Popular posts from this blog

"Kernel Panic” error After upgrading Parrot OS

HACK HC-05(BLUETOOTH MODULE) FRIMWARE INTO HID FRIMWARE

HACK AND CLONE CAR KEY FOB, MY EPIC FAILURE...!!