Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
edwardthe
Published © GPL3+

Make Arduino UNO Voltmeter Within 2 Minutes!

In this project you'll see how to make a voltmeter using an Arduino UNO

BeginnerFull instructions provided272
Make Arduino UNO Voltmeter Within 2 Minutes!

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Jumper wires (generic)
Jumper wires (generic)
×1
Through Hole Resistor, 33 kohm
Through Hole Resistor, 33 kohm
×1
Resistor 1M ohm
Resistor 1M ohm
×1
Breadboard (generic)
Breadboard (generic)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

circuit diagram of arduino voltmeter

the sketch has been made on Proteus IDE

Code

arduino voltmeter code

Arduino
this code will work only if the resistor value is approx. similar to the shown
float input_volt = 0.0;
float temp = 0.0;
float r1 = 33000.0;
float r2 = 840000.0;

void setup()
{
  Serial.begin(9600);
}

void loop()
{

  int analogvalue = analogRead(A2);
  temp = (analogvalue * 5.0) / 1024.0;
  input_volt = temp / (r2 / (r1 + r2));
  if (input_volt < 0.1)
  {
    input_volt = 0.0;
  }
  Serial.print("Volts =  ");
  Serial.println(input_volt);

  delay(100);


}

Credits

edwardthe
3 projects • 1 follower
Contact

Comments

Please log in or sign up to comment.