I've changed the two ADC resistors to 10k and 3.9k, giving me a range of 0V - 4.9V to be able to check the battery connected to the system.
Here's a little conversion script for reading and printing the values. I'm high on sugar, so it took me longer than I am able to admit :D
int r1 = 3883;
int r2 = 1000;
void setup() {
Serial.begin(9600);
}
void loop() {
float val = analogRead(A0);
float vout = (val) * (r1 + r2) / r2 / 1023;
Serial.print(val);
Serial.print(" - ");
Serial.println(vout);
delay(200);
}
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.