27. Simple voltmeter using ADC

Back To All Submissions
Previous Submission
Next Submission

Solving Approach:

How do you plan to solve it?

 

 

Code

/*Paste your code here*/
const int analogPin = A0;

void setup() {
  Serial.begin(9600);
  Serial.println("Simple Voltmeter - Ready!");
}

void loop() {
  
  int analogValue = analogRead(analogPin);
  
  float voltage = (analogValue * 5.0) / 1024.0;
  

  Serial.print("ADC Value: ");
  Serial.print(analogValue);
  Serial.print(" | Voltage: ");
  Serial.print(voltage, 2);
  Serial.println(" V");
  
  delay(500); 
}



 

Output

Video

Add video of output (know more)

 

 

 

 

 

Photo of Output

Add a photo of your hardware showing the output.

 

 

 

 

 

Was this helpful?
Upvote
Downvote