Simple voltmeter using ADC

Solving Approach:

How do you plan to solve it?

 

 

Code

/*Paste your code here*/
#define potpin A0
void setup()
{
  Serial.begin(9600);
  analogReference(DEFAULT);
}

void loop()
{
  int potval = analogRead(potpin);
  float voltageval = (float) potval / 1023 * 5;
  Serial.print("ADC Value: ");
  Serial.print(potval);
  Serial.print(" | Voltage: ");
  Serial.print(voltageval);
  Serial.println(" V");
  delay(50);
}


 

Output

Video

Add video of output (know more)

 

 

 

 

 

Photo of Output

Add a photo of your hardware showing the output.

 

 

 

 

Upvote
Downvote

Submit Your Solution

Note: Once submitted, your solution goes public, helping others learn from your approach!