In this tutorial, the basic is the use of analogue on Arduino. The recommendation from the input on the Arduino that I share can read from 0.01 vdc to 5 vdc (recommendation). If you want to use more than you can use prisoners (resistors) or can also be called divider dividers. then enter with an additional formula according to the resistor value. but this time the admin shared the 5 VDC max input.
Schematic:
Source Code [Raw]
#define pinTeg A0
void setup() {
Serial.begin(9600);
}
void loop() {
readTeg(); // MEMANGGIL PROGRAM
}
// PROGRAM MEMBACA TEGANGAN
void readTeg(){
int ValueTeg = analogRead(pinTeg);
float tegangan = ValueTeg * (5.0 / 1023.0);
Serial.print("Tegangan : ");
Serial.print(tegangan);
Serial.println(" Volt");
delay(100);
}
Or Download File Source Code
[ voltmeter.ino ]
Note :
Here I use pin A0 on Arduino as input voltEnough the tutorial "Reading voltage using Arduino" Thank you.
0 Komentar