Simple voltmeter using ADC

Solving Approach:

How do you plan to solve it?

  • Read the voltage at Analogue Pin A0 and convert it into a voltage

 

Code

/*Paste your code here*/

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

void loop() {
  int val = analogRead(A0);
  float voltage = val * (5.0 / 1023.0); // convert to voltage
  Serial.println(voltage); // prints 0 to 5.0
  delay(100);
}

 

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!