All submissions

Simple voltmeter using ADC

Solving Approach:

How do you plan to solve it?

Use a potentiometer on A0.

Convert raw measurement to Volts

 

Code

/*Paste your code here*/

// C++ code
//
#define potPin 0
char str[80];

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

void loop() {
  int pot, voltage;
  pot= analogRead(potPin);
  voltage= map(pot, 0, 1023, 0, 5000);
  sprintf(str, "pot: %5d , voltage: %5d mV", pot, voltage);
  Serial.println(str);
  delay(1000);
}

 

Output

Video

Add video of output (know more)

 

 

 

 

Photo of Output

Add a photo of your hardware showing the output.

 

 

 

 

 

Submit Your Solution

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