Arduino based Volt Meter 0-50V DC
0-50V DC Voltmeter using
Arduino & Seven Segement Display
Introduction:
This time we will be interfacing Arduino
to measure voltage ranging from 0-50V
with almost no error at all. This DC voltmeter is linear with voltage
and shows linear characteristics from 0.01 Volt to 50 Volt. Voltage
beyond 50 Volt isn’t measurable by it. The above figure shows the 0-50V DC
Voltmeter using Arduino and Seven Segment Display.
The Arduino inbuilt 10 bit ADC, can be used for measuring the 0-50V. measured DC voltage can be seen on Serial monitor
Parts & Components:
- Arduino UNO Board
- Bread Board
- Resistors – 10K & 100K
Design & Explanation:
The voltage
divider circuit is used to divide voltage into two parts, out of which one
is fed to the input analog terminal of Arduino. Internal reference voltage as
Vref 1.1V of Arduino is selected for measurement.
The
resistor R1and R2 forms the voltage divider which is connected to analog input
pin A0 of Arduino.
at the A0 pin, is used for high voltage protection
for Arduino.
Vout = (R2 / R1+R2 ) * Vin.
If Vin is
50V then
val = analogRead(A0);//reads the analog input
Vout = (val * 5.00) / 1024.00; // formula for calculating voltage out i.e. V+, here 5.00
Vin = Vout / (R2/(R1+R2)); // formula for calculating voltage in i.e. GND
The same
project can also be implemented using Atmega328 micro-controller. All you need
to do is replace the Arduino Board with Atmega328 micro-controller, with addition
of few more components as in the circuit diagram below.
Programming & Source Code:
Here is a
code for 0-50V DC Voltmeter using Arduino. The programming is written in the
Arduino language and the same program is applicable for both circuits. For the
first circuit, you can directly upload the program. And for the 2nd circuit,
you need to upload the program to ATmega328. This is done by replacing the
ATmega328 microcontroller on Arduino Uno Board with a fresh ATmega328
micro-controller. Before uploading you need to upload bootloader, then the only
program can be successfully uploaded.
float Vout = 0.00;
float Vin = 0.00;
float R1 = 100000.00; // resistance of R1 (100K)
float R2 = 10000.00; // resistance of R2 (10K)
int val = 0;
void setup(){
Serial.begin(9600); //BaudRate
}
void loop(){
val = analogRead(A0);//reads the analog input
Vout = (val * 5.00) / 1024.00; // formula for calculating voltage out i.e. V+, here 5.00
Vin = Vout / (R2/(R1+R2)); // formula for calculating voltage in i.e. GND
Serial.print("\t Voltage of the given source = ");
Serial.println(Vin);
delay(1000); //for maintaining the speed of the output in serial moniter
}
No comments:
Post a Comment