Arduino - Analog Read Voltage
Analog Signal
This article is a continuation of Arduino - AnalogRead, read analog signal from potentiometer same old article, but this article add calculate ADC from 0 - 1023 to 0-5volt
Voltage = Analog value * (5.0/1023)
Arduino board read analog value from potentiometer
Example Program
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void setup() | |
{ | |
Serial.begin(9600); | |
} | |
void loop() | |
{ | |
int sensorValue = analogRead(A0); | |
float voltageValue = sensorValue*(5.0/1023.0); | |
Serial.println(voltageValue); | |
delay(100); | |
} |
Serial Monitor
Serial Plotter
Comments
Post a Comment